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

Accuracy for Face Identification, Need some examples for AccuracyCalculator #709

Open
f-izzat opened this issue Aug 6, 2024 · 1 comment

Comments

@f-izzat
Copy link

f-izzat commented Aug 6, 2024

  • I have a dataset consisting 1000 identities, each with a varying number of face images (minimum 3).
  • I also have a trained face recognition model, say ArcFace to which for every single face image I have its embeddings.
  • How would I use the AccuracyCalculator, If i were to want to evaluate the model in retrieving the top 5 similar faces to the query?
  • Would I randomly select a single face image for each identity as a query then calculate its metrics?

Some examples in how the AccuracyCalculator could be used would be much appreciated

Thanks

@KevinMusgrave
Copy link
Owner

KevinMusgrave commented Aug 7, 2024

Here's an example of where, for each embedding in query, it finds the nearest 5 neighbors in reference, computes some accuracy metric, and returns the average.

ac = AccuracyCalculator(include=("mean_average_precision",), k=5)
results = ac.get_accuracy(query, query_labels, reference, reference_labels)
print(results["mean_average_precision"])

If your query and reference are the same set, you can just pass in query:

results = ac.get_accuracy(query, query_labels)

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