From ebdfbfe96c1c8b9fe249f3c147c9bdb98b7809f9 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 12 Feb 2022 06:59:10 -0600 Subject: [PATCH] update birdseye to handle stationary objects --- docs/docs/integrations/mqtt.md | 2 ++ frigate/object_processing.py | 2 ++ frigate/output.py | 7 ++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/docs/integrations/mqtt.md b/docs/docs/integrations/mqtt.md index b048abacb..ef6c07a42 100644 --- a/docs/docs/integrations/mqtt.md +++ b/docs/docs/integrations/mqtt.md @@ -56,6 +56,7 @@ Message published for each changed event. The first message is published when th "thumbnail": null, "has_snapshot": false, "has_clip": false, + "stationary": false, // whether or not the object is considered stationary "motionless_count": 0, // number of frames the object has been motionless "position_changes": 2 // number of times the object has moved from a stationary position }, @@ -78,6 +79,7 @@ Message published for each changed event. The first message is published when th "thumbnail": null, "has_snapshot": false, "has_clip": false, + "stationary": false, // whether or not the object is considered stationary "motionless_count": 0, // number of frames the object has been motionless "position_changes": 2 // number of times the object has changed position } diff --git a/frigate/object_processing.py b/frigate/object_processing.py index ec507ac7c..527e080b3 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -193,6 +193,8 @@ class TrackedObject: "box": self.obj_data["box"], "area": self.obj_data["area"], "region": self.obj_data["region"], + "stationary": self.obj_data["motionless_count"] + > self.camera_config.detect.stationary_threshold, "motionless_count": self.obj_data["motionless_count"], "position_changes": self.obj_data["position_changes"], "current_zones": self.current_zones.copy(), diff --git a/frigate/output.py b/frigate/output.py index a780b3f86..dff8fc47e 100644 --- a/frigate/output.py +++ b/frigate/output.py @@ -184,10 +184,7 @@ class BirdsEyeFrameManager: if self.mode == BirdseyeModeEnum.continuous: return True - if ( - self.mode == BirdseyeModeEnum.motion - and object_box_count + motion_box_count > 0 - ): + if self.mode == BirdseyeModeEnum.motion and motion_box_count > 0: return True if self.mode == BirdseyeModeEnum.objects and object_box_count > 0: @@ -418,7 +415,7 @@ def output_frames(config: FrigateConfig, video_output_queue): ): if birdseye_manager.update( camera, - len(current_tracked_objects), + len([o for o in current_tracked_objects if not o["stationary"]]), len(motion_boxes), frame_time, frame,