deeplabcut.pose_estimation_pytorch.config.make_pose_config
Methods to create the configuration files for PyTorch DeepLabCut models.
Functions:
| Name | Description |
|---|---|
build_detector_config_defaults |
Adds a detector to a model. |
build_pose_config_defaults |
Load the model config defaults (from model-specific yaml) for a given project and net_type. |
make_basic_project_config |
Deprecated factory for basic config dict for non-DLC projects. |
resolve_net_type_and_task |
Resolve the net type from build args and project config default. |
build_detector_config_defaults
Adds a detector to a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
path to the DeepLabCut "configs" directory |
required | |
|
int
|
the maximum number of individuals the model should detect |
required |
|
DetectorType
|
the type of detector to use (if None, uses |
required |
Returns:
| Type | Description |
|---|---|
dict
|
the model configuration with an added detector config |
Source code in deeplabcut/pose_estimation_pytorch/config/make_pose_config.py
build_pose_config_defaults
build_pose_config_defaults(
net_type: NetType,
metadata: PoseMetadata,
*,
task: Task,
multi_animal: bool,
paf_parameters: PAFParameters | None = None,
weight_init: WeightInitialization | None = None,
detector_config: DetectorConfig | None = None,
ctd_conditions: int | str | Path | tuple[int, str] | tuple[int, int] | None = None
) -> dict
Load the model config defaults (from model-specific yaml) for a given project and net_type.
The base/ folder contains default configurations, such as data augmentations or heatmap heads (that can be used to predict pose or identity based on visual features). These files are used to create pose model configurations.
All available backbone configurations are stored in the backbones/ folder. - any backbone can be a single animal model with a heatmap head added on top - any backbone can be a top-down model with a detector and a heatmap head - any backbone can be a bottom-up model with a detector and a heatmap + PAF head
All other model architectures have their own folders, with different variants
available. Top-down model architectures must specify method: TD in their
configuration files, from which this method adds a backbone configuration.
Placeholder values (such as num_bodyparts or num_individuals) are filled in
based on the project config file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
the DeepLabCut project config (used to infer individuals, bodyparts and identity tracking) |
required | |
|
NetType
|
the architecture of the desired pose estimation model |
required |
|
Task
|
when the net_type is a backbone, whether to create a top-down model by associating a detector to the pose model. Required for multi-animal projects when net_type is a backbone (as a backbone + heatmap head can only predict pose for single individuals). |
required |
|
for top-down pose models, the architecture of the desired object detection model |
required | |
|
int | str | Path | tuple[int, str] | tuple[int, int] | None
|
int | str | Path | tuple[int, str] | tuple[int, int] , optional, default = None,
If using a conditional-top-down (CTD) net_type, this argument needs to be specified.
It defines the conditions that will be used with the CTD model.
It can be either:
* A shuffle number (ctd_conditions: int), which must correspond to a bottom-up (BU) network type.
Valid for both evaluation and live analyze.
* A predictions file path (ctd_conditions: string | Path), which must correspond to a .json or .h5
predictions file. Evaluation-only — not valid for |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
The model configuration defaults as a dictionary. |
Source code in deeplabcut/pose_estimation_pytorch/config/make_pose_config.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
make_basic_project_config
make_basic_project_config(
dataset_path: Path | str, bodyparts: list[str], max_individuals: int, multi_animal: bool = True
) -> dict
Deprecated factory for basic config dict for non-DLC projects.
Source code in deeplabcut/pose_estimation_pytorch/config/make_pose_config.py
resolve_net_type_and_task
resolve_net_type_and_task(net_type: str | NetType | None, *, default: str, top_down: bool) -> tuple[NetType, Task]
Resolve the net type from build args and project config default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
Architecture name, or None to use |
required |
|
str
|
Fallback when |
required |
|
bool
|
Build a top-down backbone (ignored for non-backbones). |
required |
Returns:
| Type | Description |
|---|---|
(NetType, Task)
|
the resolved canonical NetType and Task |