How it works...
The get_frontal_face_detector() function (histogram of oriented gradients (HOG) feature-based) from the dlib library was used to detect the faces. The shape_predictor() function from dlib was invoked with the serialized pre-trained facial landmark detector (the data file) to estimate the (x, y) coordinates of sixty-eight key points that map to facial landmarks (structures) from a given detected face (the dlib shape predictor internally implements Kazemi and Sullivan's algorithm, which uses an ensemble of regression trees to estimate the facial landmarks directly from input face pixels without any feature extraction). The landmarks extracted from a face look like as shown in the following screenshot:
An object of the FaceAligner ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access