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

Frontal_face_detector returns rectangles with negative coordinates #767

Closed
itai-icx opened this Issue Aug 22, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@itai-icx
Copy link

itai-icx commented Aug 22, 2017

The issue is that frontal_face_detector returns negative coordinates for the faces it detects.
Reproduction code:

import dlib
import numpy as np
from PIL import Image

im = Image.open('<image_path>')
face_detector = dlib.get_frontal_face_detector()  # Face detector
faces = face_detector(np.array(im.convert('RGB')), 1) # Image is RGBA, so convert to RGB
face = faces[0]
print face

And the image used is the one attached below (taken from Google).
This outputs for me [(-37, 23) (260, 290)].

Maybe I'm missing something, but it seems strange to me that it returns negative coordinates.

Thanks!

15

@davisking

This comment has been minimized.

Copy link
Owner

davisking commented Aug 22, 2017

Yes, you can get negative coordinates because faces can be only party in an image, as your is.

@davisking davisking closed this Aug 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment