deeplabcut.pose_estimation_pytorch.models.heads.transformer
Classes:
| Name | Description |
|---|---|
TransformerHead |
Transformer Head module to predict heatmaps using a transformer-based |
TransformerHead
Bases: BaseHead
Transformer Head module to predict heatmaps using a transformer-based approach.
Methods:
| Name | Description |
|---|---|
__init__ |
Args: |
Source code in deeplabcut/pose_estimation_pytorch/models/heads/transformer.py
__init__
__init__(
predictor: BasePredictor,
target_generator: BaseGenerator,
criterion: BaseCriterion,
dim: int,
hidden_heatmap_dim: int,
heatmap_dim: int,
apply_multi: bool,
heatmap_size: tuple[int, int],
apply_init: bool,
head_stride: int,
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Dimension of the input features. |
required |
|
int
|
Dimension of the hidden features in the MLP head. |
required |
|
int
|
Dimension of the output heatmaps. |
required |
|
bool
|
If True, apply a multi-layer perceptron (MLP) with LayerNorm to generate heatmaps. If False, directly apply a single linear layer for heatmap prediction. |
required |
|
tuple[int, int]
|
Tuple (height, width) representing the size of the output heatmaps. |
required |
|
bool
|
If True, apply weight initialization to the module's layers. |
required |
|
int
|
The stride for the head (or neck + head pair), where positive values indicate an increase in resolution while negative values a decrease. Assuming that H and W are divisible by head_stride, this is the value such that if a backbone outputs an encoding of shape (C, H, W), the head will output heatmaps of shape: (C, H * head_stride, W * head_stride) if head_stride > 0 (C, -H/head_stride, -W/head_stride) if head_stride < 0 |
required |