From 2351c9a3b58e3f392f62b6e6ebb17eb7cac2201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Eefik=20Serangil?= Date: Wed, 2 Sep 2020 10:44:13 +0300 Subject: [PATCH] warning added to stream function --- deepface/DeepFace.py | 8 +++++++- deepface/commons/realtime.py | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index e2a6d93..bb0b283 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -254,7 +254,13 @@ def verify(img1_path, img2_path='' 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 index in pbar: diff --git a/deepface/commons/realtime.py b/deepface/commons/realtime.py index c0f7412..9540577 100644 --- a/deepface/commons/realtime.py +++ b/deepface/commons/realtime.py @@ -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): input_shape = (224, 224) + input_shape_x = input_shape[0]; input_shape_y = input_shape[1] + text_color = (255,255,255) employees = [] @@ -30,6 +32,8 @@ def analysis(db_path, model_name, distance_metric, enable_face_analysis = True): #print(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.") #------------------------