-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SuperAnimal Model Updates #2756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
maximpavliv
approved these changes
Oct 18, 2024
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.
SuperAnimal Model Updates
This pull request refactors the code to use SuperAnimal models on downstream datasets (using transfer learning, fine-tuning and fine-tuning with memory replay). It also adds compatibility with weights released for SuperAnimal-Bird through
dlclibrary.Before merging this pull request, we need:
New Features & Updates
SuperAnimal - Separation of Detectors and Pose Models
The
modelzoocode was re-written to handle pose models and detectors separately. This allows users to mix-and-match which detectors are used with which pose models.The ModelZoo page in the GUI was updated so users can pick which detector/pose estimation model combination they want.
SuperAnimal - Bird
This pull request (combined with a
dlclibraryrelease) adds a SuperAnimal-Bird model, using an SSDLite detector and a pose model with a ResNet50 backbone.WeightInitializationThe
WeightInitializationclass is updated to directly store the paths to the snapshots from which to initialize models. This makes it much better encapsulated, and makes it agnostic to the SuperAnimal/ModelZoo models, allowing the class to be used to initialize weights from any snapshot desired.To create a
WeightInitializationinstance to fine-tune SuperAnimal models,deeplabcut.modelzoo.build_weight_initcan be used. Thisweight_initcan then be used to create a new training dataset.Calling
build_weight_initwill look for the models usingdlclibrary, and download them if they aren't available yet. Adding this weight initialization will add the following element to the shuffle'spytorch_config.yaml:The conversion array maps the bodyparts labeled in the DeepLabCut project to the indices of SuperAnimal bodyparts.
Bug Fixes
test/pose_cfg.yamlfile is created correctly for PyTorch shuffles that are fine-tuning SuperAnimal models with memory replay: thebodypartsneeded to be updated to contain the SuperAnimal bodypartscreate_labeled_video: when using a fine-tuned SuperAnimal model (with memory replay), the bodyparts would not be plot correctly as the project bodyparts were usedConsistency/Style Updates
train_networkandevaluate_networknow accept the project configuration filepath as either aPathor astrtrain/pose_cfg.yamlfile is no longer created for PyTorch shuffles