warning added to stream function

This commit is contained in:
Şefik Serangil 2020-09-02 10:44:13 +03:00
parent e35136b6c4
commit 2351c9a3b5
2 changed files with 11 additions and 1 deletions

View File

@ -254,7 +254,13 @@ def verify(img1_path, img2_path=''
threshold = functions.findThreshold(model_name, distance_metric) threshold = functions.findThreshold(model_name, distance_metric)
#------------------------------ #------------------------------
pbar = tqdm(range(0,len(img_list)), desc='Verification')
if len(img_list) > 1:
disable_option = False
else: #calling deepface in a for loop causes lots of progress bars. this block prevents this problem.
disable_option = True
pbar = tqdm(range(0,len(img_list)), desc='Verification', disable = disable_option)
#for instance in img_list: #for instance in img_list:
for index in pbar: for index in pbar:

View File

@ -17,6 +17,8 @@ from deepface.commons import functions, realtime, distance as dst
def analysis(db_path, model_name, distance_metric, enable_face_analysis = True): def analysis(db_path, model_name, distance_metric, enable_face_analysis = True):
input_shape = (224, 224) input_shape = (224, 224)
input_shape_x = input_shape[0]; input_shape_y = input_shape[1]
text_color = (255,255,255) text_color = (255,255,255)
employees = [] employees = []
@ -30,6 +32,8 @@ def analysis(db_path, model_name, distance_metric, enable_face_analysis = True):
#print(exact_path) #print(exact_path)
employees.append(exact_path) employees.append(exact_path)
if len(employees) == 0:
print("WARNING: There is no image in this path ( ", db_path,") . Face recognition will not be performed.")
#------------------------ #------------------------