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

Encoding is not prepared for certain images #1403

Open
nidhiSingh89 opened this issue Jan 11, 2022 · 2 comments
Open

Encoding is not prepared for certain images #1403

nidhiSingh89 opened this issue Jan 11, 2022 · 2 comments

Comments

@nidhiSingh89
Copy link

  • face_recognition version: 1.3.0
  • Python version: 3.7
  • Operating System: ubuntu

Description

I am using this piece of code for generating encoding of the images for training the model.

    image = PIL.Image.open(services.utils.get_image_from_url(image_url))
    image = ImageOps.exif_transpose(image)
    im_gray = np.array(image)
    rgb = cv.cvtColor(im_gray, cv.COLOR_BGR2RGB)
    boxes = face_recognition.face_locations(rgb,model='hog')
    encodings = face_recognition.face_encodings(rgb, boxes)

This code is working fine for most of the images but for certain images this is generating boxes and encodings as empty array.

What I Did

I tried using cnn model along with number_of_times_to_upsample = 1, but no success. Please help in identifying the issue. I am attaching the images for reference in which we are facing this issue.

image1
image2
image3
image4

@Gaotr2022
Copy link

Maybe the algorithm didn't detect face in these pictures.

@nidhiSingh89
Copy link
Author

Maybe the algorithm didn't detect face in these pictures.

Yeah I understand that, but unable to find the reason for the same. As pictures are clicked directly from the camera and uploaded.
Can you please help in identifying the reason for it.

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

2 participants