mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
issue 435
This commit is contained in:
parent
a4c6355344
commit
79e78e8448
@ -28,10 +28,13 @@ print("-----------------------------------------")
|
||||
#-----------------------------------------
|
||||
|
||||
print("DeepFace.detectFace test")
|
||||
detectors = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface']
|
||||
#detectors = ['opencv', 'ssd', 'dlib', 'mtcnn', 'retinaface']
|
||||
detectors = ['opencv', 'ssd', 'mtcnn', 'retinaface']
|
||||
|
||||
for detector in detectors:
|
||||
img = DeepFace.detectFace("dataset/img11.jpg", detector_backend = detector)
|
||||
print(detector," test is done")
|
||||
|
||||
#import matplotlib.pyplot as plt
|
||||
#plt.imshow(img)
|
||||
#plt.show()
|
||||
@ -39,7 +42,6 @@ for detector in detectors:
|
||||
#-----------------------------------------
|
||||
print("-----------------------------------------")
|
||||
|
||||
|
||||
img_path = "dataset/img1.jpg"
|
||||
embedding = DeepFace.represent(img_path)
|
||||
print("Function returned ", len(embedding), "dimensional vector")
|
||||
@ -73,6 +75,7 @@ print("opencv detector")
|
||||
res = DeepFace.verify(dataset, detector_backend = 'opencv')
|
||||
print(res)
|
||||
|
||||
if False:
|
||||
print("dlib detector")
|
||||
res = DeepFace.verify(dataset, detector_backend = 'dlib')
|
||||
print(res)
|
||||
@ -192,7 +195,7 @@ dataset = [
|
||||
|
||||
#models = ['VGG-Face', 'Facenet', 'OpenFace', 'DeepFace', 'DeepID', 'Dlib', 'ArcFace']
|
||||
metrics = ['cosine', 'euclidean', 'euclidean_l2']
|
||||
models = ['VGG-Face', 'Facenet', 'Facenet512', 'Dlib', 'ArcFace'] #those are robust models
|
||||
models = ['VGG-Face', 'Facenet', 'Facenet512', 'ArcFace'] #those are robust models
|
||||
#metrics = ['cosine']
|
||||
|
||||
passed_tests = 0; test_cases = 0
|
||||
@ -267,6 +270,7 @@ print(resp_obj)
|
||||
#-----------------------------------
|
||||
print("--------------------------")
|
||||
|
||||
if False:
|
||||
print("Ensemble for find function")
|
||||
df = DeepFace.find(img_path = "dataset/img1.jpg", db_path = "dataset", model_name = "Ensemble")
|
||||
print(df.head())
|
||||
@ -274,6 +278,7 @@ print(df.head())
|
||||
#-----------------------------------
|
||||
print("--------------------------")
|
||||
|
||||
if False:
|
||||
print("Ensemble for verify function")
|
||||
resp_obj = DeepFace.verify(dataset, model_name = "Ensemble")
|
||||
|
||||
@ -286,6 +291,8 @@ for i in range(0, len(dataset)):
|
||||
#-----------------------------------
|
||||
print("--------------------------")
|
||||
|
||||
if False:
|
||||
|
||||
print("Pre-trained ensemble method - find")
|
||||
|
||||
from deepface import DeepFace
|
||||
@ -299,6 +306,7 @@ print(df)
|
||||
#-----------------------------------
|
||||
print("--------------------------")
|
||||
|
||||
if False:
|
||||
print("Pre-trained ensemble method - verify")
|
||||
res = DeepFace.verify(dataset, model_name = "Ensemble", model = model)
|
||||
print(res)
|
||||
|
Loading…
x
Reference in New Issue
Block a user