You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-animal ellipse tracker can assign poses to the wrong animal when ellipse fitting fails for one detection #3493
In multi-animal analysis, the default ellipse tracking path can write the wrong pose into a tracklet when one detected animal in a frame cannot be fit with an ellipse.
This shows up as labeled videos / .h5 outputs where body-part configurations do not stay attached to the correct animal, even when the animals are well separated and not interacting.
Steps To Reproduce
Two animals are present and tracked across frames.
They are spatially separated and never interact.
In one frame, animal 0 drops below 3 visible/confident keypoints.
EllipseFitter.fit() skips animal 0.
The remaining ellipse for animal 1 is now at filtered index 0.
That filtered index is later used as animals[0] in fill_tracklets(), so the track for animal 1 receives animal 0’s pose.
Relevant log output
No error or warning is emitted.
Anything else?
Suspected root cause
In SORTEllipse.track(), DeepLabCut first builds a filtered ellipses list by skipping poses for which EllipseFitter.fit() returns None. However, the animalindex values returned by the tracker are indices into that filtered list, while fill_tracklets() later interprets them as indices into the original animals array.
Expected behavior
If one pose cannot be ellipse-fit in a frame, any reported detection index should still map back to the correct original animal entry for that frame.
Actual behavior
When at least one pose is skipped during ellipse fitting, tracklets can be populated with the wrong animal’s pose, leading to identity/body-part swaps in labeled videos and final .h5 outputs.
Activity