From b38e95c4078b67d2d669b5809889f5faa3c8ae8b Mon Sep 17 00:00:00 2001 From: galthran-wq Date: Wed, 12 Feb 2025 15:47:24 +0000 Subject: [PATCH] test batch extract faces --- tests/test_extract_faces.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_extract_faces.py b/tests/test_extract_faces.py index 262d22d..89f025d 100644 --- a/tests/test_extract_faces.py +++ b/tests/test_extract_faces.py @@ -79,6 +79,20 @@ def test_different_detectors(): logger.info(f"✅ extract_faces for {detector} backend test is done") +@pytest.mark.parametrize("detector_backend", [ + # "YOLO", + "opencv", +]) +def test_batch_extract_faces(detector_backend): + img_paths = [ + "dataset/img2.jpg", + "dataset/img3.jpg", + "dataset/img11.jpg", + ] + img_objs = DeepFace.extract_faces(img_path=img_paths, detector_backend=detector_backend) + assert len(img_objs) == 3 + + def test_backends_for_enforced_detection_with_non_facial_inputs(): black_img = np.zeros([224, 224, 3]) for detector in detectors: