class documentation

Parse a directory with SOLO annotations into LDF.

Expected format:

dataset_dir/
├── train/
│   ├── metadata.json
│   ├── sensor_definitions.json
│   ├── annotation_definitions.json
│   ├── metric_definitions.json
│   └── sequence.<SequenceNUM>/
│       ├── step<StepNUM>.camera.jpg
│       ├── step<StepNUM>.frame_data.json
│       └── (OPTIONAL: step<StepNUM>.camera.semantic segmentation.jpg)
├── valid/
└── test/

This is the default format returned by Unity simulation engine.

Static Method validate_split Validate whether a split directory has the expected SOLO format.
Method from_dir Parse all SOLO data in a source dataset directory.
Method from_split Parse one SOLO split into LDF records.
Method _get_solo_annotation_types List all annotation types present in the dataset.
Method _get_solo_bbox_class_names List class names for BoundingBox2DAnnotation type.
Method _get_solo_keypoint_names List keypoint labels for all classes.

Inherited from BaseParser:

Class Method discover_dir_splits Return present and valid split directories keyed by their canonical split names.
Class Method validate Validate whether the dataset directory has the expected format.
Method __init__ Create a parser for a target dataset.
Method get_parser_issue_messages Return parser issue messages collected during the last parse.
Method parse_dir Parse an entire dataset directory into the target dataset.
Method parse_split Parse one split subdirectory into the target dataset.
Method reset_parser_issue_messages Clear collected parser issue messages.
Static Method _apply_counts_to_pool Distribute images across splits based on requested counts.
Static Method _apply_counts_to_splits Apply count-based split requests to existing splits.
Static Method _canonicalize_split_name All current parsers use train and test split names whereas validation splits can vary in name between val valid and validation.
Static Method _compare_stem_files Compare sets of files by stem.
Static Method _get_added_images Return unique images yielded by a dataset generator.
Static Method _list_images List OpenCV-supported images in a directory.
Static Method _sample_from_splits Sample from each original split independently.
Method _get_parser_issue_messages Return parser issue messages collected during the last parse.
Method _log_skipped_annotation_summary Undocumented
Method _parse_available_splits Undocumented
Method _parse_split Parse data in one split subdirectory.
Method _remove_unsplit_records Remove records that are not assigned to any split.
Method _reset_parser_issue_messages Clear collected parser issue messages and warning counters.
Method _warn_skipped_annotation Undocumented
Method _wrap_generator Add configured task names to generated records.
Constant _CANONICAL_SPLIT_NAMES Undocumented
Constant _SKIPPED_WARNING_LIMIT Undocumented
Constant _SPLIT_NAMES Undocumented
Instance Variable _dataset Undocumented
Instance Variable _dataset_type Undocumented
Instance Variable _full_warnings Undocumented
Instance Variable _logged_skipped_annotation_warnings Undocumented
Instance Variable _parser_issue_messages Undocumented
Instance Variable _seen_parser_issue_messages Undocumented
Instance Variable _skipped_annotation_counts_by_reason Undocumented
Instance Variable _suppressed_skipped_annotation_warnings Undocumented
Instance Variable _task_name Undocumented
@staticmethod
def validate_split(split_path: Path) -> dict[str, Any] | None:

Validate whether a split directory has the expected SOLO format.

Parameters
split_path:PathPath to a split directory.
Returns
dict[str, Any] | NoneKeyword arguments for from_split, or None if the split is not in the expected format.
def from_dir(self, dataset_dir: Path) -> tuple[list[Path], list[Path], list[Path]]:

Parse all SOLO data in a source dataset directory.

Parameters
dataset_dir:PathSource dataset directory.
Returns
tuple[list[Path], list[Path], list[Path]]Added images for the train, validation, and test splits.
def from_split(self, split_path: Path) -> ParserOutput:

Parse one SOLO split into LDF records.

Parameters
split_path:PathDirectory with SOLO sequences and annotations.
Returns
ParserOutputParser output containing annotation records, skeleton metadata, and added images.
Raises
FileNotFoundErrorIf the split directory, annotation definitions file, referenced image, or referenced mask does not exist.
ValueErrorIf no bounding-box class names can be identified from annotation_definitions.json.
def _get_solo_annotation_types(self, annotation_definitions_dict: dict[str, Any]) -> list[str]:

List all annotation types present in the dataset.

Parameters
annotation_definitions_dict:dict[str, Any]Parsed annotation_definitions.json.
Returns
list[str]Annotation type names.
def _get_solo_bbox_class_names(self, annotation_definitions_dict: dict[str, Any]) -> list[str]:

List class names for BoundingBox2DAnnotation type.

Parameters
annotation_definitions_dict:dict[str, Any]Parsed annotation_definitions.json.
Returns
list[str]Bounding box class names.
def _get_solo_keypoint_names(self, annotation_definitions_dict: dict[str, Any]) -> list[str]:

List keypoint labels for all classes.

Parameters
annotation_definitions_dict:dict[str, Any]Parsed annotation_definitions.json.
Returns
list[str]Keypoint labels.