deeplabcut.pose_estimation_pytorch.apis.ctd
Methods to help with conditional top-down models.
Functions:
| Name | Description |
|---|---|
get_condition_provider |
Creates a CondFromModel conditions provider for a CTD model. |
get_conditions_provider_for_video |
Tries to create a conditions loader. |
load_conditions_for_evaluation |
Loads the conditions needed to evaluate a CTD model. |
get_condition_provider
Creates a CondFromModel conditions provider for a CTD model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
The configuration for the condition provider. This is the content of "inference": "conditions" in the pytorch_config |
required |
|
str | Path | None
|
The path to the project config file, if the condition provider is given as a snapshot from a DeepLabCut shuffle. |
None
|
Returns:
| Type | Description |
|---|---|
CondFromModel
|
The CondFromModel provider that can be used to generate conditions from a BU model for a CTD model. |
Source code in deeplabcut/pose_estimation_pytorch/apis/ctd.py
get_conditions_provider_for_video
get_conditions_provider_for_video(cond_provider: CondFromModel, video: str | Path) -> CondFromFile | None
Tries to create a conditions loader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CondFromModel
|
The CondFromModel condition provider that will be used. The scorer must be set, or potential conditions files for the video cannot be found. |
required |
|
str | Path
|
The path to the video file for which to look for the conditions. |
required |
Returns:
| Type | Description |
|---|---|
CondFromFile | None
|
None if no condition files for this BU model and video can be found. The CondFromFile provider to load the conditions for the video from a file. |
Source code in deeplabcut/pose_estimation_pytorch/apis/ctd.py
load_conditions_for_evaluation
Loads the conditions needed to evaluate a CTD model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Loader
|
The Loader for the CTD model to evaluate. |
required |
|
list[str]
|
A list of image paths to load conditions for. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, ndarray]
|
The conditions for the images. |