Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: duplicate STracks in the list tracker.removed_stracks #97

Open
QiuZuowei opened this issue Dec 26, 2023 · 0 comments
Open

Comments

@QiuZuowei
Copy link

QiuZuowei commented Dec 26, 2023

I found duplicate STracks in the list tracker.removed_stracks after tracking a video with mc_bot_sort.py.
1703558864221

From the picture, it can be seen that except for the STracks with a length of only 1 frame, all other STracks will repeat once, which I believe is caused by this part of the code:

        """ Merge """
        self.tracked_stracks = [t for t in self.tracked_stracks if t.state == TrackState.Tracked]
        self.tracked_stracks = joint_stracks(self.tracked_stracks, activated_starcks)
        self.tracked_stracks = joint_stracks(self.tracked_stracks, refind_stracks)
        self.lost_stracks = sub_stracks(self.lost_stracks, self.tracked_stracks)
        self.lost_stracks.extend(lost_stracks)
        self.lost_stracks = sub_stracks(self.lost_stracks, self.removed_stracks)
        self.removed_stracks.extend(removed_stracks)
        self.tracked_stracks, self.lost_stracks = remove_duplicate_stracks(self.tracked_stracks, self.lost_stracks)

I think the sixth line in this part of the code should be changed to self.lost_stracks = sub_stracks(self.lost_stracks, removed_stracks)
Because in the current frame, the STracks marked as removed due to lost exceeding max_time_lost has not been updated to self.removed_stracks yet, self.lost_stracks = sub_stracks(self.lost_stracks, self.removed_stracks) cannot remove the STracks marked as removed from self.lost_stracks, resulting in being added to the self.removed_stracks again in the next frame.

According to my test, this change is effective.
image

I'm not sure if my change is correct. If there are any mistakes, I hope you can let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant