1adrianb / face-alignment

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

Return face bounding boxes along landmarks #227

Open alkoumpa opened 3 years ago

alkoumpa commented 3 years ago

Hi,

These changes allow the user to also return the face bounding box, when calling get_landmarks_from_image or get_landmarks_from_batch, I think it doesn't break existent code and enables a second useful output.

The option to enable this feature is passed as the last argument of FaceAlignment constructor (return_face_results). By having it disabled by default, the return values of the two get_landmarks_* remain as they currently are (only landmarks), therefore doesn't break existent code that expects single output. Also because of the default value in the constructor, it doesn't object creation with less or named arguments.