ageitgey / ageitgey/face_recognition
Face not detected in an image: number_of_times_to_upsample=2 results in exception
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: face-recognition==1.2.3, face-recognition-models==0.3.0
- Python version: 3.4.3
- Operating System: Ubuntu 14.04
- Django 2.0.5
- Celery 4.2.1
- Redis 2.10.6
Description
My python program detects faces in many photographs (not from cell phone, but scanned images). The baby's face is not detected in one photo (052_002), but was detected in a similar photo (052_003) (both are attached). All the other faces were detected in both photos (including the baby in 052_003).
052_002 - baby looking at mother
052_003 - baby looking at camera


What I Did
When the baby's face in 052_002 was not found, I looked through your web site and found this article - https://github.com/ageitgey/face_recognition/wiki/Face-Detection-Problems, so I tried adding the parameter "number_of_times_to_upsample=2" in face_encodings, but got this error:
face_encodings() got an unexpected keyword argument 'number_of_times_to_upsample'
Paste the command(s) you ran and the output.
image_path = os.path.join(document_path, document_file_name)
image = face_recognition.load_image_file(image_path)
face_encodings = face_recognition.face_encodings(image, number_of_times_to_upsample=2)
If there was a crash, please include the traceback here.
[2018-11-12 11:06:04,077: ERROR/ForkPoolWorker-1] Task biometric_identification.tasks.find_faces_task[dd9be9ee-6529-4a1c-8327-332a5b0b9532] raised unexpected: TypeError("face_encodings() got an unexpected keyword argument 'number_of_times_to_upsample'",)
Traceback (most recent call last):
File "/home/mark/.virtualenvs/memorabilia-JSON/lib/python3.4/site-packages/celery/app/trace.py", line 382, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/mark/.virtualenvs/memorabilia-JSON/lib/python3.4/site-packages/celery/app/trace.py", line 641, in protected_call
return self.run(*args, **kwargs)
File "/home/mark/python-projects/memorabilia-JSON/biometric_identification/tasks.py", line 55, in find_faces_task
face_encodings = face_recognition.face_encodings(image, number_of_times_to_upsample=2)
TypeError: face_encodings() got an unexpected keyword argument 'number_of_times_to_upsample'
Is it possible to change the parameters for face_encodings to find this face?
Is there a way to select the face along the lines of Facebook tagging, and then get the location and encodings so I can add them to my database?
Thanks!
Mark
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the face_recognition.face_encodings entry point and compare its accepted parameters with the Face Detection Problems wiki article. Reproduce the reported TypeError with the shown call, then determine whether the API or documentation should change and verify the chosen behavior with a focused test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100