Skip to content

Fix SORTSkeleton removing the wrong tracker on cleanup - #3403

Merged
C-Achard merged 1 commit into
DeepLabCut:external/hwang-misc-fixesfrom
Denny-Hwang:fix/sortskeleton-pop-index
Jul 16, 2026
Merged

Fix SORTSkeleton removing the wrong tracker on cleanup#3403
C-Achard merged 1 commit into
DeepLabCut:external/hwang-misc-fixesfrom
Denny-Hwang:fix/sortskeleton-pop-index

Conversation

@Denny-Hwang

Copy link
Copy Markdown
Contributor

In SORTSkeleton.track, the reverse-iteration cleanup loop maintains i as the current tracker's index but removed dead trackers with self.trackers.pop() (removes the last element) instead of self.trackers.pop(i). The sibling classes SORTBox and SORTEllipse correctly use pop(i).

With a stale tracker in the middle of the list, pop() deleted a different (often still-live) tracker; the dead one persisted and animalindex[i] alignment broke, corrupting identity/tracklet assignment for the skeleton track method.

In SORTSkeleton.track, the reverse-iteration cleanup loop maintains i
as the current tracker's index but removed dead trackers with
self.trackers.pop() (removes the last element) instead of
self.trackers.pop(i). The sibling classes SORTBox and SORTEllipse
correctly use pop(i).

With a stale tracker in the middle of the list, pop() deleted a
different (often still-live) tracker; the dead one persisted and
animalindex[i] alignment broke, corrupting identity/tracklet
assignment for the skeleton track method.
@C-Achard C-Achard added the bug fix! fix for a real buggy one... label Jul 15, 2026
@C-Achard
C-Achard changed the base branch from main to external/hwang-misc-fixes July 16, 2026 07:39
@C-Achard
C-Achard merged commit 3755158 into DeepLabCut:external/hwang-misc-fixes Jul 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix! fix for a real buggy one...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants