class documentation
class UltralyticsNDJSONExporter(BaseExporter):
Constructor: UltralyticsNDJSONExporter(dataset_identifier, output_path, max_partition_size_gb, dataset_type, ndjson_task)
Export datasets in Ultralytics NDJSON format.
| Method | __init__ |
Undocumented |
| Method | export |
Convert the prepared dataset into the exporter's format. |
| Method | get |
Undocumented |
| Method | supported |
Return task types supported by this exporter. |
| Instance Variable | class |
Class names ordered by class ID. |
| Instance Variable | class |
Class-name to class-ID mapping. |
| Instance Variable | current |
Undocumented |
| Instance Variable | dataset |
Source dataset type being exported. |
| Instance Variable | keypoint |
Set of keypoint counts observed while exporting. |
| Instance Variable | ndjson |
Ultralytics task name, one of "detect", "segment", or "pose". |
| Static Method | _bbox |
Undocumented |
| Static Method | _bbox |
Undocumented |
| Static Method | _flatten |
Undocumented |
| Method | _build |
Undocumented |
| Method | _build |
Undocumented |
| Method | _dataset |
Undocumented |
| Method | _dump |
Undocumented |
| Method | _get |
Return the folder path to store data files for this split. |
| Method | _image |
Undocumented |
| Method | _keypoints |
Undocumented |
| Method | _maybe |
Undocumented |
| Method | _segments |
Undocumented |
| Instance Variable | _image |
Undocumented |
Inherited from BaseExporter:
| Instance Variable | dataset |
Name or identifier used for exported paths. |
| Instance Variable | image |
Per-image export indices used by concrete exporters. |
| Instance Variable | max |
Optional maximum partition size in bytes. |
| Instance Variable | max |
Optional maximum partition size in GiB. |
| Instance Variable | output |
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, *, dataset_type: DatasetType, ndjson_task: UltralyticsTask):
¶
Undocumented
Convert the prepared dataset into the exporter's format.
| Parameters | |
preparedPreparedLDF | Dataset data prepared for export. |
| Raises | |
NotImplementedError | Always raised by the abstract base implementation. |
Return task types supported by this exporter.
| Returns | |
list[ | Supported annotation task types. |
| Raises | |
NotImplementedError | Always raised by the abstract base implementation. |
def _build_annotations(self, instances:
dict[ tuple[ str, int], dict[ str, Any]], file_path: Path) -> dict[ str, Any]:
¶
Undocumented
def _build_image_record(self, file_path:
Path, relative_file: Path, split: str, group_df: Any) -> dict[ str, Any]:
¶
Undocumented
def _dump_annotations(self, annotation_splits:
dict[ str, list[ dict[ str, Any]]], output_path: Path, part: int | None = None):
¶
Undocumented
def _keypoints_to_line(self, class_id:
int, bbox: dict[ str, Any] | None, annotation: dict[ str, Any]) -> list[ float | int] | None:
¶
Undocumented
def _maybe_roll_partition(self, annotation_splits:
dict[ str, list[ dict[ str, Any]]], additional_size: int) -> dict[ str, list[ dict[ str, Any]]]:
¶
Undocumented
def _segments_to_lines(self, class_id:
int, annotation: dict[ str, Any], file_path: Path) -> list[ list[ float | int]]:
¶
Undocumented