diff --git a/deepface/commons/functions.py b/deepface/commons/functions.py index 76ccdee..3f7b4d1 100644 --- a/deepface/commons/functions.py +++ b/deepface/commons/functions.py @@ -95,7 +95,7 @@ def load_image(img): def detect_face(img, detector_backend = 'opencv', grayscale = False, enforce_detection = True, align = True): - img_region = [0, 0, img.shape[0], img.shape[1]] + img_region = [0, 0, img.shape[1], img.shape[0]] #---------------------------------------------- #people would like to skip detection and alignment if they already have pre-processed images diff --git a/deepface/detectors/DlibWrapper.py b/deepface/detectors/DlibWrapper.py index 2536892..9acc122 100644 --- a/deepface/detectors/DlibWrapper.py +++ b/deepface/detectors/DlibWrapper.py @@ -45,8 +45,8 @@ def detect_face(detector, img, align = True): sp = detector["sp"] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] - confidence = None + + img_region = [0, 0, img.shape[1], img.shape[0]] face_detector = detector["face_detector"] diff --git a/deepface/detectors/FaceDetector.py b/deepface/detectors/FaceDetector.py index 77d734a..6a33053 100644 --- a/deepface/detectors/FaceDetector.py +++ b/deepface/detectors/FaceDetector.py @@ -40,8 +40,7 @@ def detect_face(face_detector, detector_backend, img, align = True): face, region, confidence = obj[0] #discard multiple faces else: #len(obj) == 0 face = None - region = [0, 0, img.shape[0], img.shape[1]] - confidence = None + region = [0, 0, img.shape[1], img.shape[0]] return face, region, confidence diff --git a/deepface/detectors/MtcnnWrapper.py b/deepface/detectors/MtcnnWrapper.py index 9e9607f..ed55315 100644 --- a/deepface/detectors/MtcnnWrapper.py +++ b/deepface/detectors/MtcnnWrapper.py @@ -11,8 +11,7 @@ def detect_face(face_detector, img, align = True): resp = [] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] - confidence = None + img_region = [0, 0, img.shape[1], img.shape[0]] img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #mtcnn expects RGB but OpenCV read BGR detections = face_detector.detect_faces(img_rgb) diff --git a/deepface/detectors/OpenCvWrapper.py b/deepface/detectors/OpenCvWrapper.py index fd04e00..dbe8830 100644 --- a/deepface/detectors/OpenCvWrapper.py +++ b/deepface/detectors/OpenCvWrapper.py @@ -40,8 +40,7 @@ def detect_face(detector, img, align = True): resp = [] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] - confidence = None + img_region = [0, 0, img.shape[1], img.shape[0]] faces = [] try: diff --git a/deepface/detectors/RetinaFaceWrapper.py b/deepface/detectors/RetinaFaceWrapper.py index 6c1a469..55bea23 100644 --- a/deepface/detectors/RetinaFaceWrapper.py +++ b/deepface/detectors/RetinaFaceWrapper.py @@ -20,7 +20,7 @@ def detect_face(face_detector, img, align = True): """ face = None - img_region = [0, 0, img.shape[0], img.shape[1]] #Really? + img_region = [0, 0, img.shape[1], img.shape[0]] #Really? faces = RetinaFace.extract_faces(img_rgb, model = face_detector, align = align) diff --git a/deepface/detectors/SsdWrapper.py b/deepface/detectors/SsdWrapper.py index 9c9846f..1ba2083 100644 --- a/deepface/detectors/SsdWrapper.py +++ b/deepface/detectors/SsdWrapper.py @@ -51,8 +51,7 @@ def detect_face(detector, img, align = True): resp = [] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] - confidence = None + img_region = [0, 0, img.shape[1], img.shape[0]] ssd_labels = ["img_id", "is_face", "confidence", "left", "top", "right", "bottom"]