Repository navigation
Conversation
- Copied from DeepLabCut `dev` at d2bbe028, `deeplabcut/pose_estimation_pytorch/config/`: `ctd_conditions`, `data`, `enums`, `logger`, `model`, `paf_parameters`, `runner`. These import nothing beyond pydantic and dlccore's base config. - Changes relative to DeepLabCut are limited to imports and to removing members that need DeepLabCut, so dlccore can read a `pytorch_config.yaml` without it: - `DataConfig` and `DetectorDataConfig`: `validate_transforms`, which builds the augmentations with albumentations and torch. It returns its input unchanged, so dropping it changes which configs are accepted, not the values read. - `NetType`: `is_backbone`, `alias` and `available_aliases`, which read DeepLabCut's architecture template folder. `from_alias`, the read path, stays. - `PAFParameters`: `build` and `get_paf_parameters`, which prune the graph with `deeplabcut.utils.auxfun_multianimal`. - `ConditionsModelConfig`: `from_shuffle` and `resolve_from_conditions`, which resolve a shuffle through DeepLabCut's data loader. Docstrings still name them; they remain DeepLabCut's API. - `enums.py` and `paf_parameters.py` had no license header in DeepLabCut; they get DeepLabCut's. - No `__init__.py` yet: `dlccore.config.pose` is a namespace package until the package exports are added.
- Copied from DeepLabCut `dev` at d2bbe028: `pose_estimation_pytorch/config/inference.py` and `metadata.py`, and `core/weight_init.py`, moved to `dlccore/config/pose/weight_init.py` since it is a field type of the pose config's train settings. - `inference.py` builds on the committed `ctd_conditions`; `metadata.py` needs `ProjectConfig`; `weight_init.py` needs `NDArrayInt` (numpy). None imports DeepLabCut. - Changes relative to DeepLabCut are limited to imports and to removing members that need DeepLabCut: - `PoseMetadata.build_for_superanimal`, which reads the model zoo. `PoseMetadata.build`, which needs only `ProjectConfig`, stays. - `WeightInitialization.from_dict`, `from_dict_legacy` and `build`, which resolve SuperAnimal snapshots through the model zoo. `from_dict` is DeepLabCut's override that sends a dict without `snapshot_path` to the legacy path; DeepLabCut's own pose config read validates the nested field directly and never takes it, so reading a stored config gives the same result.
- Copied from DeepLabCut `dev` at d2bbe028, `pose_estimation_pytorch/config/training.py`, unchanged but for imports. `weight_init` now comes from `dlccore.config.pose`. - Raise the pydantic floor from 2.1 to 2.12: `TrainSettingsConfig.dataloader_kwargs` uses `Field(exclude_if=...)`, added in pydantic 2.12.0b1, to omit empty kwargs when saving. DeepLabCut declares the same floor.
- Copied from DeepLabCut `dev` at d2bbe028, `pose_estimation_pytorch/config/pose.py`: `PoseConfig`, `DetectorConfig` and `TestConfig`. With the schemas already copied, dlccore reads, validates, migrates and writes a `pytorch_config.yaml` without DeepLabCut, so DeepLabCut-live and database ingestion can read trained model configs without installing it. - Omitted, as they build a config from DeepLabCut's architecture templates or the model zoo: `PoseConfig.build`, `build_for_superanimal_inference`, `build_for_superanimal_finetune` and `DetectorConfig.build`. - The `PoseConfig` migrations move into `pose.py`, as on DeepLabCut's `cy/config-from-dlccore`, where they register in dlccore's registry. `PoseConfig`'s current version is its entry in `versioning.CURRENT_CONFIG_VERSIONS`. - `NetType` is a closed enum: a model added to DeepLabCut needs a dlccore release before dlccore reads its configs. - `dlccore.config.pose` exports the public classes, `WeightInitialization` and `DetectorDataConfig` included; `pose` is listed in `dlccore.config.__all__`.
- From DeepLabCut `dev` at d2bbe028, imports changed: `test_logger_config.py`, `test_runner_config.py`, `test_train_settings_config.py`, and the schema half of `test_ctd_conditions.py`; resolving conditions against a shuffle stays in DeepLabCut. - ruff's `tests/config/*.py` exclusion also matched `tests/config/pose/`, as `*` crosses `/`. It now names `tests/config/conftest.py`, `tests/config/test_*.py` and the four ported files, so tests written for dlccore are linted.
C-Achard
force-pushed
the
cy/pose-config
branch
from
December 4, 2026 15:20
f02d375 to
9fcb441
Compare
This branch has not been deployed
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.
Scope
The schema of DeepLabCut's PyTorch
pytorch_config.yaml, copied from DeepLabCutdevatd2bbe028: reading, validating, migrating and writing. Building a config, from DeepLabCut's architecture templates or the model zoo, stays in DeepLabCut. Tests here are DeepLabCut's unit tests for the sub-configs; tests that configs read back as DeepLabCut wrote them are the next PR of this stack.Motivation
DeepLabCut-live reads the config stored in an exported model without DeepLabCut, and keeps its own copies of the logic that interprets it, including its own fix for DeepLabCut issue 3592 in
rtmcc_head.update_input_size. Database ingestion needs to read net types and model metadata without installing DeepLabCut and its training stack.Main changes
dlccore.config.poseholdsPoseConfig,DetectorConfig,TestConfigand every sub-config, plusWeightInitialization, which is a field type of the train settings; nothing in it imports DeepLabCut, torch or albumentations.build*factories,NetType.is_backbone,aliasandavailable_aliases, the SuperAnimal and shuffle-resolution helpers,PAFParameters.build, andWeightInitialization's legacy andbuildpaths.DataConfig.validate_transformswas removed: it builds the augmentations with albumentations and torch, and returns its input unchanged, so dropping it changes which configs are accepted, not the values read._match_top_down_crop_to_headsis kept as DeepLabCut has it: on read, it setstop_down_cropto a fixed head input size and reports this to the log only.PoseConfigmigrations are registered inpose.py, as on DeepLabCut'scy/config-from-dlccore.Field(exclude_if=...), used by the train settings; DeepLabCut declares the same floor.Additional context
NetTypeis a closed enum: a model added to DeepLabCut needs a dlccore release before dlccore reads its configs.build*methods into functions, and run the transforms check where the data loader reads the config, so a bad augmentation still fails before training.weight_initwritten before 3.0.0rc5 reads withsnapshot_path=None, as it does in DeepLabCut: the legacy path that resolved a SuperAnimal snapshot ran only fromWeightInitialization.from_dict, never from a pose config read.tests/config/*.pyexclusion also matchedtests/config/pose/; it now names the ported test files, so tests written for dlccore are linted.