diff --git a/deepface/detectors/RetinaFaceWrapper.py b/deepface/detectors/RetinaFaceWrapper.py index 2cdcf97..a4bb6ba 100644 --- a/deepface/detectors/RetinaFaceWrapper.py +++ b/deepface/detectors/RetinaFaceWrapper.py @@ -12,7 +12,7 @@ def detect_face(face_detector, img): img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #retinaface expects RGB but OpenCV read BGR - faces = RetinaFace.extract_faces(img_rgb, align = True) + faces = RetinaFace.extract_faces(img_rgb, model = face_detector, align = True) if len(faces) > 0: face = faces[0][:, :, ::-1] diff --git a/tests/unit_tests.py b/tests/unit_tests.py index 080ba95..951d235 100644 --- a/tests/unit_tests.py +++ b/tests/unit_tests.py @@ -45,6 +45,18 @@ dataset = [ print("-----------------------------------------") +if False: + print("Detector tests") + import matplotlib.pyplot as plt + detectors = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface'] + #detectors = ['retinaface'] + for detector in detectors: + img = DeepFace.detectFace("dataset/img1.jpg", detector_backend = detector) + plt.imshow(img) + plt.show() + +print("-----------------------------------------") + print("Face detectors test") print("retinaface detector")