ageitgey / ageitgey/face_recognition
how to load opencv object to face_recognition. load_image_file() api does not work for this.
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.0.0
face-recognition-models==0.3.0 -
Python version: 3.6.3
-
Operating System: 10.13.1 MacOS High Sierra
Description
I would like to load an opencv image object into face_recognition library.
I am using Django Python, I have used opencv to crop and do some face quality checks.
Here is what something I did:
im_cv = cv2.imread(im_path)
result, checked_cv_image = process(im_cv)
unknown_image = face_recognition.load_image_file(checked_cv_image) <-- this doesnt work
it complaints:
AttributeError: 'numpy.ndarray' object has no attribute 'read'
What I Did
unknown_image = face_recognition.load_image_file(checked_cv_image) <-- this doesnt work, checked_cv_image is an opencv object
I would like to know is it possible to figure a way how to load an opencv object into face_recognition object.
Thanks, really appreciate there is a way for this.
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 by reproducing the failure at face_recognition.load_image_file(checked_cv_image) using the reported Python, face-recognition, and macOS versions. Trace the load_image_file entry point and determine the expected handling of the numpy.ndarray returned by cv2.imread and process; done should be a clearly defined supported behavior or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- opencv, python
- Domain
- api, computer-vision
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100