exadel-inc / CompreFace

Leading free and open-source face recognition system
https://exadel.com/accelerator-showcase/compreface/
Apache License 2.0
5.72k stars 776 forks source link

Face recognition - several results/set a threshold for similiartity? #805

Open martinenkoEduard opened 2 years ago

martinenkoEduard commented 2 years ago

is there a way to get multiple most simliar faces in return? Is there a way to set a threshold lest's say 0.75 similarity? Is there a way to limit amount of returned similar faces?

pospielov commented 2 years ago

https://github.com/exadel-inc/CompreFace/blob/master/docs/Rest-API-description.md#recognize-faces-from-a-given-image Here is documentation with all parameters CompreFace supports. You can use the prediction_count parameter, which does exactly what you need. There is no way to set the threshold, we always return the N most similar faces, but you implement the threshold on your side of the application.

martinenkoEduard commented 2 years ago

Thanks! Can it return several subjects? it is not really clear in the rest API.

In my test it by some reason returns only one person.

I want to return for instance 100 most similar persons.

pospielov commented 2 years ago

it returns the most similar N faces. If you set it to 100, then it will return the most similar 100 faces. The only thing to mention - it returns similarities to examples, not subjects. So if you upload two examples to one subject, then it can return two similarities to the same subject.

rotj commented 1 year ago

The only thing to mention - it returns similarities to examples, not subjects. So if you upload two examples to one subject, then it can return two similarities to the same subject.

Is there a way to see which example image_ids are being matched? The response only list the same subject name multiple times.

If I wanted to download an image example of the subject for a user to compare, I have to pick a random image_id for now.

pospielov commented 1 year ago

Good point No, there is no way to do it now. I'll create a story for this