From 06bd1ccbd753ebaa08314aa88d14c2d1e535f50d Mon Sep 17 00:00:00 2001 From: slashtechno <77907286+slashtechno@users.noreply.github.com> Date: Sun, 24 Dec 2023 15:28:47 -0600 Subject: [PATCH] Fixed incorrect warning when using `--detect-object` --- wyzely_detect/__main__.py | 3 +-- wyzely_detect/utils/utils.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wyzely_detect/__main__.py b/wyzely_detect/__main__.py index 7d8e16c..5db34e5 100644 --- a/wyzely_detect/__main__.py +++ b/wyzely_detect/__main__.py @@ -1,6 +1,5 @@ # import face_recognition from pathlib import Path -import os import cv2 # import hjson as json @@ -16,7 +15,7 @@ args = None def main(): global objects_and_peoples - global args + global args # RUN_BY_COMPOSE = os.getenv("RUN_BY_COMPOSE") # Replace this with code to check for gpu args = argparser.parse_args() diff --git a/wyzely_detect/utils/utils.py b/wyzely_detect/utils/utils.py index b5fcd6d..0a12de2 100644 --- a/wyzely_detect/utils/utils.py +++ b/wyzely_detect/utils/utils.py @@ -100,7 +100,7 @@ def process_footage( # Also, make sure that the objects to detect are in the list of objects_and_peoples # If it isn't, print a warning for obj in detect_object: - if obj not in objects_and_peoples: + if obj not in objects_and_peoples["objects"].keys(): print( f"Warning: {obj} is not in the list of objects the model can detect!" )