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

The final chapter of face recognition-- face recognition

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

2019-11-04 06:35:25

Through the previous article sharing, we shared the first two steps of face recognition, face data extraction, face data neural network training, this issue is the final chapter of face recognition, through the face data model trained in the previous article, face recognition.

Face recognition result

Face recognition system initialization

Initialization system

Line 2-6, insert the necessary third-party libraries

8-10 lines, import the face detection model, the prerequisite step of face recognition is to recognize the face from the picture or video

Line 12-13, import the face recognition model

Line 15-18, import the face model data trained in the previous article, including face data and face label

Face Detection in face recognition

Face detection

On lines 20-23, we import a face image to be recognized and get the size of the image

Line 25-29, calculate the blobs of the picture, import the face detection model, and use pre-feedback to detect faces from the picture.

Face data screening for face recognition

Face data screening

Lines 31-39, first extract the confidence of face detection from the data detected by the face, and filter out the data with confidence greater than 50%, and detect the size of the face from the picture with high confidence. If the size of the face is less than 20, the face is regarded as invalid data.

Line 41-44, from the detected to the face, calculate the blobs of the human face, and import the blobs into the face recognition data model, and use the forward feedback to recognize the human face.

Face recognition

Face recognition

46 lines, using pre-training model to recognize face data

47-48 lines, calculate the confidence of face recognition (using the pre-trained face model and data comparison, get the comparison confidence of the face recognition model and our pre-training model)

Line 49, get the label of face recognition, that is, the name of the face

50-51 lines, print the results of face recognition, including face name and confidence

Line 52-56, draw the face box, and mark the face name and confidence on the box

58-59 lines, showing the picture

Face recognition

Video face recognition of face recognition

To recognize a person's face from a video is to extract the picture of each video frame from the recognition, and use the face recognition of the picture to compare the face data. through the previous article sharing, we also shared a lot of video recognition, including object detection. the steps for face recognition in this part are exactly the same.

Initialize the face model

Initialize the face model

Turn on the default camera

Turn on the default camera

Face detection

Face detection

29 lines to extract the picture from the video

Line 33-38, using face detection model to detect human face

Face data screening

Face data screening

Line 39-47, filter the data whose face confidence is greater than 50%, and filter the data whose face size is greater than 20

Face recognition

Face recognition

Line 49-52 for face recognition

Line 53-56, using the face pre-training model to identify the name and confidence of the face.

Line 59-62, draw the face box and mark the name and confidence of the face in the box

Video data output

65 lines to display the results of face recognition in real time

When closing the program, print the recognition speed, of course, the higher the configuration of the computer, the faster the recognition speed, from the video view, do not feel the card, of course, you can also use the pre-shared multi-process processing method to put the identified part into the multi-process inside to process, only display the results in the while true.

Face recognition

Order

Through the sharing of these three issues of articles, a complete face recognition project can be realized. You can refer to the articles in these three chapters, collect face pictures, and build your own face recognition system, such as smart home. Face recognition attendance system and so on, can use the sharing scheme for face recognition, of course, the editor's technical ability is limited. If you want to improve the accuracy of face recognition to a certain level, you need to design some algorithms.

Take a screenshot from the video

Https://www.toutiao.com/a6754644197862539779/

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