diff --git a/wyzely_detect/__main__.py b/wyzely_detect/__main__.py index 1b33493..2dce50b 100644 --- a/wyzely_detect/__main__.py +++ b/wyzely_detect/__main__.py @@ -60,7 +60,6 @@ def main(): while True: # Grab a single frame of video ret, frame = video_capture.read() - # Only process every other frame of video to save time # Resize frame of video to a smaller size for faster recognition processing run_frame = cv2.resize(frame, (0, 0), fx=args.run_scale, fy=args.run_scale) # view_frame = cv2.resize(frame, (0, 0), fx=args.view_scale, fy=args.view_scale) diff --git a/wyzely_detect/utils/utils.py b/wyzely_detect/utils/utils.py index 102ed77..ed76e55 100644 --- a/wyzely_detect/utils/utils.py +++ b/wyzely_detect/utils/utils.py @@ -124,13 +124,21 @@ def recognize_face( model_name="ArcFace", detector_backend="opencv", ) - except ValueError as e: + + except (ValueError) as e: if ( str(e) == "Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False." # noqa: E501 ): # print("No faces recognized") # For debugging return None + elif ( + # Check if the error message contains "Validate .jpg or .png files exist in this path." + "Validate .jpg or .png files exist in this path." in str(e) + ): + # If a verbose/silent flag is added, this should be changed to print only if verbose is true + # print("No faces found in database") + return None else: raise e # Iteate over the dataframes