shiningleo007

人脸68个特征反映在蓝线上:

import dlib

from imageio import imread

import glob

 

 

detector = dlib.get_frontal_face_detector()

win = dlib.image_window()

 

predictor_path = \'shape_predictor_68_face_landmarks.dat\'

predictor = dlib.shape_predictor(predictor_path)

 

path = "lena.jpg"

img = imread(path)

dets = detector(img)

print(\'检测到了 %d 个人脸\' % len(dets))

 

 

for i, d in enumerate(dets):

    print(\'- %d: Left %d Top %d Right %d Bottom %d\' % (i, d.left(), d.top(), d.right(), d.bottom()))

    shape = predictor(img, d)

    # 第 0 个点和第 1 个点的坐标

    print(\'Part 0: {}, Part 1: {}\'.format(shape.part(0), shape.part(1)))

win.clear_overlay()

win.set_image(img)

win.add_overlay(dets)

win.add_overlay(shape)

 

 

dlib.hit_enter_to_continue()


分类:

技术点:

相关文章:

  • 2022-01-09
  • 2021-06-30
  • 2021-12-01
  • 2021-11-14
  • 2021-11-04
  • 2021-11-14
  • 2021-09-24
  • 2021-09-24
猜你喜欢
  • 2021-12-01
  • 2021-12-01
  • 2021-09-24
  • 2021-09-24
  • 2021-09-24
相关资源
相似解决方案