From 8de74f0b2f10e60485fa40fa2d64e93b9bf55a95 Mon Sep 17 00:00:00 2001 From: gwmullin <290704+gwmullin@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:49:13 -0700 Subject: [PATCH] Move the check for a change in active status into the code block protected by a false positive check. --- frigate/object_processing.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frigate/object_processing.py b/frigate/object_processing.py index b20e01ddc..fcb65ba26 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -166,9 +166,8 @@ class TrackedObject: if self.computed_score > self.top_score: self.top_score = self.computed_score self.false_positive = self._is_false_positive() - if not self.active == self.is_active(): - # State transition between stationary/active. - significant_change = True + # Hold previous active state for checking further down. + previously_active = self.active self.active = self.is_active() if not self.false_positive: @@ -254,7 +253,9 @@ class TrackedObject: if self.obj_data["attributes"] != obj_data["attributes"]: significant_change = True - + # if the state changed between stationary and active + if previously_active != self.active: + significant_change = True # update at least once per minute if self.obj_data["frame_time"] - self.previous["frame_time"] > 60: