diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index f38c7a530..6c7e3c493 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -408,12 +408,12 @@ def find(img_path, db_path, model_name ='VGG-Face', distance_metric = 'cosine', for r, d, f in os.walk(db_path): # r=root, d=directories, f = files for file in f: - if ('.jpg' in file): + if ('.jpg' in file.lower()) or ('.png' in file.lower()): exact_path = r + "/" + file employees.append(exact_path) if len(employees) == 0: - raise ValueError("There is no image in ", db_path," folder!") + raise ValueError("There is no image in ", db_path," folder! Validate .jpg or .png files exist in this path.") #------------------------ #find representations for db images