Skip to content

Fix incorrect rename mapping in modelzoo download - #3452

Draft
C-Achard wants to merge 2 commits into
mainfrom
cy/fix-modelzoo-humanbody-download
Draft

Fix incorrect rename mapping in modelzoo download#3452
C-Achard wants to merge 2 commits into
mainfrom
cy/fix-modelzoo-humanbody-download

Conversation

@C-Achard

Copy link
Copy Markdown
Collaborator

Fix SuperAnimal HumanBody checkpoint downloads when the Hugging Face filename differs from DeepLabCut’s expected filename.

Pass the expected filename directly to download_huggingface_model, allowing it to map the actual downloaded filename, such as rtmpose-x_simcc-body7.pt, to superanimal_humanbody_rtmpose_x.pt. Existing models with matching filenames remain unaffected.

Closes #3450.

Update `download_super_animal_snapshot` to pass `model_filename` directly as `rename_mapping` when downloading from Hugging Face. This aligns with the expected argument shape and prevents false download failures when validating that the model file exists.
Add module-level logging to PyTorch model zoo inference and emit a warning when video inference produces no pose predictions, making empty-detection runs easier to diagnose.
@C-Achard
C-Achard requested a lite review from Copilot August 14, 2026 13:07
@C-Achard C-Achard self-assigned this Aug 14, 2026
@C-Achard C-Achard added bug fix! fix for a real buggy one... ModelZoo related to models/code for modezoo.deeplabcut.org huggingface labels Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to fix SuperAnimal HumanBody checkpoint downloads when the filename fetched from Hugging Face differs from the filename DeepLabCut expects locally, and adds a warning path for empty inference outputs.

Changes:

  • Updates the SuperAnimal snapshot download call to alter how rename_mapping is provided to download_huggingface_model.
  • Adds a module logger and a warning when no pose predictions are produced during PyTorch modelzoo video inference.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
deeplabcut/pose_estimation_pytorch/modelzoo/utils.py Adjusts the download/rename behavior for SuperAnimal snapshot checkpoints.
deeplabcut/pose_estimation_pytorch/modelzoo/inference.py Adds logging and a warning branch for empty prediction results during inference.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 129 to 134
download_huggingface_model(
model_name,
target_dir=str(snapshot_dir),
rename_mapping={model_filename: model_filename},
# rename_mapping={model_filename: model_filename},
rename_mapping=model_filename,
)
Comment on lines +176 to 178
if not predictions:
logger.warning(f"No pose predictions were made for video {video_path}. Were no individuals detected?")

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... huggingface ModelZoo related to models/code for modezoo.deeplabcut.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

superanimal_humanbody_rtmpose_x download fails

2 participants