You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print("Is the unknown face a picture of Biden? {}".format(results[0]))
print("Is the unknown face a picture of Obama? {}".format(results[1]))
print("Is the unknown face a new person that we've never seen before? {}".format(not True in results))
The text was updated successfully, but these errors were encountered:
dlib version:19.7
Description
Python Report Error:
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/untitled1/FaceRecognition/1.py", line 12, in
biden_face_encoding = face_recognition.face_encodings(biden_image)[0]
File "D:\Program Files\Python36\lib\site-packages\face_recognition\api.py", line 189, in face_encodings
raw_landmarks = _raw_face_landmarks(face_image, known_face_locations)
File "D:\Program Files\Python36\lib\site-packages\face_recognition\api.py", line 148, in _raw_face_landmarks
face_locations = _raw_face_locations(face_image)
File "D:\Program Files\Python36\lib\site-packages\face_recognition\api.py", line 97, in _raw_face_locations
return face_detector(img, number_of_times_to_upsample)
TypeError: 'NoneType' object is not callable
Function of “face_detector” in api.py is following:
return face_detector(img, number_of_times_to_upsample)
What I Did
i try to run the code follwing:
import face_recognition
biden_image = face_recognition.load_image_file("C:/face/image/z.jpg")
obama_image = face_recognition.load_image_file("C:/face/image/f.jpg")
unknown_image = face_recognition.load_image_file("C:/face/image/z1.jpg")
biden_face_encoding = face_recognition.face_encodings(biden_image)[0]
obama_face_encoding = face_recognition.face_encodings(obama_image)[0]
unknown_face_encoding = face_recognition.face_encodings(unknown_image)[0]
known_faces = [
biden_face_encoding,
obama_face_encoding
]
results = face_recognition.compare_faces(known_faces, unknown_face_encoding)
print("Is the unknown face a picture of Biden? {}".format(results[0]))
print("Is the unknown face a picture of Obama? {}".format(results[1]))
print("Is the unknown face a new person that we've never seen before? {}".format(not True in results))
The text was updated successfully, but these errors were encountered: