# superanimal

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

## Functions

### 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.

Parameters

 * `heatmaps` (`np.ndarray`): Model heatmap tensor.
 * `scale_factor` (`float`): Nonzero divisor used to convert model coordinates to normalized coordinates.

Returns

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

### 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.

Parameters

 * `heatmap` (`np.ndarray`): Heatmap tensor.
 * `locref` (`np.ndarray`): Locref tensor.
 * `scale_factors` (`tuple[float, float]`): Scale factors for the x and y axes.

Returns

 * `np.ndarray`: Pose prediction.

### get_top_values

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

Get the top values from the heatmap tensor.

Parameters

 * `heatmap` (`np.ndarray`): Heatmap tensor.

Returns

 * `tuple[np.ndarray, np.ndarray]`: Y and X coordinates of the top values.
