class documentation

Export semantic segmentation masks in directory format.

Method __init__ Undocumented
Method export Export semantic segmentation masks and class CSV files.
Method get_split_names Undocumented
Method supported_ann_types Return task types supported by this exporter.
Instance Variable BACKGROUND_NAME Background class name written to class CSV files.
Instance Variable CLASS_COL Class-name column in class CSV files.
Instance Variable ID_COL Class-ID column in class CSV files.
Instance Variable split_class_maps Per-split class-to-ID maps used for _classes.csv.
Method _class_id_for Undocumented
Method _dump_annotations Undocumented
Method _ensure_background Undocumented
Method _get_data_path Return the folder path to store data files for this split.
Method _write_classes_csv Undocumented

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

Export semantic segmentation masks and class CSV files.

Parameters
prepared_ldf:PreparedLDFDataset data prepared for export.
Raises
ValueErrorIf a class ID exceeds 255, because the matching parser reads masks as 8-bit grayscale images.
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.
BACKGROUND_NAME: str =

Background class name written to class CSV files.

CLASS_COL: str =

Class-name column in class CSV files.

ID_COL: str =

Class-ID column in class CSV files.

split_class_maps: dict[str, OrderedDict[str, int]] =

Per-split class-to-ID maps used for _classes.csv.

def _class_id_for(self, split: str, class_name: str) -> int:

Undocumented

def _dump_annotations(self, annotation_splits: dict[str, dict[str, Any]], output_path: Path, part: int | None = None):
def _ensure_background(self, split: str):

Undocumented

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.

def _write_classes_csv(self, split: str, split_dir: Path):

Undocumented