NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Cleanup handling of first object message (#15480)
Nicolas Mowenf336a91fee40
diff --git a/frigate/events/maintainer.py b/frigate/events/maintainer.pyindex e2b9245d6e..68e7432abd 100644--- a/frigate/events/maintainer.py+++ b/frigate/events/maintainer.py@@ -82,18 +82,23 @@ class EventProcessor(threading.Thread):)if source_type == EventTypeEnum.tracked_object:+ id = event_data["id"]self.timeline_queue.put((camera,source_type,event_type,- self.events_in_process.get(event_data["id"]),+ self.events_in_process.get(id),event_data,))- if event_type == EventStateEnum.start:- self.events_in_process[event_data["id"]] = event_data+ # if this is the first message, just store it and continue, its not time to insert it in the db+ if (+ event_type == EventStateEnum.start+ or id not in self.events_in_process+ ):+ self.events_in_process[id] = event_datacontinueself.handle_object_detection(event_type, camera, event_data)@@ -123,10 +128,6 @@ class EventProcessor(threading.Thread):"""handle tracked object event updates."""updated_db = False- # if this is the first message, just store it and continue, its not time to insert it in the db- if event_type == EventStateEnum.start:- self.events_in_process[event_data["id"]] = event_data-if should_update_db(self.events_in_process[event_data["id"]], event_data):updated_db = Truecamera_config = self.config.cameras[camera]