From 1c27ee2d2b888adb5acab5b5833ebea5ad7be565 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sun, 24 Sep 2023 05:32:43 -0600 Subject: [PATCH] Increase initial hit count for norfair tracker (#7925) * Increase initial hit count of tracked object * Formatting --- frigate/track/norfair_tracker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frigate/track/norfair_tracker.py b/frigate/track/norfair_tracker.py index 2e9e5034f..8c8aab8d5 100644 --- a/frigate/track/norfair_tracker.py +++ b/frigate/track/norfair_tracker.py @@ -106,6 +106,11 @@ class NorfairTracker(ObjectTracker): "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): del self.tracked_objects[id] del self.disappeared[id]