Skip to content

Commit

Permalink
update birdseye to handle stationary objects
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Feb 19, 2022
1 parent 1a009c7 commit ebdfbfe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/docs/integrations/mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand All @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions frigate/object_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def to_dict(self, include_thumbnail: bool = False):
"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(),
Expand Down
7 changes: 2 additions & 5 deletions frigate/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ def camera_active(self, object_box_count, motion_box_count):
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:
Expand Down Expand Up @@ -418,7 +415,7 @@ def receiveSignal(signalNumber, frame):
):
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,
Expand Down

0 comments on commit ebdfbfe

Please sign in to comment.