Open markwillowtree opened 3 months ago
Indeed, the FaceTransformer + OctupletLoss model, tends to project features more closely than for example ArcFace + Octuplet. You have to set the threshold based on your preferences. I can imagine that for LFW dataset, I guess the best threshold was approx. 0.27 - so you have to adjust the threshold to you needs. (0.5 was just a sample value).
Hope that helps you?
Thanks for the response Martin.
I'm still having trouble with the cosine distances when comparing the embeddings of high and low resolution images together, they're all very low, less than 0.1.
I'm going to double check my code, but in the meantime, could you advise if I should be doing more image pre-processing other than whats already in the code example above?
I'm experiencing a similar problem. How do I set the threshold default for face verification in real data?
Well - make sure the images have float pixel values ranging from 0 to 1. And make sure your images are stored in RGB format - cv2 for example uses RBG format.
I based the code below on the example main.py from the hugging face model page.
Identical images produce a very small distance of 4.919836871231098e-09 as expected.
The different images used here produce a distance of 0.3032730731332305.
The aligned images appear to have been processed correctly at 112x112.
The original images can be found here.
https://resizing.flixster.com/-XZAfHZM39UwaGJIFWKAE8fS0ak=/v3/t/assets/30905_v9_bc.jpg https://upload.wikimedia.org/wikipedia/commons/thumb/3/30/David_Schwimmer_2011.jpg/800px-David_Schwimmer_2011.jpg
Apologies if this is a mistake on my part.