# metadata

Python API: `hubai_sdk.utils.metadata`

Read tensor shapes and element types from supported model files.

## Classes

| Name | Description |
| --- | --- |
| [`Metadata`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/metadata.md) | Input
and output tensor metadata extracted from a model. |

### class `Metadata`

```python
class Metadata
```

Input and output tensor metadata extracted from a model.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `input_dtypes` | `dict[str, DataType]` | Input element types keyed by tensor name. |
| `input_shapes` | `dict[str, list[int]]` | Input shapes keyed by tensor name. |
| `output_dtypes` | `dict[str, DataType]` | Output element types keyed by tensor name. |
| `output_shapes` | `dict[str, list[int]]` | Output shapes keyed by tensor name. |

## Functions

| Name | Description |
| --- | --- |
| [`get_metadata`](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/utils/metadata.md) |
Extract input and output metadata from a supported model file. |

### function `get_metadata`

```python
def get_metadata(model_path: Path) -> Metadata
```

Extract input and output metadata from a supported model file.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `model_path` | `Path` | Path to an ONNX, OpenVINO IR, or TFLite model. | required |

Returns

| Type | Description |
| --- | --- |
| `Metadata` | Input and output shapes and dtypes for the model. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the model format is unsupported. |
