.jpg .JPG problem

This commit is contained in:
serengil 2020-12-04 14:50:40 +03:00
parent e2fde9157b
commit 7f8186278d

View File

@ -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