deeplabcut.pose_estimation_pytorch.models.modules.kpt_encoders
Classes:
| Name | Description |
|---|---|
BaseKeypointEncoder |
Encodes keypoints into heatmaps. |
ColoredKeypointEncoder |
Encodes keypoints into a given number of color channels. |
StackedKeypointEncoder |
Encodes keypoints into heatmaps, where each. |
BaseKeypointEncoder
Bases: ABC
Encodes keypoints into heatmaps.
Modified from BUCTD/data/JointsDataset
Methods:
| Name | Description |
|---|---|
__call__ |
Args: |
__init__ |
Args: |
blur_heatmap |
Applies a Gaussian blur to a heatmap. |
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
__call__
abstractmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
the keypoints to encode |
required |
|
tuple[int, int]
|
the (height, width) of the heatmap in which the keypoints should be encoded |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
the encoded keypoints |
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
__init__
__init__(num_joints: int, kernel_size: tuple[int, int] = (15, 15), img_size: tuple[int, int] = (256, 256)) -> None
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The number of joints to encode |
required |
|
tuple[int, int]
|
The Gaussian kernel size to use when blurring a heatmap |
(15, 15)
|
|
tuple[int, int]
|
The (height, width) of the input images |
(256, 256)
|
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
blur_heatmap
Applies a Gaussian blur to a heatmap.
Taken from BUCTD/data/JointsDataset, generate_heatmap
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
the heatmap to blur (with values in [0, 1] or [0, 255]) |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The heatmap with a Gaussian blur, such that max(heatmap) = 255 |
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
ColoredKeypointEncoder
Bases: BaseKeypointEncoder
Encodes keypoints into a given number of color channels.
Modified from BUCTD/data/JointsDataset, get_condition_image_colored
Methods:
| Name | Description |
|---|---|
__call__ |
Args: |
__init__ |
Args: |
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
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 | |
__call__
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
batch of keypoints to encode with shape (batch_size, num_joints, 2) |
required |
|
tuple[int, int]
|
the (height, width) of the heatmap in which the keypoints should be encoded |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
encoded keypoints with shape (batch_size, num_joints, height, width, 3) |
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
StackedKeypointEncoder
Bases: BaseKeypointEncoder
Encodes keypoints into heatmaps, where each.
Modified from BUCTD/data/JointsDataset, get_stacked_condition
Methods:
| Name | Description |
|---|---|
__call__ |
Args: |
Source code in deeplabcut/pose_estimation_pytorch/models/modules/kpt_encoders.py
__call__
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
the keypoints to encode |
required |
|
tuple[int, int]
|
the (height, width) of the heatmap in which the keypoints should be encoded |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
the encoded keypoints |