From b62d6cc9a057721ef015da21f4ea4bca1510cc63 Mon Sep 17 00:00:00 2001 From: Andrea Lanfranchi Date: Tue, 27 Feb 2024 10:51:13 +0100 Subject: [PATCH] Amend wrong calculation of increased w and h --- deepface/detectors/DetectorWrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepface/detectors/DetectorWrapper.py b/deepface/detectors/DetectorWrapper.py index e630726..16672d7 100644 --- a/deepface/detectors/DetectorWrapper.py +++ b/deepface/detectors/DetectorWrapper.py @@ -118,8 +118,8 @@ def detect_faces( # Or uncomment this if you want to : # Expand the facial region height and width by the provided percentage # ensuring that the expanded region stays within img.shape limits - expanded_w = int(w * expand_percentage / 100) - expanded_h = int(h * expand_percentage / 100) + expanded_w = w + int(w * expand_percentage / 100) + expanded_h = h + int(h * expand_percentage / 100) x = max(0, x - int((expanded_w - w) / 2)) y = max(0, y - int((expanded_h - h) / 2))