Follow the steps listed for the face morphing implementation:
- First, use the dlib library's face detector and shape predictor (as you did in the Face alignment with dlib recipe) to automatically compute the facial landmarks from the human face by implementing the get_face_landmarks() function. It takes the input image, a Boolean flag indicating whether to add the boundary points or not, and the dlib library's shape_predictor model's path:
def get_face_landmarks(img, add_boundary_points=True, predictor_path = 'images/shape_predictor_68_face_landmarks.dat'): detector = dlib.get_frontal_face_detector() predictor = dlib.shape_predictor(predictor_path)
- Compute 68 facial landmarks (keypoints) using dlib for each face detected ...