serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
11.81k stars 2.02k forks source link

smallest distance issue in deepFace.find #304

Closed fizamurtaza closed 3 years ago

fizamurtaza commented 3 years ago

I am using two images [Img78.jpg and Img80.jpg] to compare using DeepFace.verify and I am getting following result: {'verified': True, 'distance': 0.34921315852571366, 'max_threshold_to_verify': 0.4, 'model': 'VGG-Face', 'similarity_metric': 'cosine'}

but when I use DeepFace.find for Img78.jpg it is giving me minimum distance with another image with distance= 0.3923993458579276 which is greater than the distance with Img80.jpg for which the distance was 0.3492.

so my question is why DeepFace.find is not picking the image with the minimum distance?

fizamurtaza commented 3 years ago

img80 img78

fizamurtaza commented 3 years ago

Even this issue is same with Img57 and Img58 given in the dataset folder img58 img57

serengil commented 3 years ago

seems a probably bug

fizamurtaza commented 3 years ago

how it can be corrected?

serengil commented 3 years ago

I'm going to study this tonight.

fizamurtaza commented 3 years ago

I'm going to study this tonight.

Thank you @serengil

serengil commented 3 years ago

I tested it in my environment and it works!

Are you seeing a warning like "WARNING: Representations for images in deepface/tests/dataset folder were previously stored in representations_facenet.pkl". Please delete that .pkl file and run find function again. That might be the reason of your trouble.