serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://bit.ly/deepface-py
MIT License
14.86k stars 2.24k forks source link

Face Verification demo. Wrong distances #374

Closed OTapias closed 3 years ago

OTapias commented 3 years ago

Please advise me. I was running the unit_tests.py. The output reports the following error:

File "D:\emotions\libro tesis\papers\deepface\tests\unit_tests.py", line 33, in img = DeepFace.detectFace("dataset/img11.jpg", detector_backend = detector)

ValueError: Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False.

All files are at the right folder.

OTapias commented 3 years ago

I'm trying with the recognition face demo. The output distances are too low comparing pictures from different characteres. Answers like this comparing img1 against img3

Out[32]: {'verified': True, 'distance': 2.7249488876557315e-05, 'max_threshold_to_verify': 0.4, 'model': 'Facenet', 'similarity_metric': 'cosine'}

serengil commented 3 years ago

Set enforce detection argument to False

img = DeepFace.detectFace("dataset/img11.jpg", detector_backend = detector, enforce_detection = False)

OTapias commented 3 years ago

Thanks serengil for your advise.

I continued with the unit_tests. Please advise me, the following error is reported at the end:

File "D:\emotions\libro tesis\papers\deepface\tests\unit_tests.py", line 246, in raise ValueError("Unit test score does not satisfy the minimum required accuracy. Minimum expected score is ",threshold,"% but this got ",accuracy,"%")

ValueError: ('Unit test score does not satisfy the minimum required accuracy. Minimum expected score is ', 70, '% but this got ', 66.67, '%')