# exporter_utils

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

## 类

### ExporterSpec

导出器类和构造函数参数。

#### 属性

##### cls

要实例化的导出器类。

##### kwargs

传递给导出器构造函数的关键字参数。

### PreparedLDF

用于导出 LDF 数据的轻量级容器。

#### 方法

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

准备数据集以导出为 LDF 表示。

参数

 * `dataset` (`LuxonisDataset`): 要准备的数据集。

返回

 * `PreparedLDF`: 准备好的 LDF 容器。

引发

 * `ValueError`: 如果数据集没有拆分。
 * `FileNotFoundError`: 如果无法从其原始位置或数据集媒体目录解析图像路径。

#### 属性

##### grouped_image_sources

组 ID、源名称和文件路径的唯一映射。

##### processed_df

已将路径解析为可读文件的注释数据帧。

##### splits

拆分名称映射到组 ID。

## 函数

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

返回单个骨架的标签和 COCO 样式边缘。

边缘根据 COCO 规范转换为基于 1 的索引。

### split_of_group

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