April 2020
Intermediate to advanced
438 pages
12h 2m
English
Run the following steps to implement facial alignment using the imutil library (from PyImagesearch):
detector = dlib.get_frontal_face_detector()predictor = dlib.shape_predictor('models/shape_predictor_68_face_landmarks.dat')face_aligner = FaceAligner(predictor, desiredFaceWidth=256)
image = cv2.imread('images/scientists.png')image = imutils.resize(image, width=800)gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
Now, if you plot the original image, you will get an output like the ...
Read now
Unlock full access