class documentation
class LDFEquivalence:
Helpers for comparing datasets in Luxonis Data Format.
| Class Method | assert |
Assert that two prepared datasets are equivalent. |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | collect |
Undocumented |
| Class Method | equivalent |
Alias for ldf_equivalent. |
| Class Method | ldf |
Return whether two datasets are equivalent. |
| Static Method | file |
Return the SHA-256 hash for an image file. |
| Static Method | multiset |
Undocumented |
| Class Method | _assert |
Undocumented |
| Static Method | _canonicalize |
Undocumented |
| Static Method | _combine |
Undocumented |
| Static Method | _local |
Undocumented |
| Static Method | _prepared |
Undocumented |
| Static Method | _prepared |
Undocumented |
| Static Method | _prepared |
Undocumented |
| Static Method | _task |
Undocumented |
| Static Method | _to |
Undocumented |
@classmethod
def assert_equivalence(cls, previous: Any, new: Any, collector: LDFCollector | None = None):
¶
Assert that two prepared datasets are equivalent.
| Parameters | |
previous:Any | PreparedLDF or LuxonisDataset reference dataset. |
new:Any | PreparedLDF or LuxonisDataset dataset to compare. |
collector:LDFCollector | None | Optional custom collector used for comparison. |
| Raises | |
TypeError | If previous or new is neither
PreparedLDF nor LuxonisDataset. |
AssertionError | If 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_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 | |
previousstr | LuxonisDataset | Dataset name or dataset instance used as the reference. |
newstr | LuxonisDataset | Dataset name or dataset instance to compare. |
| Returns | |
bool | Whether the datasets are equivalent. |
| Raises | |
TypeError | If either argument is neither a dataset name nor a
LuxonisDataset. |
ValueError | If a dataset name matches multiple local datasets. |
FileNotFoundError | If 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 | |
previousstr | LuxonisDataset | Dataset name or dataset instance used as the reference. |
newstr | LuxonisDataset | Dataset name or dataset instance to compare. |
| Returns | |
bool | Whether the datasets are equivalent. |
| Raises | |
TypeError | If either argument is neither a dataset name nor a
LuxonisDataset. |
ValueError | If a dataset name matches multiple local datasets. |
FileNotFoundError | If a named local dataset, split metadata, annotation parquet file, or referenced image is missing. |
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