当前位置:网站首页>To develop AI face comparison, how to output multiple faces with comparative similarity?

To develop AI face comparison, how to output multiple faces with comparative similarity?

2022-06-23 21:37:00 Tsingsee green rhino video

The function of face recognition has been studied for some time , The main form we need to implement is to compare the recognized face with the face in the face database , Then the face with the highest similarity is selected by the system for matching . therefore , If we pass in a contrast face , Will find the closest face from the registration and return it .

After our discussion , We now need to modify the recognition and comparison mechanism , Need to pass in a picture , Find multiple faces from registered faces ( At present, it is 4 Zhang ) The face comparison map returns , Instead of a face with the highest similarity .

Entrance method of face comparison interface :

Incoming face detection interface ( Will you recognize the face ), And face comparison interface :

The face comparison interface will return the following parameters: : Registered name 、 Similarity and success ; Among them, similarity detection needs to see how to realize , For modification . The following method is used for face registration , There is also a return value of similarity .

face_recognition.compare_faces(self.known_face_encodings, face_encoding, tolerance=tolerance)

The following implementation will return a similarity value :

Find all the ways , Then it's easier to modify the code . Returns a similarity , Then define a variable to return the value of multiple or four pictures and similarity . So the changes are as follows :

Such changes , The interface returns four face recognition images with the highest similarity .

原网站

版权声明
本文为[Tsingsee green rhino video]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112221433052293.html