mirror of
https://github.com/serengil/deepface.git
synced 2025-06-09 21:07:09 +00:00
Remove extra BGR2RGB call in RetinaFaceWrapper
I suggest removing the extra BGR2RGB call.
While the RetinaFace model does expect RGB images, the corresponding conversion will be done in the RetinaFace preprocessing:
0c8d3ed8bd/retinaface/commons/preprocess.py (L45)
The extra BGR2RGB call here will in fact make the final channel order wrong, because OpenCV does not know about the channel order, each call will simply swap the channels.
Thanks!
This commit is contained in:
parent
08fd823866
commit
9b816648e0
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user