# fiftyone_classification_exporter

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

## Classes

| Name | Description |
| --- | --- |
|
[`FiftyOneClassificationExporter`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/fiftyone_classification_exporter.md)
| Export FiftyOne classification data. |

### class `FiftyOneClassificationExporter`

```python
class FiftyOneClassificationExporter(BaseExporter)
```

Export FiftyOne classification data.

Output structure:

```text
<dataset_name>/
    train/
        data/
            000001.jpg
            000002.jpg
            ...
        labels.json
    validation/
        data/
            ...
        labels.json
    test/
        data/
            ...
        labels.json
```

The `labels.json` file has structure:

```text
{
    "classes": ["class1", "class2", ...],
    "labels": {
        "000001": 0,  # index into classes array
        "000002": 1,
        ...
    }
}
```

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `class_to_idx` | `dict[str, int]` | Class-name to index mapping. |
| `split_image_counter` | `dict[str, int]` | Per-split image counter used for exported filenames. |
| `split_labels` | `dict[str, dict[str, int]]` | Per-split image-stem to class-index mapping. |

Methods

| Name | Description |
| --- | --- |
|
[`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/fiftyone_classification_exporter.md)
| |
|
[`export`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/fiftyone_classification_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/fiftyone_classification_exporter.md)
| |
|
[`supported_ann_types`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/data/exporters/fiftyone_classification_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,
)
```

#### 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. |
