mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
retinaface perf
This commit is contained in:
parent
0bdc341ce7
commit
f4c78457c2
@ -12,7 +12,7 @@ def detect_face(face_detector, img):
|
||||
|
||||
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #retinaface expects RGB but OpenCV read BGR
|
||||
|
||||
faces = RetinaFace.extract_faces(img_rgb, align = True)
|
||||
faces = RetinaFace.extract_faces(img_rgb, model = face_detector, align = True)
|
||||
|
||||
if len(faces) > 0:
|
||||
face = faces[0][:, :, ::-1]
|
||||
|
@ -45,6 +45,18 @@ dataset = [
|
||||
|
||||
print("-----------------------------------------")
|
||||
|
||||
if False:
|
||||
print("Detector tests")
|
||||
import matplotlib.pyplot as plt
|
||||
detectors = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface']
|
||||
#detectors = ['retinaface']
|
||||
for detector in detectors:
|
||||
img = DeepFace.detectFace("dataset/img1.jpg", detector_backend = detector)
|
||||
plt.imshow(img)
|
||||
plt.show()
|
||||
|
||||
print("-----------------------------------------")
|
||||
|
||||
print("Face detectors test")
|
||||
|
||||
print("retinaface detector")
|
||||
|
Loading…
x
Reference in New Issue
Block a user