Someone who does face detection. It's good that it doesn't look like hard coding. For example, if you don't use imutils
python
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
python
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
python
shape = predictor(gray, rects[0])
shape = face_utils.shape_to_np(shape)
Can be done.
python
frame = imutils.resize(frame, width=450)
However, it has the disadvantage of increasing the number of extra libraries.
Recommended Posts