unit tests for detector backends

This commit is contained in:
Şefik Serangil 2020-09-05 22:53:47 +03:00
parent b9abfb9c00
commit 16f1ac0d48

View File

@ -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("--------------------------")