# classification_sequence

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

## Functions

| Name | Description |
| --- | --- |
| [`compute_classification_sequence_scores`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/classification_sequence.md#classification_sequence-Functions-compute_classification_sequence_scores) | Normalize the layout of per-step classification scores. |

### function `compute_classification_sequence_scores`

```python
def compute_classification_sequence_scores(
    scores: np.ndarray,
    *,
    is_softmax: bool = True,
) -> np.ndarray
```

Normalize the layout of per-step classification scores.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `scores` | `np.ndarray` | Scores or logits of shape `(steps, classes)`, `(1, steps, classes)`, or `(steps, classes, 1)`. | required |
| `is_softmax` | `bool` | Whether scores already contain probabilities. If false, apply softmax. | `True` |

Returns

| Type | Description |
| --- | --- |
| `np.ndarray` | Float32 array of shape `(steps, classes)`. Softmax, when requested, runs over classes independently for each step. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the rank is not 2 or 3, or a 3D tensor has no supported singleton axis. |
