FaceDetect.py 文件源码

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

项目:SwitchFace 作者: messcode 项目源码 文件源码
def annotate_landmarks(img, landmarks, font_scale = 0.4):
    """
    Annotate face landmarks on image. 
    Args:
        img: a cv2 image object.
        landmarks: numpy matrix consisted of points.
    Return:
        annotated image.
    """
    img = img.copy()
    for idx, point in enumerate(landmarks):
        pos = (point[0, 0], point[0, 1])
        cv2.putText(img, str(idx), pos,
                    fontFace=cv2.FONT_HERSHEY_SCRIPT_SIMPLEX,
                    fontScale=font_scale,
                    color=(0, 0, 255))
        cv2.circle(img, pos, 3, color=(0, 255, 255))
    return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号