importface_recognitionimage=face_recognition.load_image_file("my_picture.jpg")
face_locations=face_recognition.face_locations(image)
# face_locations is now an array listing the co-ordinates of each face!
importface_recognitionimage=face_recognition.load_image_file("my_picture.jpg")
face_locations=face_recognition.face_locations(image, model="cnn")
# face_locations is now an array listing the co-ordinates of each face!
importface_recognitionimage=face_recognition.load_image_file("my_picture.jpg")
face_landmarks_list=face_recognition.face_landmarks(image)
# face_landmarks_list is now an array with the locations of each facial feature in each face.# face_landmarks_list[0]['left_eye'] would be the location and outline of the first person's left eye.
importface_recognitionpicture_of_me=face_recognition.load_image_file("me.jpg")
my_face_encoding=face_recognition.face_encodings(picture_of_me)[0]
# my_face_encoding now contains a universal 'encoding' of my facial features that can be compared to any other picture of a face!unknown_picture=face_recognition.load_image_file("unknown.jpg")
unknown_face_encoding=face_recognition.face_encodings(unknown_picture)[0]
# Now we can see the two face encodings are of the same person with `compare_faces`!results=face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)
ifresults[0] ==True:
print("It's a picture of me!")
else:
print("It's not a picture of me!")
$ uvicorn main:app --reloadINFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)INFO: Started reloader process [28720]INFO: Started server process [28722]INFO: Waiting for application startup.INFO: Application startup complete.
有关进一步的配置,请查看customconfig.yml。要添加自定义,您可以编辑此文件,也可以将另一个同名文件“customconfig.yml”添加到运行Manim的任何目录中。例如this is the one为3Blue1Brown录像带。在那里,您可以指定视频应输出到的位置、Manim应在何处查找要读取的图像文件和声音,以及有关样式和视频质量的其他默认设置