# coco_exporter

Python API: `luxonis_ml.data.exporters.coco_exporter`

## Classes

| Name | Description |
| --- | --- |
|
[`CocoExporter`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/coco_exporter.md)
| Exporter for COCO dataset format. |

### class `CocoExporter`

```python
class CocoExporter(BaseExporter)
```

Exporter for COCO dataset format.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `allow_keypoints` | `bool` | Whether keypoint annotations can be exported. |
| `class_name_to_category_id` | `dict[str, dict[str, int]]` | Category IDs per split and class name. |
| `current_size` | `int` |  |
| `format` |  | COCO output layout variant. |
| `image_registry` | `dict[str, dict[str, dict[str, Any]]]` | Exported image metadata per split. |
| `last_category_id` | `dict[str, int]` | Last assigned category ID per split. |
| `skeletons` |  | Optional keypoint skeleton metadata. |

Methods

| Name | Description |
| --- | --- |
|
[`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/coco_exporter.md)
| |
|
[`export`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/coco_exporter.md)
| Convert the prepared dataset into the exporter's format. |
|
[`get_split_names`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/coco_exporter.md)
| |
|
[`supported_ann_types`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/coco_exporter.md)
| Return task types supported by this exporter. |

#### method `__init__`

```python
def __init__(
    dataset_identifier: str,
    output_path: Path,
    max_partition_size_gb: float | None,
    format: COCOFormat = COCOFormat.ROBOFLOW,
    *,
    skeletons: dict[str, Any] | None = None,
)
```

#### method `export`

```python
def export(prepared_ldf: PreparedLDF)
```

Convert the prepared dataset into the exporter's format.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `prepared_ldf` | `PreparedLDF` | Dataset data prepared for export. | required |

Raises

| Type | Description |
| --- | --- |
| `NotImplementedError` | Always raised by the abstract base implementation. |

#### method `get_split_names`

```python
def get_split_names() -> dict[str, str]
```

#### method `supported_ann_types`

```python
def supported_ann_types() -> list[str]
```

Return task types supported by this exporter.

Returns

| Type | Description |
| --- | --- |
| `list[str]` | Supported annotation task types. |

Raises

| Type | Description |
| --- | --- |
| `NotImplementedError` | Always raised by the abstract base implementation. |
