mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
Sorting bug for RGB restoration
This commit is contained in:
parent
5f27fa7004
commit
9fbb229b97
@ -1,5 +1,4 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
import cv2
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from mtcnn import MTCNN
|
from mtcnn import MTCNN
|
||||||
from deepface.models.Detector import Detector, DetectedFace, FacialAreaRegion
|
from deepface.models.Detector import Detector, DetectedFace, FacialAreaRegion
|
||||||
@ -32,7 +31,9 @@ class MtCnnClient(Detector):
|
|||||||
|
|
||||||
detected_face = None
|
detected_face = None
|
||||||
|
|
||||||
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # mtcnn expects RGB but OpenCV read BGR
|
# mtcnn expects RGB but OpenCV read BGR
|
||||||
|
# img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
||||||
|
img_rgb = img[:, :, ::-1]
|
||||||
detections = self.model.detect_faces(img_rgb)
|
detections = self.model.detect_faces(img_rgb)
|
||||||
|
|
||||||
if detections is not None and len(detections) > 0:
|
if detections is not None and len(detections) > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user