mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 19:45:21 +00:00
Fixed minor bug: all regions now are (left, top, width, height)
This commit is contained in:
parent
9069a2854a
commit
eeca8775ca
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user