Merge pull request #367 from bhky/patch-1

Remove extra BGR2RGB call in RetinaFaceWrapper
This commit is contained in:
Sefik Ilkin Serengil 2021-11-11 17:10:38 +03:00 committed by GitHub
commit bd4e418cba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,8 @@ def detect_face(face_detector, img, align = True):
resp = []
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #retinaface expects RGB but OpenCV read BGR
# The BGR2RGB conversion will be done in the preprocessing step of retinaface.
# img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #retinaface expects RGB but OpenCV read BGR
"""
face = None
@ -31,7 +32,7 @@ def detect_face(face_detector, img, align = True):
#--------------------------
obj = RetinaFace.detect_faces(img_rgb, model = face_detector, threshold = 0.9)
obj = RetinaFace.detect_faces(img, model = face_detector, threshold = 0.9)
if type(obj) == dict:
for key in obj: