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.99k stars 1.34k forks source link

Use another face detector #130

Closed Soulthym closed 5 years ago

Soulthym commented 5 years ago

Hi, I am currently using another facial detector (based on YOLO) and would really need to get 3D landmarks on top of it, is it possible to use this module without the detector part? That would be greatly appreciated since I already have cropped faces and am running on a CPU

1adrianb commented 5 years ago

Hi @Soulthym,

Yes, you can. You can check for the format your images need to have (in you case you will set the bounding box as the entire image): https://github.com/1adrianb/face-alignment/blob/master/face_alignment/detection/folder/folder_detector.py

Then, instead of passing the 'sfd' option for detection pass the above one. Alternatively the face alignment option support as an extra argument the bounding boxes directly(see: get_landmarks_from_image). Do note however that depending on the way you cropped the images this may result in an accuracy drop.

Soulthym commented 5 years ago

It works perfectly thanks! I ended up using your detector because it is way more accurate anyway, I hope this issue will help someone having the same question in the future :) Good job!