BeierZhu / Sturcture-Coherency-Face-Alignment

[TIP 2021] We propose a structure-coherent deep feature learning method for face alignment. Unlike most existing face alignment methods which overlook the facial structure cues, we explicitly exploit the relation among facial landmarks to make the detector robust to hard cases such as occlusion and large pose.
25 stars 1 forks source link

training data preprocessing #4

Closed kmlee3535 closed 2 years ago

kmlee3535 commented 2 years ago

Hi! thanks for sharing your work. Your paper helped a lot with understanding the alignment task But I have question with pre-processing data face images in the given train set was all straightly aligned and it seems like this wasn't in PFLD setseperation code. How can I calculate the angle for rotating the face straightly and what is the padding ratio of the image? Can you share the code for this?

BeierZhu commented 2 years ago

HI, the standard algorithm to align face is Procrustes analysis. But I tried a simpler method (1) calculate the mean x and y coordinate of each landmark (2) for each image, calculate the Similarity Transformation Matrix that map the coordinates to the mean pose.

Sorry the code was written like 3 years ago, I cannot find it anymore.

BeierZhu commented 2 years ago

BTW, the code for Procrustes analysis is similar to the class GuidedAffine in my align_transforms.py.

kmlee3535 commented 2 years ago

Thanks!!