Created
February 20, 2020 20:57
-
-
Save BindiChen/382ca1569b94f02bd4a98d5dc50ad201 to your computer and use it in GitHub Desktop.
Create a list of all known face encodings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 100 # Suppose there is 100 known people | |
known_face_encodings = [] | |
for num in range(1, n + 1): | |
image_file = f"known_person_{num}.jpg" | |
# Load each known image | |
image_of_person = face_recognition.load_image_file(image_file) | |
# Get the face encoding of each person. This can fail if no one is found in the photo | |
face_encoding = face_recognition.face_encodings(image_of_person)[0] | |
# Create a list of all known face encodings | |
known_face_encodings.append(face_encoding) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment