import face_recognition
import dlib
from PIL import Image,ImageDraw
image=face_recognition.load_image_file('D:\face\out2.jpg')
face_landmarks_list=face_recognition.face_landmarks(image)
PIL_image=Image.fromarray(image)
d=ImageDraw.Draw(PIL_image)
for face_landmarks in face_landmarks_list:
facial_features=[
'chin',
'left_eyebrow',
'right_eyebrow',
'nose_bridge',
'nose_tip',
'left_eye',
'right_eye',
'top_lip',
'bottom_lip'
]
for facial_feature in facial_features:
print(" {}每个人的面部特征显示在以下位置:{}".format(facial_feature,face_landmarks[facial_feature]))
d.line(face_landmarks[facial_feature],width=3)
PIL_image.show()
face_encodings=face_recognition.face_encodings(image)
for face_encoding in face_encodings:
print("信息编码长度为:{}\n编码信息为:{}".format(len(face_encoding),face_encoding))
报错信息:The full_object_detection must use the iBUG 300W 68 point face landmark style