Increase initial hit count for norfair tracker (#7925)

* Increase initial hit count of tracked object

* Formatting
This commit is contained in:
Nicolas Mowen 2023-09-24 05:32:43 -06:00 committed by GitHub
parent 08586f8f65
commit 1c27ee2d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]