Skip to content

Multi-animal ellipse tracker can assign poses to the wrong animal when ellipse fitting fails for one detection #3493

Description

@deruyter92

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Ubuntu 22.04

DeepLabCut version

3.0.1

What engine are you using?

pytorch

DeepLabCut mode

multi animal

Device type

CPU

Bug description 🐛

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

  1. Two animals are present and tracked across frames.
  2. They are spatially separated and never interact.
  3. In one frame, animal 0 drops below 3 visible/confident keypoints.
  4. EllipseFitter.fit() skips animal 0.
  5. The remaining ellipse for animal 1 is now at filtered index 0.
  6. 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.

Code of Conduct

Activity

  1. self-assigned this
    on Sep 8, 2026
  2. added theissue type on Sep 8, 2026
  3. added
    bug
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.0.3bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions