Closed ricglz closed 3 years ago
I tried running the library using your image and it worked fine. I assume it's an issue with the format of your bounding box. Please see the implementation from https://github.com/1adrianb/face-alignment/tree/master/face_alignment/detection
For an example of how to run the code see: https://github.com/1adrianb/face-alignment/blob/master/examples/detect_landmarks_in_image.py
Running the code linked on your image produces the following result:
Ok, just found the actual error. When doing the points = points[0].astype(numpy.uint8)
statement, attempting to cast float32
to uint8
reduces significantly the value of the numbers. This can be fixed by changing the line to either of the following:
points = points[0].astype(numpy.uint32)
points = points[0].astype(numpy.int32)
points = points[0].astype(int)
I'm trying to create the 2D landmarks of an image, but they're completely wrong as can be seen in the following images:
Original image
Annotated image with bbox and landmarks
Code
Environment
MacbookPro 2012, MacOS