Fix incorrect rename mapping in modelzoo download - #3452
Draft
C-Achard wants to merge 2 commits into
Draft
Conversation
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.
Contributor
There was a problem hiding this comment.
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_mappingis provided todownload_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?") | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.