Dlib: Frontal_face_detector returns rectangles with negative coordinates

Created on 22 Aug 2017  路  1Comment  路  Source: davisking/dlib

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

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackweiwang picture jackweiwang  路  4Comments

abhisheksoni27 picture abhisheksoni27  路  4Comments

unicorn7t picture unicorn7t  路  3Comments

srikanthreddybethi picture srikanthreddybethi  路  4Comments

mohsin512 picture mohsin512  路  5Comments