This section includes information for using the pure Python API of
Returns a string containing the configuration information.
A key-point localization for faces using Flandmark
This class can be used to locate facial landmarks on pre-detected faces. You input an image and a bounding-box specification and it returns you the positions for multiple key-points for the given face image.
Consult http://cmp.felk.cvut.cz/~uricamic/flandmark/index.php for more information.
Initializes the key-point locator with a model.
model: str (path), optionalPath to the localization model. If not set (or set to
None), then use the default localization model, stored on the class variable
locate(image, y, x, height, width) → landmarks¶
Locates keypoints on a single facial bounding-box on the provided image.
This method will locate 8 keypoints inside the bounding-box defined for the current input image, organized in this way:
Canthus-rl (inner corner of the right eye).
The “right eye” means the right eye at the face w.r.t. the person on the image. That is the left eye in the image, from the viewer’s perspective.
Canthus-lr (inner corner of the left eye)
Mouth-corner-r (right corner of the mouth)
Mouth-corner-l (left corner of the mouth)
Canthus-rr (outer corner of the right eye)
Canthus-ll (outer corner of the left eye)
Each point is returned as tuple defining the pixel positions in the form
image: array-like (2D, uint8)The image Flandmark will operate on
y, x: intThe top left-most corner of the bounding box containing the face image you want to locate keypoints on, defaults to 0.
height, width: intThe dimensions accross
x(width) for the bounding box, in number of pixels; defaults to full image resolution.
landmarks: array (2D, float64)Each row in the output array contains the locations of keypoints in the format