class documentation

class LDFEquivalence:

View In Hierarchy

Helpers for comparing datasets in Luxonis Data Format.

Class Method assert_equivalence Assert that two prepared datasets are equivalent.
Class Method collect_annotation_multiset Undocumented
Class Method collect_bbox_multiset Undocumented
Class Method collect_classification_multiset Undocumented
Class Method collect_image_multiset Undocumented
Class Method collect_instance_segmentation_mask_overlap_multiset Undocumented
Class Method collect_instance_segmentation_multiset Undocumented
Class Method collect_keypoint_multiset Undocumented
Class Method collect_segmentation_mask_overlap_multiset Undocumented
Class Method collect_segmentation_multiset Undocumented
Class Method equivalent Alias for ldf_equivalent.
Class Method ldf_equivalent Return whether two datasets are equivalent.
Static Method file_sha256 Return the SHA-256 hash for an image file.
Static Method multiset_equal_with_tolerance Undocumented
Class Method _assert_collected_equivalence Undocumented
Static Method _canonicalize_annotation Undocumented
Static Method _combine_masks Undocumented
Static Method _local_dataset_path Undocumented
Static Method _prepared_ldf_from_local_path Undocumented
Static Method _prepared_ldf_from_name Undocumented
Static Method _prepared_ldf_from_public_input Undocumented
Static Method _task_types Undocumented
Static Method _to_prepared_ldf Undocumented
@classmethod
def assert_equivalence(cls, previous: Any, new: Any, collector: LDFCollector | None = None):

Assert that two prepared datasets are equivalent.

Parameters
previous:AnyPreparedLDF or LuxonisDataset reference dataset.
new:AnyPreparedLDF or LuxonisDataset dataset to compare.
collector:LDFCollector | NoneOptional custom collector used for comparison.
Raises
TypeErrorIf previous or new is neither PreparedLDF nor LuxonisDataset.
AssertionErrorIf the collected representations differ.
@classmethod
def collect_annotation_multiset(cls, prepared_ldf: PreparedLDF, task_type: str) -> dict[tuple[str], Counter]:

Undocumented

@classmethod
def collect_bbox_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str], Counter]:

Undocumented

@classmethod
def collect_classification_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str], Counter]:

Undocumented

@classmethod
def collect_image_multiset(cls, prepared_ldf: PreparedLDF) -> Counter[str]:

Undocumented

@classmethod
def collect_instance_segmentation_mask_overlap_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str], list[np.ndarray]]:

Undocumented

@classmethod
def collect_instance_segmentation_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str], Counter]:

Undocumented

@classmethod
def collect_keypoint_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str], Counter]:

Undocumented

@classmethod
def collect_segmentation_mask_overlap_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str, str], list[np.ndarray]]:

Undocumented

@classmethod
def collect_segmentation_multiset(cls, prepared_ldf: PreparedLDF) -> dict[tuple[str], Counter]:

Undocumented

@classmethod
def equivalent(cls, previous_dataset: str | LuxonisDataset, new_dataset: str | LuxonisDataset) -> bool:

Alias for ldf_equivalent.

Parameters
previous_dataset:str | LuxonisDatasetDataset name or dataset instance used as the reference.
new_dataset:str | LuxonisDatasetDataset name or dataset instance to compare.
Returns
boolWhether the datasets are equivalent.
Raises
TypeErrorIf either argument is neither a dataset name nor a LuxonisDataset.
ValueErrorIf a dataset name matches multiple local datasets.
FileNotFoundErrorIf a named local dataset, split metadata, annotation parquet file, or referenced image is missing.
@classmethod
def ldf_equivalent(cls, previous_dataset: str | LuxonisDataset, new_dataset: str | LuxonisDataset) -> bool:

Return whether two datasets are equivalent.

Parameters
previous_dataset:str | LuxonisDatasetDataset name or dataset instance used as the reference.
new_dataset:str | LuxonisDatasetDataset name or dataset instance to compare.
Returns
boolWhether the datasets are equivalent.
Raises
TypeErrorIf either argument is neither a dataset name nor a LuxonisDataset.
ValueErrorIf a dataset name matches multiple local datasets.
FileNotFoundErrorIf a named local dataset, split metadata, annotation parquet file, or referenced image is missing.
@staticmethod
def file_sha256(path: Path) -> str:

Return the SHA-256 hash for an image file.

Hashes are used to order annotations robustly when files are renamed.

@staticmethod
def multiset_equal_with_tolerance(prev_map: dict[tuple[str], Counter], new_map: dict[tuple[str], Counter], tol: float):

Undocumented

@classmethod
def _assert_collected_equivalence(cls, previous_ldf: PreparedLDF, new_ldf: PreparedLDF, collector: LDFCollector):

Undocumented

@staticmethod
def _canonicalize_annotation(annotation: str | None) -> str | None:

Undocumented

@staticmethod
def _combine_masks(masks: list[np.ndarray]) -> np.ndarray:

Undocumented

@staticmethod
def _local_dataset_path(dataset_name: str) -> Path | None:

Undocumented

@staticmethod
def _prepared_ldf_from_local_path(dataset_path: Path) -> PreparedLDF:

Undocumented

@staticmethod
def _prepared_ldf_from_name(dataset_name: str) -> PreparedLDF:

Undocumented

@staticmethod
def _prepared_ldf_from_public_input(dataset: str | LuxonisDataset) -> PreparedLDF:

Undocumented

@staticmethod
def _task_types(prepared_ldf: PreparedLDF) -> set[str]:

Undocumented

@staticmethod
def _to_prepared_ldf(ldf_like: Any) -> PreparedLDF:

Undocumented