Conversation
|
TODO:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive support for DeepLabCut 3.x, pretrained SuperAnimal models, multi-animal tracking, and Docker-based testing infrastructure. The changes enable two distinct workflow modes: trained models (custom models with user-labeled data) and pretrained models (ready-to-use SuperAnimal models from the DLC Model Zoo). The implementation maintains full backward compatibility with existing trained model workflows while adding new capabilities for pretrained inference and multi-animal pose estimation.
Key Changes:
- Added
PretrainedModellookup table registry for SuperAnimal models - Implemented unified inference pipeline supporting both trained and pretrained workflows
- Added multi-animal support with new
IndividualandIndividualMappingpart tables - Upgraded to DeepLabCut 3.x (PyTorch) with Python 3.10+ requirement
- Added comprehensive Docker-based testing infrastructure
- Created functional smoke tests for both workflows
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_pretrained_workflow.py |
Unit tests for pretrained model registration, insertion, validation, and parameter merging |
tests/TESTING_GUIDE.md |
Comprehensive testing guide with setup instructions and examples |
test_video_inference.py |
Functional smoke test for pretrained SuperAnimal inference workflow |
test_trained_inference.py |
Functional smoke test for complete trained model workflow with mocked training |
setup.py |
Updated DLC dependencies to version 3.0.0rc13 with Python 3.10+ requirement |
environment.yml |
New conda environment file with DLC 3.x and Python 3.10 |
element_deeplabcut/train.py |
Enhanced training logic with DLC 3.x compatibility and metadata handling |
element_deeplabcut/readers/dlc_reader.py |
Extended reader to support DLC 3.x multi-animal format and lenient metadata parsing |
element_deeplabcut/model.py |
Added PretrainedModel table, insert_pretrained_model() method, multi-animal tables, and unified inference |
docs/src/workflows.md |
New documentation explaining trained vs pretrained workflow modes |
docs/src/testing.md |
Testing guide covering functional tests and Docker setup |
docs/src/docker.md |
Docker setup and usage documentation |
docker-compose.yaml |
Docker Compose configuration for database and client services |
Dockerfile |
Dockerfile based on official DeepLabCut image |
Makefile |
Convenient shortcuts for Docker operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…trolLab/element-deeplabcut into mary/final_workflow
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
improve organization and maintainability
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add Pretrained SuperAnimal Models Support, Multi-Animal support, DLC 3.x Compatibility, and Docker Testing
Closes:
Summary
This PR introduces full support for DeepLabCut 3.x, multi-animal and SuperAnimal pretrained models, via
PretrainedModelregistry, unified trained/pretrained inference flows, and complete Docker-based testing infrastructure.No parallel schema is introduced — pretrained and trained models are handled as two modes of the same workflow.
All existing behavior remains fully backward compatible.
What’s New
Pretrained / SuperAnimal Model Support
PretrainedModelLookup TableA registry of SuperAnimal pretrained models with fields
Helper methods:
PretrainedModel.populate_common_models()— auto-register quadruped, topviewmouse, etc.PretrainedModel.is_pretrained(...)PretrainedModel.add(...)— manual registration.Integration with
ModelModel.insert_pretrained_model()Allows inserting a pretrained model without a DLC project directory or
config.yaml.Modelschema remains unchanged._pretrained_model_name).Unified Inference Path (Trained + Pretrained)
PoseEstimation.make()now includes:do_trained(...)_do_pretrained_inference(...)_do_pretrained_inference(...)includes:PretrainedModeldeeplabcut.video_inference_superanimal(...)when availablevideo_inference(...)when neededinspect.signature()to match DLC APIsscale,video, detector settings)Thus trained and pretrained workflows share the same high-level pipeline.
🐭 Multi-Animal / DLC 3.x Compatibility
New Part tables:
PoseEstimation.Individualanimal0,animal1)PoseEstimation.IndividualMappingAdditional updates:
dlc_reader.pynow parses DLC 3.x / SuperAnimal outputBackward compatible:
For single-animal projects these tables remain empty.
🐳 Docker Testing Infrastructure
New cross-platform testing environment:
make test-trainedmake test-pretrainedEnsures reproducible end-to-end testing for both workflows.
Functional Smoke Tests
New tests (and workflow demo):
test_trained_inference.py— trained model pipelinetest_video_inference.py— pretrained SuperAnimal pipelineDocumentation added:
CONDA_ENV_SETUP.mdDOCKER_TEST_README.mdtests/TESTING_GUIDE.mdBackward Compatibility