diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index c1364f0aa..1dcc8405d 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -55,9 +55,6 @@ class PtzMotionEstimator: self.camera_config = config self.coord_transformations = None self.ptz_metrics = ptz_metrics - self.ptz_start_time = self.ptz_metrics.start_time - self.ptz_stop_time = self.ptz_metrics.stop_time - self.ptz_metrics.reset.set() logger.debug(f"{config.name}: Motion estimator init") @@ -86,7 +83,9 @@ class PtzMotionEstimator: self.coord_transformations = None if ptz_moving_at_frame_time( - frame_time, self.ptz_start_time.value, self.ptz_stop_time.value + frame_time, + self.ptz_metrics.start_time.value, + self.ptz_metrics.stop_time.value, ): logger.debug( f"{camera}: Motion estimator running - frame time: {frame_time}" diff --git a/frigate/track/norfair_tracker.py b/frigate/track/norfair_tracker.py index 985a53165..99085be4d 100644 --- a/frigate/track/norfair_tracker.py +++ b/frigate/track/norfair_tracker.py @@ -85,7 +85,6 @@ class NorfairTracker(ObjectTracker): self.camera_config = config self.detect_config = config.detect self.ptz_metrics = ptz_metrics - self.ptz_autotracker_enabled = ptz_metrics.autotracker_enabled self.ptz_motion_estimator = {} self.camera_name = config.name self.track_id_map = {} @@ -104,7 +103,7 @@ class NorfairTracker(ObjectTracker): # the different tracker per object class filter_factory=OptimizedKalmanFilterFactory(R=3.4), ) - if self.ptz_autotracker_enabled.value: + if self.ptz_metrics.autotracker_enabled.value: self.ptz_motion_estimator = PtzMotionEstimator( self.camera_config, self.ptz_metrics ) @@ -315,7 +314,7 @@ class NorfairTracker(ObjectTracker): coord_transformations = None - if self.ptz_autotracker_enabled.value: + if self.ptz_metrics.autotracker_enabled.value: # we must have been enabled by mqtt, so set up the estimator if not self.ptz_motion_estimator: self.ptz_motion_estimator = PtzMotionEstimator(