Skip to content

how to load opencv object to face_recognition. load_image_file() api does not work for this. #441

@axilaris

Description

@axilaris
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions