# coco_exporter

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

## Classes

### CocoExporter

Exporter for COCO dataset format.

#### Methods

##### 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):
```

##### export

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

Convert the prepared dataset into the exporter's format.

Parameters

 * `prepared_ldf` (`PreparedLDF`): Dataset data prepared for export.

Raises

 * `NotImplementedError`: Always raised by the abstract base implementation.

##### get_split_names

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

##### supported_ann_types

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

Return task types supported by this exporter.

Returns

 * `list[str]`: Supported annotation task types.

Raises

 * `NotImplementedError`: Always raised by the abstract base implementation.

#### Attributes

##### allow_keypoints

Whether keypoint annotations can be exported.

##### class_name_to_category_id

Category IDs per split and class name.

##### current_size

##### format

COCO output layout variant.

##### image_registry

Exported image metadata per split.

##### last_category_id

Last assigned category ID per split.

##### skeletons

Optional keypoint skeleton metadata.
