# superanimal

Python API: `depthai_nodes.node.parsers.utils.superanimal`

## Functions

| Name | Description |
| --- | --- |
| [`compute_superanimal_keypoints`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/superanimal.md#superanimal-Functions-compute_superanimal_keypoints) | Decode SuperAnimal heatmaps into normalized landmarks. |
| [`get_pose_prediction`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/superanimal.md#superanimal-Functions-get_pose_prediction) | Get the pose prediction from the heatmap and locref tensors. Used for SuperAnimal model. |
| [`get_top_values`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/superanimal.md#superanimal-Functions-get_top_values) | Get the top values from the heatmap tensor. |

### function `compute_superanimal_keypoints`

```python
def compute_superanimal_keypoints(
    heatmaps: np.ndarray,
    *,
    scale_factor: float,
) -> tuple[np.ndarray, np.ndarray]
```

Decode SuperAnimal heatmaps into normalized landmarks.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `heatmaps` | `np.ndarray` | Model heatmap tensor. | required |
| `scale_factor` | `float` | Nonzero divisor used to convert model coordinates to normalized coordinates. | required |

Returns

| Type | Description |
| --- | --- |
| `tuple[np.ndarray, np.ndarray]` | A pair of `(N, 2)` keypoint coordinates and `(N,)` scores. Coordinates are divided by `scale_factor`. |

### function `get_pose_prediction`

```python
def get_pose_prediction(heatmap, locref, scale_factors)
```

Get the pose prediction from the heatmap and locref tensors. Used for SuperAnimal model.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `heatmap` | `np.ndarray` | Heatmap tensor. | required |
| `locref` | `np.ndarray` | Locref tensor. | required |
| `scale_factors` | `tuple[float, float]` | Scale factors for the x and y axes. | required |

Returns

| Type | Description |
| --- | --- |
| `np.ndarray` | Pose prediction. |

### function `get_top_values`

```python
def get_top_values(heatmap)
```

Get the top values from the heatmap tensor.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `heatmap` | `np.ndarray` | Heatmap tensor. | required |

Returns

| Type | Description |
| --- | --- |
| `tuple[np.ndarray, np.ndarray]` | Y and X coordinates of the top values. |
