How to reset the tracking id for ByteTracker
Closed this issue · 1 comments
programmeddeath1 commented
Search before asking
- I have searched the Yolo Tracking issues and found no similar bug report.
Question
I am using the bytetracker as follows
from boxmot import DeepOCSORT,BYTETracker,BoTSORT,HybridSORT
tracker = BYTETracker()
tracks = tracker.update(dets, og_frame)
for track in tracks:
track_id = track[4]
I want to reset the tracker id back to 1 again during a specific process being manually stopped and started. It is integrated to a PyQT app which runs the camera stream. So when the camera stream is turned off and started again, the track id needs to be reset to 1 again.
I tried doing the following
- Reset the tracker by reinitializing the tracker = BYTETracker()
- I tried initializing tracker.tracks = []
-
tracker.tracks=[] tracker.trackers = [] tracker._next_id = 1
- tracker.init()
But it seems to be storing the last tracker in cache or somewhere and it restarts from the last id before the camera stream was stopped.
Any help would be appreciated! Thanks in advance!
mikel-brostrom commented
You should now be able to do:
bytetrack = BYTETracker()
bytetrack.BaseTrack.clear_count()