Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'NoneType' object is not callable #205

Open
isline opened this issue Oct 13, 2017 · 0 comments
Open

TypeError: 'NoneType' object is not callable #205

isline opened this issue Oct 13, 2017 · 0 comments

Comments

@isline
Copy link

isline commented Oct 13, 2017

  • face_recognition version:1.00
  • Python version:3.6
  • Operating System:Win7
    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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant