# exporter_utils

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

## Classes

### ExporterSpec

Exporter class and constructor arguments.

#### Attributes

##### cls

Exporter class to instantiate.

##### kwargs

Keyword arguments passed to the exporter constructor.

### PreparedLDF

Lightweight container for LDF data ready for export.

#### Methods

##### init

```python
def __init__(splits: dict[str, Any], processed_df: pl.DataFrame, grouped_image_sources: pl.DataFrame):
```

##### from_dataset

```python
def from_dataset(dataset: LuxonisDataset) -> PreparedLDF:
```

Prepare a dataset for export into the LDF representation.

Parameters

 * `dataset` (`LuxonisDataset`): Dataset to prepare.

Returns

 * `PreparedLDF`: Prepared LDF container.

Raises

 * `ValueError`: If the dataset has no splits.
 * `FileNotFoundError`: If an image path cannot be resolved from either its original location or the dataset media directory.

#### Attributes

##### grouped_image_sources

Unique mapping of group IDs, source names, and file paths.

##### processed_df

Annotation dataframe with paths resolved to readable files.

##### splits

Split names mapped to group IDs.

## Functions

### annotation_to_polygons

```python
def annotation_to_polygons(ann: dict[str, Any], file_path: Path) -> list[list[tuple[float, float]]]:
```

### check_group_file_correspondence

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

### create_zip_output

```python
def create_zip_output(max_partition_size: float | None, output_path: Path, part: int | None, dataset_identifier: str) -> Path | list[Path]:
```

### decode_rle_with_pycoco

```python
def decode_rle_with_pycoco(ann: dict[str, Any]) -> np.ndarray:
```

### exporter_specific_annotation_warning

```python
def exporter_specific_annotation_warning(prepared_ldf: PreparedLDF, supported_ann_types: list[str]):
```

### get_single_skeleton

```python
def get_single_skeleton(allow_keypoints: bool, skeletons: dict[str, Any] | None = None) -> tuple[list[str], list[list[int]]]:
```

Return labels and COCO-style edges for the single skeleton.

Edges are converted to 1-based indices per COCO spec.

### split_of_group

```python
def split_of_group(prepared_ldf: PreparedLDF, group_id: Any) -> str:
```
