From 5bb5e2dc5a286bb2d70959e8f7a2782f4720c509 Mon Sep 17 00:00:00 2001 From: Nate Meyer Date: Fri, 14 Jul 2023 20:01:53 -0400 Subject: [PATCH] Add check for valid label index for object detection (#7149) (#7164) --- frigate/object_detection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frigate/object_detection.py b/frigate/object_detection.py index a0c31b755..22adb954e 100644 --- a/frigate/object_detection.py +++ b/frigate/object_detection.py @@ -59,6 +59,9 @@ class LocalObjectDetector(ObjectDetector): raw_detections = self.detect_raw(tensor_input) for d in raw_detections: + if int(d[0]) < 0 or int(d[0]) >= len(self.labels): + logger.warning(f"Raw Detect returned invalid label: {d}") + continue if d[1] < threshold: break detections.append(