def dlib_function(self,image):
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(self.shape_predictor)
image = imutils.resize(image, width=500)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
rects = detector(image, 1)
for (i, rect) in enumerate(rects):
shape = predictor(gray, rect)
shape = face_utils.shape_to_np(shape)
for (x, y) in shape:
cv2.circle(image, (x, y), 1, (0, 0, 255), -1)
return image
facepose_detection.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录