Someone who does face detection. It's good that it doesn't look like hard coding. For example, if you don't use imutils
point_idxs = [ 1, # right ear 3, # right cheak1 4, # right cheak2 33, # nose top 12, # left cheak1 13, # left cheak2 15, # left ear 28, # nose line ] warp_points = [0, 2, 4, 6]
What was supposed to be
from imutil import face_util (lStart, lEnd) = face_utils.FACIAL_LANDMARKS_IDXS["left_eye"] (rStart, rEnd) = face_utils.FACIAL_LANDMARKS_IDXS["right_eye"] (mStart, mEnd) = face_utils.FACIAL_LANDMARKS_IDXS["mouth"]
Can be done
shape = predictor(gray, rects) shape = face_utils.shape_to_np(shape)
Can be done.
frame = imutils.resize(frame, width=450)
However, it has the disadvantage of increasing the number of extra libraries.