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.89k stars 1.33k forks source link

Warning: No faces were detected. #232

Closed Deccan12 closed 3 years ago

Deccan12 commented 3 years ago

I am feeding correct face image but getting following error. For rest of the face images it is working fine but for few of them I am getting following error.

Warning: No faces were detected. Traceback (most recent call last):

File "", line 7, in preds = fa.get_landmarks(input_img)[-1]

TypeError: 'NoneType' object is not subscriptable

1adrianb commented 3 years ago

@Deccan12 If you get the above warning, then, as the message states, the face detector was unable to detect one (perhaps too high or low resolution or the face is too much zoomed in). Of course you can experiment between the sf3d and the blazeface detector and see which one works better in your case. If you already know the location of the face, in terms of (x,y) coordinates of the bbox, then you can pass this information directly to the face alignment function.