Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Can I use verify() to group faces across two images? #1013

Closed
utility-aagrawal opened this issue Feb 7, 2024 · 7 comments
Closed
Labels
question Further information is requested

Comments

@utility-aagrawal
Copy link

utility-aagrawal commented Feb 7, 2024

Hi,

For my use case, I want to group faces if they are of the same person. I understand that I can use verify() for this purpose but what if I have two images and both have two of the same people. I want to identify that both faces are same between images. Is that something I can do using this library?

Basically, I want to mimic AWS Rekognition's compare_faces() behavior by comparing all faces in one image to all faces in the other image and based on a similarity threshold value, return a list of matches and mismatches.

If not, do you have any alternative recommendations? Thanks!

@serengil
Copy link
Owner

serengil commented Feb 8, 2024

verify compares the most similar ones in that image pair even if same two person are available.

@serengil serengil closed this as completed Feb 8, 2024
@serengil serengil added the question Further information is requested label Feb 8, 2024
@utility-aagrawal
Copy link
Author

@serengil , Thanks for your response! I understand that from the readme. I think what I am asking is if it is possible to do many-to-many comparison and return all the matches.

In the code, I see that we are comparing all the faces between two images but only returning the most similar match based on the best distance:

threshold = find_threshold(model_name, distance_metric)

I would be willing to open a PR if you think this feature would be useful. One thing I would need to understand is how you came up with hardcoded threshold for different model_name, distance_metric combinations. Thanks!

@serengil
Copy link
Owner

serengil commented Feb 8, 2024

I am very satisfied with the current version of verify function. IMO, that feature would not be helpful. Still, thank you for your interest.

Secondly, you can use the distance in the response instead of verified key if you want to use your own threshold.

@utility-aagrawal
Copy link
Author

@serengil Thanks!

@utility-aagrawal
Copy link
Author

@serengil , I would like to get your opinion on my use case. I am trying to build a face detection and tracking platform on video data. The problem is that there could be multiple individuals in a frame and I want to be able to track them all across frames. Is that something I can implement using your library? If not, do you have any alternative recommendations?

@serengil
Copy link
Owner

serengil commented Feb 8, 2024

Please checkout stream function, it does similar task

@utility-aagrawal
Copy link
Author

Thanks a lot @serengil ! I'll check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants