ageitgey / ageitgey/face_recognition

TypeError: 'NoneType' object is not callable

Open
#205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
56.8k
Forks
13.7k
PR merge metrics
No merged PRs in 30d

Description

  • 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))

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with face_recognition/api.py at _raw_face_locations, line 97, where the traceback calls face_detector, and inspect how that detector is initialized. Reproduce the example under Python 3.6, Windows 7, face_recognition 1.00, and dlib 19.7. Done means identifying why face_detector is None and documenting or fixing the compatible setup or code path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.