deeplabcut.pose_estimation_pytorch.models.backbones.cond_prenet
Classes:
| Name | Description |
|---|---|
CondPreNet |
Wrapper module that adds a conditional preNet before any backbone. |
CondPreNet
Bases: BaseBackbone
Wrapper module that adds a conditional preNet before any backbone.
This allows to process image and condition features and prepare them for the main backbone.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the PreNetWrapper. |
forward |
Forward pass through the conditional preNet + backbone. |
init_weights |
Initialize PreNet weights from a Normal distribution. |
Source code in deeplabcut/pose_estimation_pytorch/models/backbones/cond_prenet.py
__init__
__init__(
kpt_encoder: dict | BaseKeypointEncoder,
backbone: dict | BaseBackbone,
img_size: tuple[int, int] = (256, 256),
**kwargs
)
Initialize the PreNetWrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict | BaseBackbone
|
The backbone model to wrap. |
required |
|
tuple[int, int]
|
The (height, width) of the input images. |
(256, 256)
|
Source code in deeplabcut/pose_estimation_pytorch/models/backbones/cond_prenet.py
forward
Forward pass through the conditional preNet + backbone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Tensor
|
Input tensor of shape (batch_size, channels, height, width). |
required |
|
ndarray | Tensor
|
Conditional keypoints of shape (batch_size, num_joints, 2). |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
the feature map |
Source code in deeplabcut/pose_estimation_pytorch/models/backbones/cond_prenet.py
init_weights
Initialize PreNet weights from a Normal distribution.