TadasBaltrusaitis / OpenFace

OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.
Other
6.93k stars 1.85k forks source link

Can I obtain the landmark coordinates of similarity aligned faces? #696

Open wtomin opened 5 years ago

wtomin commented 5 years ago

Hi, I'd like to know if there is a way to get the 68 landmarks coordinates in similarity aligned face image. I have the facial landmark coordinates in CSV file, but it's in original image, not in the aligned image which has been affine transformed.

By the way, I am also curious about how the affine transformation is done. Based on a few landmarks?

Hope to get your reply soon. Thanks a lot.

TadasBaltrusaitis commented 5 years ago

There is no interface for the landmarks in similarity aligned faces, but you can extract that information from FaceUtils.cpp, specifically AlignFaceMask function, and the destination_landmarks variable. The alignment is done based on a set of landmarks that are most resilient to expression (some face outline nose and eye landmarks), the alignment is done using Kabsch's algorithm.

happypanda5 commented 5 years ago

@wtomin I'm also interested in having transformed landmarks. Please share the code if you have already made the changes (if you are willing to share). Would save me some time. Thanks

callumdg commented 3 years ago

@wtomin @happypanda5 Did either of you successfully implement this, and if so is your code available? I require aligned and generalised (removing the identity of speakers, as per Eskimez) landmarks, and would like to use openFace's models to do this. Thanks!