class documentation

Exporter for COCO dataset format.

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 allow_keypoints Whether keypoint annotations can be exported.
Instance Variable class_name_to_category_id Category IDs per split and class name.
Instance Variable current_size Undocumented
Instance Variable format COCO output layout variant.
Instance Variable image_registry Exported image metadata per split.
Instance Variable last_category_id Last assigned category ID per split.
Instance Variable skeletons Optional keypoint skeleton metadata.
Method _dump_annotations Undocumented
Method _fill_bbox Undocumented
Method _fill_instance_segmentation Undocumented
Method _fill_keypoints Undocumented
Method _get_data_path Return the folder path to store data files for this split.
Method _get_or_register_image Undocumented
Method _maybe_roll_partition Undocumented
Method _process_row Undocumented

Inherited from BaseExporter:

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, format: COCOFormat = COCOFormat.ROBOFLOW, *, skeletons: dict[str, Any] | None = 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.
allow_keypoints: bool =

Whether keypoint annotations can be exported.

class_name_to_category_id: dict[str, dict[str, int]] =

Category IDs per split and class name.

current_size: int =
format =

COCO output layout variant.

image_registry: dict[str, dict[str, dict[str, Any]]] =

Exported image metadata per split.

last_category_id: dict[str, int] =

Last assigned category ID per split.

skeletons =

Optional keypoint skeleton metadata.

def _dump_annotations(self, annotation_splits: dict[str, dict[str, Any]], output_path: Path, part: int | None = None):
def _fill_bbox(self, ann: dict[str, Any], data: dict[str, Any], w: int, h: int, split: str, cname: str):

Undocumented

def _fill_instance_segmentation(self, ann: dict[str, Any], data: dict[str, Any], split: str, cname: str):

Undocumented

def _fill_keypoints(self, ann: dict[str, Any], data: dict[str, Any], w: int, h: int, split: str, cname: 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 _get_or_register_image(self, path: Path, split: str, annotation_splits: dict[str, dict[str, Any]]) -> tuple[int, int, int, str]:

Undocumented

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

Undocumented

def _process_row(self, row: dict[str, Any], split: str, annotation_splits: dict[str, dict[str, Any]], ann: dict[str, Any], w: int, h: int) -> tuple[dict[str, Any], bool]:

Undocumented