# quantization

Python API: `hubai_sdk.utils.quantization`

Normalize calibration-domain, dataset, and local ZIP inputs.

## Classes

| Name | Description |
| --- | --- |
|
[`NormalizedQuantizationInput`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/quantization.md)
| Normalized calibration selection used by hosted conversion. |

### class `NormalizedQuantizationInput`

```python
class NormalizedQuantizationInput
```

Normalized calibration selection used by hosted conversion.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `custom_zip_path` | `Path | None` | Resolved local calibration ZIP when custom data was supplied. |
| `quantization_data` | `str | None` | Built-in domain, dataset ID, `"CUSTOM"`, or `None`. |

## Functions

| Name | Description |
| --- | --- |
|
[`is_custom_quantization_zip_path`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/quantization.md)
| Return whether a path points to a local quantization zip file. |
|
[`normalize_quantization_input`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/quantization.md)
| Normalize quantization input into a structured representation. |

### function `is_custom_quantization_zip_path`

```python
def is_custom_quantization_zip_path(path: str | Path) -> bool
```

Return whether a path points to a local quantization zip file.

### function `normalize_quantization_input`

```python
def normalize_quantization_input(
    quantization_data: QuantizationData | PathType | None,
) -> NormalizedQuantizationInput
```

Normalize quantization input into a structured representation.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `quantization_data` | `QuantizationData | PathType | None` | Quantization input provided as a predefined domain, dataset ID,
local `.zip` path, or `None`. | required |

Returns

| Type | Description |
| --- | --- |
| `NormalizedQuantizationInput` | A normalized quantization input record describing the resolved value. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the value is unsupported or incomplete. |
| `FileNotFoundError` | If a local quantization zip path does not exist. |
