Require init delay (#8126)

This commit is contained in:
Nicolas Mowen 2023-10-13 05:16:36 -06:00 committed by GitHub
parent 869bb2b177
commit e19c0668e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ class NorfairTracker(ObjectTracker):
self.tracker = Tracker( self.tracker = Tracker(
distance_function=frigate_distance, distance_function=frigate_distance,
distance_threshold=2.5, distance_threshold=2.5,
initialization_delay=0, initialization_delay=config.detect.fps / 2,
hit_counter_max=self.max_disappeared, hit_counter_max=self.max_disappeared,
) )
if self.ptz_autotracker_enabled.value: if self.ptz_autotracker_enabled.value:
@ -106,11 +106,6 @@ class NorfairTracker(ObjectTracker):
"ymax": self.detect_config.height, "ymax": self.detect_config.height,
} }
# start object with a hit count of `fps` to avoid quick detection -> loss
next(
(o for o in self.tracker.tracked_objects if o.global_id == track_id)
).hit_counter = self.camera_config.detect.fps
def deregister(self, id, track_id): def deregister(self, id, track_id):
del self.tracked_objects[id] del self.tracked_objects[id]
del self.disappeared[id] del self.disappeared[id]