class documentation

Export FiftyOne classification data.

Output structure:

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

The labels.json file has structure:

{
    "classes": ["class1", "class2", ...],
    "labels": {
        "000001": 0,  # index into classes array
        "000002": 1,
        ...
    }
}
Method __init__ Undocumented
Method export Convert the prepared dataset into the exporter's format.
Method get_split_names Undocumented
Method supported_ann_types Return task types supported by this exporter.
Instance Variable class_to_idx Class-name to index mapping.
Instance Variable split_image_counter Per-split image counter used for exported filenames.
Instance Variable split_labels Per-split image-stem to class-index mapping.
Method _dump_annotations Undocumented
Method _get_data_path Return the folder path to store data files for this split.

Inherited from BaseExporter:

Instance Variable current_size Current partition size in bytes.
Instance Variable dataset_identifier Name or identifier used for exported paths.
Instance Variable image_indices Per-image export indices used by concrete exporters.
Instance Variable max_partition_size Optional maximum partition size in bytes.
Instance Variable max_partition_size_gb Optional maximum partition size in GiB.
Instance Variable output_path Directory where the export is written.
Instance Variable part Current partition index, or None when partitioning is disabled.
def __init__(self, dataset_identifier: str, output_path: Path, max_partition_size_gb: float | None):
def export(self, prepared_ldf: PreparedLDF):

Convert the prepared dataset into the exporter's format.

Parameters
prepared_ldf:PreparedLDFDataset data prepared for export.
Raises
NotImplementedErrorAlways raised by the abstract base implementation.
def get_split_names(self) -> dict[str, str]:

Undocumented

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

Return task types supported by this exporter.

Returns
list[str]Supported annotation task types.
Raises
NotImplementedErrorAlways raised by the abstract base implementation.
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.

def _dump_annotations(self, annotation_data: dict[str, Any], output_path: Path, part: int | None = None):
def _get_data_path(self, output_path: Path, split: str, part: int | None = None) -> Path:

Return the folder path to store data files for this split.