From 498658d0849b6af4debaf9c26f5e2cce924e8987 Mon Sep 17 00:00:00 2001 From: "Anthr@X" Date: Thu, 13 Jul 2023 11:17:09 +1000 Subject: [PATCH] Fix yunet return negative coordinates --- deepface/detectors/YunetWrapper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deepface/detectors/YunetWrapper.py b/deepface/detectors/YunetWrapper.py index dc7b1b2..cc15e03 100644 --- a/deepface/detectors/YunetWrapper.py +++ b/deepface/detectors/YunetWrapper.py @@ -52,6 +52,10 @@ def detect_face(detector, image, align=True, score_threshold=0.9): {x, y}_{re, le, nt, rcm, lcm} stands for the coordinates of right eye, left eye, nose tip, the right corner and left corner of the mouth respectively. """ (x, y, w, h, x_re, y_re, x_le, y_le) = list(map(int, face[:8])) + if x < 0: + x = 0 + if y < 0: + y = 0 if resized: image = original_image x, y, w, h = int(x / r), int(y / r), int(w / r), int(h / r)