validate inputs function removed

This commit is contained in:
Sefik Ilkin Serengil 2020-02-13 10:36:17 +03:00 committed by GitHub
parent 9f785003b8
commit 84fe836623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,19 +20,6 @@ def initializeFolder():
os.mkdir(home+"/.deepface/weights")
print("Directory ",home,"/.deepface/weights created")
def validateInputs(model_name, distance_metric):
distance_metrics = ['cosine', 'euclidean', 'euclidean_l2']
if distance_metric not in distance_metrics:
raise ValueError("Distance metric must be in ",distance_metrics," but you passed ", distance_metric)
#--------------------------
model_names = ['VGG-Face', 'Facenet', 'OpenFace']
if model_name not in model_names:
raise ValueError("Model name metric must be in ",model_names," but you passed ", model_name)
def findThreshold(model_name, distance_metric):
threshold = 0.40
@ -109,4 +96,4 @@ def detectFace(image_path, target_size=(224, 224), grayscale = False):
return img_pixels
else:
raise ValueError("Face could not be detected in ", image_path,". Please confirm that the picture is a face photo.")
raise ValueError("Face could not be detected in ", image_path,". Please confirm that the picture is a face photo.")