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

face distance accuracy calculation #245

Open
tetrahydra opened this issue Nov 29, 2017 · 3 comments
Open

face distance accuracy calculation #245

tetrahydra opened this issue Nov 29, 2017 · 3 comments

Comments

@tetrahydra
Copy link

I am using your code from face_distance.py

How can I calculate the matching in percentage? Can I simply re-write

(1 - face_distance)%

for i, face_distance in enumerate(face_distances):
    print("The test image has a distance of {:.2} from known image #{}".format(face_distance, i))
@ageitgey
Copy link
Owner

You can do that if you find it helpful to think of things that way. But keep in mind that the scale isn't exactly linear like that.

The best way to think of it is that a smaller number is less difference and that anything under the threshold you define is a "match". A "85% match" isn't necessarily better than a "80%" match.

@tetrahydra
Copy link
Author

If I were to tell the non-techie users, that their requests were successful and the percentage matching rate is X% for each one, how do I do this?

My idea on threshold is 0.1 is strict and 1 when there is no threshold.

What is threshold in face_recognition, really? My understanding is that it is a permissible error.

@ageitgey
Copy link
Owner

The default threshold is 0.6 or lower face distance is a match. You can use a more strict (lower) threshold if you want by passing in a parameter to the compare_faces() function call.

There's not really a concept of X% match in this algorithm. So however you want to come up with that number is up to you. Whether you call a face distance of 0.6 a 100% match or an 80% match or whatever is up to you.

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

No branches or pull requests

2 participants