class documentation

Undocumented

Static Method get_split_names Undocumented
Method export Convert the prepared dataset into the exporter's format.
Method supported_ann_types Return task types supported by this exporter.
Instance Variable current_size Undocumented
Static Method _estimate_xml_size Approximate byte-count.
Static Method _etree_to_pretty_bytes Undocumented
Method _build_voc_xml_string Undocumented
Method _dump_annotations Undocumented
Method _get_data_path Return the folder path to store data files for this split.
Method _maybe_roll_partition Undocumented

Inherited from BaseExporter:

Method __init__ Undocumented
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.
@staticmethod
def get_split_names() -> dict[str, str]:

Undocumented

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 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.
current_size: int =
@staticmethod
def _estimate_xml_size(objects: list[dict[str, Any]]) -> int:

Approximate byte-count.

The alternative is to serialize, pretty-print and discard every time just to compute the true xml size.

@staticmethod
def _etree_to_pretty_bytes(elem: Element) -> bytes:

Undocumented

def _build_voc_xml_string(self, folder: str, filename: str, abs_path: Path, size: tuple[int, int, int], objects: list[dict[str, Any]]) -> str:

Undocumented

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

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

def _maybe_roll_partition(self, per_split_data: dict[str, dict[str, dict[str, Any]]], additional_size: int) -> dict[str, dict[str, dict[str, Any]]]:

Undocumented