mmtracking
mmtracking copied to clipboard
Hi, I've found a bug in sort_tracker.py
Hi, thanks for your great work. I've been using mmtracking for a while, and I'm pretty sure there is a bug in class SortTracker(). It's bug about implementation of retrieving missing ids.
Here's what you can try (I've tested): 1, Take a deepsort config file; 2, Set a num_of_retian = 1000; 3, Run demo in two cases: Case 1: When Reid in config file working, after cover up some objects (objects are not moving in my cases) for seconds and uncover them, their id comes back (the deepsort algo is expected to do so due to 'IoU match' and 'Reid feature distance'), so this works great, imagine output like: start, ids: 0, 1, 2 cover up object 1 and 2, ids: 0 un-cover, ids: 0, 1, 2 Case 2: When Reid is switched off in config (by Reid=None...), then actually this algorithm turns into SORT algorithm, which is still supposed to retrieve objects due to SORT's IoU match, yet objects are given 0, 3, 4 after cover-uncover act, you'll get output like: start, ids: 0, 1, 2 cover up object 1 and 2, ids: 0 un-cover, ids: 0, 3, 4 Thanks
@leemengwei Thanks, we will have a check.
I think this bug is caused by code part below: (sort_tracker.py) active_ids = self.confirmed_ids if self.with_reid: ... active_ids = [ id for id in self.ids if id not in ids and self.tracks[id].frame_ids[-1] == frame_id - 1 ]
fix:
active_ids = [
id for id in self.ids if id not in ids
and self.tracks[id].frame_ids[-1] == frame_id - 1
] if self.with_reid else self.ids