import matplotlib.pyplot as plt
import face_recognition
img = face_recognition.load_image_file('131331w8joym8to6bmvz6t.jpg')
plt.imshow(img)
face_count = len(face_recognition.face_locations(img))
for index,(a,b,c,d) in enumerate(face_recognition.face_locations(img)):
face = img[a:c,d:b]
ax = plt.subplot(1,face_count,index+1)
ax.imshow(face)
ax.set_xticks([])
ax.set_yticks([])
网友评论