From 9e0601c09086a8340accd8657b97d1ec18648ada Mon Sep 17 00:00:00 2001 From: Christopher Svensson Date: Tue, 28 Jul 2020 10:31:30 +0200 Subject: [PATCH] Print out mask file read failure Added print statement when mask file could not be read. --- frigate/video.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frigate/video.py b/frigate/video.py index a9e0e0e47..dc116db76 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -190,6 +190,8 @@ def track_camera(name, config, global_objects_config, frame_queue, frame_shape, # load in the mask for object detection if 'mask' in config: mask = cv2.imread("/config/{}".format(config['mask']), cv2.IMREAD_GRAYSCALE) + if img.size == 0: + print(f"Failed to read mask file") else: mask = None @@ -370,4 +372,4 @@ def track_camera(name, config, global_objects_config, frame_queue, frame_shape, # add to the queue detected_objects_queue.put((name, frame_time, object_tracker.tracked_objects)) - print(f"{name}: exiting subprocess") \ No newline at end of file + print(f"{name}: exiting subprocess")