From 436d474b99baad506b865afb3aab346b1767971f Mon Sep 17 00:00:00 2001 From: Olegs NIKISINS <onikisins@italix03.idiap.ch> Date: Mon, 16 Oct 2017 11:29:12 +0200 Subject: [PATCH] Fixed the None case in face detection utils --- bob/pad/face/utils/face_detection_utils.py | 14 ++++++++------ develop.cfg | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bob/pad/face/utils/face_detection_utils.py b/bob/pad/face/utils/face_detection_utils.py index 2214958d..1bfff767 100644 --- a/bob/pad/face/utils/face_detection_utils.py +++ b/bob/pad/face/utils/face_detection_utils.py @@ -27,21 +27,23 @@ def detect_face_in_image(image): Dictionary must be as follows ``{'topleft': (row, col), 'bottomright': (row, col)}``. """ - bounding_box, _ = bob.ip.dlib.FaceDetector().detect_single_face(image) + data = bob.ip.dlib.FaceDetector().detect_single_face(image) annotations = {} - if bounding_box is not None: + if data is None: - annotations['topleft'] = bounding_box.topleft + annotations['topleft'] = (0, 0) - annotations['bottomright'] = bounding_box.bottomright + annotations['bottomright'] = (0, 0) else: - annotations['topleft'] = (0, 0) + bounding_box = data[0] - annotations['bottomright'] = (0, 0) + annotations['topleft'] = bounding_box.topleft + + annotations['bottomright'] = bounding_box.bottomright return annotations diff --git a/develop.cfg b/develop.cfg index f8617f19..ddc5fe3d 100644 --- a/develop.cfg +++ b/develop.cfg @@ -22,6 +22,7 @@ eggs = bob.pad.face bob.learn.activation bob.ip.flandmark bob.ip.facedetect + bob.ip.dlib bob.ip.qualitymeasure bob.learn.linear bob.db.base @@ -56,6 +57,7 @@ develop = src/bob.extension src/bob.learn.activation src/bob.ip.flandmark src/bob.ip.facedetect + src/bob.ip.dlib src/bob.ip.qualitymeasure src/bob.learn.linear src/bob.db.base @@ -92,6 +94,7 @@ bob.io.matlab = git git@gitlab.idiap.ch:bob/bob.io.matlab bob.learn.activation = git git@gitlab.idiap.ch:bob/bob.learn.activation bob.ip.flandmark = git git@gitlab.idiap.ch:bob/bob.ip.flandmark bob.ip.facedetect = git git@gitlab.idiap.ch:bob/bob.ip.facedetect +bob.ip.dlib = git git@gitlab.idiap.ch:bob/bob.ip.dlib bob.ip.qualitymeasure = git git@gitlab.idiap.ch:bob/bob.ip.qualitymeasure bob.learn.linear = git git@gitlab.idiap.ch:bob/bob.learn.linear bob.db.base = git git@gitlab.idiap.ch:bob/bob.db.base -- GitLab