mirror of
https://github.com/serengil/deepface.git
synced 2025-06-05 19:15:23 +00:00
validate inputs function removed
This commit is contained in:
parent
9f785003b8
commit
84fe836623
@ -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.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user