1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.88k stars 1.33k forks source link

Addition of confidence scores & bounding boxes doesn't handle "No faces were detected." gracefully. #272

Closed MarkuzK closed 3 years ago

MarkuzK commented 3 years ago

Hey, I appreciate the addition of the confidence scores being returnable with the landmark values. But it seems that the handling of images that have no faces / no faces being detected is not done properly yet.

[...]/face-alignment/face_alignment/api.py:144: UserWarning: No faces were detected. warnings.warn("No faces were detected.") Traceback (most recent call last): [...] File "[...]/face-alignment/face_alignment/api.py", line 243, in get_landmarks_from_batch landmark_set, landmarksscores, = res TypeError: cannot unpack non-iterable NoneType object

In the case that confidence scores are enabled, get_landmarks_from_image still only returns a single None value when 3 values are expected.

Cheers,

  Markus
1adrianb commented 3 years ago

Sorry for this, it should be fixed now.

1-w-m commented 2 years ago

Hey, it's my pleasure to use your codes. After I use the fixed #272 , I still can't get the true model, and I have the same problem which is "No faces were detected." Thanks,

Meng