Visitar URL original
Wrong predictions read in ctd_tracking by Ayskin · Pull Request #3559 · DeepLabCut/DeepLabCut · GitHub
Skip to content

Wrong predictions read in ctd_tracking - #3559

Closed
Ayskin wants to merge 1 commit into
DeepLabCut:devfrom
Ayskin:yann/fix-ctd-predictions
Closed

Ayskin wants to merge 1 commit into
DeepLabCut:devfrom
Ayskin:yann/fix-ctd-predictions

Conversation

@Ayskin

@Ayskin Ayskin commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

The ctd_tracking branch of analyze_videos now reads the correct list ctd_predictions instead of the wrong list predictions.

Previous silent misread as both lists are the same but would fail if use_shelve=True as the list predictions is empty.

So currently ctd_predictions actually rebuilds the same data as in predictions from the pickle file (potential refactoring related to #3553).

@deruyter92 deruyter92 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix! Minor suggestion: shall we add a tiny regression test that locks the correct behavior?

Just for reference:
Seems this bug has been there since the introduction of BUCTD (see #2952). It only affects users who ran analyze_videos from the Python API with a multi-animal CTD model and ctd_tracking turned on, then re-ran it with overwrite=False on a batch where some videos already had a _full.pickle. Is that correct, @Ayskin?

@Ayskin

Ayskin commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

It indeed only affects users running analyze_videos with multi_animal and ctd_tracking on, but would also only fail in the following cases :

  • use_shelve=True & overwrite=True : predictions == []
  • use_shelve=True & overwrite=False & no pkl exists : predictions == []

If use_shelve=False or (overwrite=False & pkl exists), the whole inference block is either skipped or predictions is filled.

@Ayskin

Ayskin commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Closing as this fix is actually already included in the merged PR #3488.

@Ayskin Ayskin closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants