Closed freedom9393 closed 4 months ago
Can you share input image? Seems like a bug.
I sent it via email
interesting, I can run the verify function with the faces you provided
{'verified': True,
'distance': 1.1102230246251565e-16,
'threshold': 0.68,
'model': 'VGG-Face',
'detector_backend': 'yolov8',
'similarity_metric': 'cosine',
'facial_areas': {'img1': {'x': 106,
'y': 179,
'w': 194,
'h': 265,
'left_eye': (159, 294),
'right_eye': (242, 296)},
'img2': {'x': 106,
'y': 179,
'w': 194,
'h': 265,
'left_eye': (159, 294),
'right_eye': (242, 296)}},
'time': 8.53}
Would you please print the result of this:
from deepface import DeepFace
print(DeepFace.__version__)
When I test those images, I see this error:
ValueError: Face could not be detected in /home/real/Projects/0148e568a63e407f86476d8396d68796_1.jpg.Please confirm that the picture is a face photo or consider to set enforce_detection param to False.
I tested it with pair you just send again. Still, I can get a response.
{'verified': True,
'distance': 0.33096834352615234,
'threshold': 0.68,
'model': 'VGG-Face',
'detector_backend': 'yolov8',
'similarity_metric': 'cosine',
'facial_areas': {'img1': {'x': 163,
'y': 172,
'w': 162,
'h': 202,
'left_eye': (207, 256),
'right_eye': (277, 259)},
'img2': {'x': 106,
'y': 236,
'w': 179,
'h': 217,
'left_eye': (156, 318),
'right_eye': (234, 323)}},
'time': 2.37}
But you mentioned a different exception message. Which one is you getting?
AttributeError: 'NoneType' object has no attribute 'xy'
or
ValueError: Face could not be detected in /home/real/Projects/0148e568a63e407f86476d8396d68796_1.jpg.Please confirm that the picture is a face photo or consider to set enforce_detection param to False.
If you are still getting AttributeError: 'NoneType' object has no attribute 'xy'
error, then I just added keypoints check control in the yolo wrapper: https://github.com/serengil/deepface/blob/master/deepface/detectors/Yolo.py#L84 (not published in pip yet, you should use the source code as described in the read me).
On the other hand, if you are getting Face could not be detected
error, then that is totally different. Consider to set enforce_detection arg to False.
Simply, what I'm trying to run is this:
and I'm facing this error:
AttributeError: 'NoneType' object has no attribute 'xy'
Why is it happening and how to solve it?