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.88k stars 1.33k forks source link

Output of `preds` #268

Closed SchJas closed 3 years ago

SchJas commented 3 years ago

The code provided here for 3D landmarks.

`import face_alignment from skimage import io

fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, flip_input=False)

input = io.imread('../test/assets/aflw-test.jpg') preds = fa.get_landmarks(input)`

I wanted to ask before I install the package. So just to clarify, if I were to print preds I should obtain a (68,2) array, which contains the 68 facial landmark points on the face?

1adrianb commented 3 years ago

For the 3D flag passed in the example the array will be (68,3). If you pass _2D or _2halfD they will be indeed (68,2). If multiple faces are present a list of arrays will be returned.

tianqi-zhao commented 2 years ago

And what the three values means for 3D? For 2D, it is the coordinate of image like (x, y), but I can't understand the meaning for 3D. There are even negative numbers.