Fixed incorrect warning when using `--detect-object`

This commit is contained in:
slashtechno 2023-12-24 15:28:47 -06:00
parent e7b63126d2
commit 06bd1ccbd7
Signed by: slashtechno
GPG Key ID: 8EC1D9D9286C2B17
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,5 @@
# import face_recognition # import face_recognition
from pathlib import Path from pathlib import Path
import os
import cv2 import cv2
# import hjson as json # import hjson as json
@ -16,7 +15,7 @@ args = None
def main(): def main():
global objects_and_peoples global objects_and_peoples
global args global args
# RUN_BY_COMPOSE = os.getenv("RUN_BY_COMPOSE") # Replace this with code to check for gpu # RUN_BY_COMPOSE = os.getenv("RUN_BY_COMPOSE") # Replace this with code to check for gpu
args = argparser.parse_args() args = argparser.parse_args()

View File

@ -100,7 +100,7 @@ def process_footage(
# Also, make sure that the objects to detect are in the list of objects_and_peoples # Also, make sure that the objects to detect are in the list of objects_and_peoples
# If it isn't, print a warning # If it isn't, print a warning
for obj in detect_object: for obj in detect_object:
if obj not in objects_and_peoples: if obj not in objects_and_peoples["objects"].keys():
print( print(
f"Warning: {obj} is not in the list of objects the model can detect!" f"Warning: {obj} is not in the list of objects the model can detect!"
) )