facepose_detection.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:FacePoseEstimation 作者: abhisharma7 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号