Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize face recognition in OpenCV

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to achieve face recognition in OpenCV. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

1. Face detection. OpenCV uses the SSD detection model trained by Caffe to detect faces.

two。 Facial embedded features are extracted, and OpenCV uses FaceNet model in OpenFace project to extract deep learning facial embedded features.

3. Train the face recognition model, and use the SVM algorithm in scikit-learn to train the classifier on the face embedded features.

4. Use the model trained in step 3 to recognize people's faces in images and videos.

The author collects a database of photos of the couple and adds some stills from the movie Jurassic Park like "unknown". There are only 6 pictures in each category.

Look at the effect.

Although the library is very small, the sweet couple can still be recognized.

However, there are some situations that do not seem to be ideal. After all, the database is too small.

The author also discusses how to improve the recognition rate of face recognition system.

1. To collect more data, the author recommends at least 10-20 face images per person.

two。 Adding face alignment preprocessing is equivalent to face geometry normalization including rotation, scale and translation.

3. Adjust hyperparameters

4. Using dlib's deep learning embedded feature extraction, well, dlib's open source face recognition model is more powerful.

See:

Http://blog.dlib.net/2017/02/high-quality-face-recognition-with-deep.html

Why use SVM classifiers instead of end-to-end training?

Because the database is too small to train, the common practice is to use the face model trained on the large database to extract features and use the traditional classification algorithm to recognize faces.

Adrian said in the blog post that "As I mentioned in the introduction to today's face recognition post, I was just married over the weekend, so this post is a" gift "to my new wife."

The above is how to achieve face recognition in OpenCV. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report