class documentation

class DatasetRecord(BaseModelExtraForbid):

View In Hierarchy

Dataset record containing file paths and an optional annotation.

Class Method validate_files Undocumented
Class Method validate_task_name Undocumented
Static Method decode_metadata Undocumented
Method to_parquet_rows Recursively convert the dataset record and all its annotations and sub-annotations to parquet rows.
Method validate_task_name_valid_identifier Undocumented
Class Variable sample_metadata Undocumented
Instance Variable annotation Optional detection associated with the dataset record.
Instance Variable files File paths keyed by source name.
Instance Variable task_name The name of the task to which the record belongs.
Property all_file_paths All file paths associated with the dataset record.
Property file The file path of the dataset record.
Method _to_parquet_rows Undocumented
@model_validator(mode='before')
@classmethod
def validate_files(cls, values: dict[str, Any]) -> dict[str, Any]:

Undocumented

@model_validator(mode='before')
@classmethod
def validate_task_name(cls, values: dict[str, Any]) -> dict[str, Any]:

Undocumented

@staticmethod
def decode_metadata(value: Any) -> Params:

Undocumented

def to_parquet_rows(self) -> Iterable[ParquetRecord]:

Recursively convert the dataset record and all its annotations and sub-annotations to parquet rows.

Yields
Annotation data rows.
@model_validator(mode='after')
def validate_task_name_valid_identifier(self) -> Self:

Undocumented

sample_metadata: Params =

Undocumented

annotation: Detection | None =

Optional detection associated with the dataset record.

files: dict[str, FilePath] =

File paths keyed by source name.

task_name: str =

The name of the task to which the record belongs.

@property
@deprecated('Use `list(record.files.values())` instead.')
all_file_paths: list[FilePath] =

All file paths associated with the dataset record.

Deprecated since version 0.9.0: Use list(record.files.values()) instead.
@property
file: FilePath =

The file path of the dataset record.

This property is provided for convenience when the dataset record has exactly one file.

Raises
ValueErrorIf the dataset record has zero or multiple files.
def _to_parquet_rows(self, annotation: Detection | None, task_name: str) -> Iterable[ParquetRecord]:

Undocumented