mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +00:00
unit tests for detector backends
This commit is contained in:
parent
b9abfb9c00
commit
16f1ac0d48
@ -1,5 +1,7 @@
|
||||
from deepface import DeepFace
|
||||
from deepface.commons import functions
|
||||
import json
|
||||
import time
|
||||
|
||||
import os
|
||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
|
||||
@ -211,5 +213,22 @@ df = DeepFace.find("dataset/img1.jpg", db_path = "dataset", model_name = 'Ensemb
|
||||
|
||||
print(df)
|
||||
|
||||
#-----------------------------------
|
||||
print("--------------------------")
|
||||
|
||||
print("Different face detector backends")
|
||||
|
||||
backends = ['opencv', 'ssd', 'dlib', 'mtcnn']
|
||||
|
||||
for backend in backends:
|
||||
|
||||
tic = time.time()
|
||||
|
||||
processed_img = functions.preprocess_face(img = "dataset/img11.jpg", detector_backend = backend)
|
||||
|
||||
toc = time.time()
|
||||
|
||||
print("Backend ", backend, " is done in ", toc-tic," seconds")
|
||||
|
||||
#-----------------------------------
|
||||
print("--------------------------")
|
Loading…
x
Reference in New Issue
Block a user