From 988afa6a70f894d2ad455ec48049d9900370d4e0 Mon Sep 17 00:00:00 2001 From: galthran-wq Date: Tue, 18 Feb 2025 10:27:23 +0000 Subject: [PATCH] fix batched numpy array input --- deepface/modules/detection.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deepface/modules/detection.py b/deepface/modules/detection.py index e3b679d..2b14a7c 100644 --- a/deepface/modules/detection.py +++ b/deepface/modules/detection.py @@ -82,6 +82,8 @@ def extract_faces( just available in the result only if anti_spoofing is set to True in input arguments. """ + if isinstance(img_path, np.ndarray) and img_path.ndim == 4: + img_path = [img_path[i] for i in range(img_path.shape[0])] if not isinstance(img_path, list): img_path = [img_path]