deeplabcut.pose_estimation_pytorch.models.predictors.sim_cc
SimCC predictor for the RTMPose model.
Based on the official mmpose SimCC codec and RTMCC head implementation. For more
information, see https://github.com/open-mmlab/mmpose.
Classes:
| Name | Description |
|---|---|
SimCCPredictor |
Class used to make pose predictions from RTMPose head outputs. |
Functions:
| Name | Description |
|---|---|
get_simcc_maximum |
Get maximum response location and value from SimCC representations. |
get_simcc_normalized |
Normalize the predicted SimCC. |
SimCCPredictor
Bases: BasePredictor
Class used to make pose predictions from RTMPose head outputs.
The RTMPose model uses coordinate classification for pose estimation. For more information, see "SimCC: a Simple Coordinate Classification Perspective for Human Pose Estimation" (https://arxiv.org/pdf/2107.03332) and "RTMPose: Real-Time Multi-Person Pose Estimation based on MMPose" (https://arxiv.org/pdf/2303.07399).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
The split ratio of pixels, as described in SimCC. |
2.0
|
|
bool
|
Whether to apply softmax on the scores. |
True
|
|
bool
|
Whether to normalize the outputs before predicting maximums. |
False
|
Source code in deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py
get_simcc_maximum
get_simcc_maximum(simcc_x: ndarray, simcc_y: ndarray, apply_softmax: bool = False) -> tuple[np.ndarray, np.ndarray]
Get maximum response location and value from SimCC representations.
Note
instance number: N num_keypoints: K heatmap height: H heatmap width: W
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
x-axis SimCC in shape (K, Wx) or (N, K, Wx) |
required |
|
ndarray
|
y-axis SimCC in shape (K, Wy) or (N, K, Wy) |
required |
|
bool
|
whether to apply softmax on the heatmap. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[ndarray, ndarray]
|
|
Source code in deeplabcut/pose_estimation_pytorch/models/predictors/sim_cc.py
get_simcc_normalized
Normalize the predicted SimCC.
See: github.com/open-mmlab/mmpose/blob/main/mmpose/codecs/utils/post_processing.py#L12
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Tensor
|
The predicted output. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
The normalized output. |