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

The normal scale of the vertical axis #206

Closed hermankant closed 4 years ago

hermankant commented 4 years ago

I'm trying to figure out whether I can count on the stability of the axis location, especially that of the vertical axis. I have plotted the landmarks of some faces, and the vertical axis is always inverted, i.e. eyes have lower values than the chin as can be seen in the attached figure. I was wondering if that is always the case and I can count on this behavior or whether I'm doing something wrong/it is unpredictable. image

Also, the plot is always inverted and upside down. I fix it manually by multiplying by a negative number but hopped there is a better way for that. (I refrain from using x,y,z terms as the plot shows y as the vertical, but I think I saw others refer to it as z-axis)

1adrianb commented 4 years ago

All the values are consistent between images (of course there will be some small noise). However their relative position will differ based on head pose. For example if the input face is rotated sufficiently your assumption will not hold any-longer. The points are however ordered so you can always know what part every point represents. Perhaps the easiest way to visualize this is by to plotting the points on top of the image.

hermankant commented 4 years ago

Yes I understand that the relative position changes with head pose change. I also did plot the numbers and saw they remain consistent. But what I mean is whether the direction of the axis remains the same - in the image above we can see that y axis numbers are increasing as we advance downward on the face. My question is whether it is always like that or if sometimes it can increase - i.e. the y value of the chin point will be greater than the y values of the eyes

1adrianb commented 4 years ago

The direction of the axis remains the same: parts found in the upper part of the image will have lower values. This numbers should follow the coordinate system from PIL, which is defined here: https://pillow.readthedocs.io/en/stable/handbook/concepts.html#coordinate-system

hermankant commented 4 years ago

Great, thank you