diff --git a/deepface/commons/functions.py b/deepface/commons/functions.py index ec034ad..7a2ce42 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 d805ee8..e32ee28 100644 --- a/deepface/detectors/DlibWrapper.py +++ b/deepface/detectors/DlibWrapper.py @@ -45,7 +45,7 @@ def detect_face(detector, img, align = True): sp = detector["sp"] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] + img_region = [0, 0, img.shape[1], img.shape[0]] face_detector = detector["face_detector"] detections = face_detector(img, 1) diff --git a/deepface/detectors/FaceDetector.py b/deepface/detectors/FaceDetector.py index 971670f..5e4f449 100644 --- a/deepface/detectors/FaceDetector.py +++ b/deepface/detectors/FaceDetector.py @@ -40,7 +40,7 @@ def detect_face(face_detector, detector_backend, img, align = True): face, region = obj[0] #discard multiple faces else: #len(obj) == 0 face = None - region = [0, 0, img.shape[0], img.shape[1]] + region = [0, 0, img.shape[1], img.shape[0]] return face, region diff --git a/deepface/detectors/MtcnnWrapper.py b/deepface/detectors/MtcnnWrapper.py index aa56533..ac5f02a 100644 --- a/deepface/detectors/MtcnnWrapper.py +++ b/deepface/detectors/MtcnnWrapper.py @@ -11,7 +11,7 @@ def detect_face(face_detector, img, align = True): resp = [] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] + 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 b358f3e..1f5fbc9 100644 --- a/deepface/detectors/OpenCvWrapper.py +++ b/deepface/detectors/OpenCvWrapper.py @@ -40,7 +40,7 @@ def detect_face(detector, img, align = True): resp = [] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] + 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 7e81f8f..d74463d 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 785a002..78aa8de 100644 --- a/deepface/detectors/SsdWrapper.py +++ b/deepface/detectors/SsdWrapper.py @@ -51,7 +51,7 @@ def detect_face(detector, img, align = True): resp = [] detected_face = None - img_region = [0, 0, img.shape[0], img.shape[1]] + img_region = [0, 0, img.shape[1], img.shape[0]] ssd_labels = ["img_id", "is_face", "confidence", "left", "top", "right", "bottom"]