Skip to content

Avoid redundant superanimal colormap calls during pytorch inference#3159

Merged
MMathisLab merged 2 commits intoDeepLabCut:mainfrom
juan-cobos:avoid-redundant-colormap-calls
Jan 9, 2026
Merged

Avoid redundant superanimal colormap calls during pytorch inference#3159
MMathisLab merged 2 commits intoDeepLabCut:mainfrom
juan-cobos:avoid-redundant-colormap-calls

Conversation

@juan-cobos
Copy link
Copy Markdown
Contributor

Simply placing colormap calls outside the for loop of video paths and create output_video when create_labeled_video is True.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the superanimal video inference by eliminating redundant colormap lookups. Previously, the colormap was fetched once per video in the loop, but now it's fetched only once before processing all videos.

  • Moved colormap initialization outside the video processing loop to avoid redundant calls
  • Reorganized output_video path creation to only occur when create_labeled_video is True

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@deruyter92 deruyter92 left a comment

Choose a reason for hiding this comment

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

@juan-cobos, thanks for changing this. Looks good.

@MMathisLab MMathisLab added enhancement New feature or request ModelZoo related to models/code for modezoo.deeplabcut.org DLC3.0🔥 labels Jan 9, 2026
@MMathisLab MMathisLab merged commit ced1ab6 into DeepLabCut:main Jan 9, 2026
@juan-cobos juan-cobos deleted the avoid-redundant-colormap-calls branch January 9, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DLC3.0🔥 enhancement New feature or request ModelZoo related to models/code for modezoo.deeplabcut.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants