datumaro.components.comparator#

Classes

DistanceComparator([iou_threshold])

Method generated by attrs for class DistanceComparator.

EqualityComparator(*[, match_images, ...])

Method generated by attrs for class EqualityComparator.

TableComparator()

Class for comparing datasets and generating comparison report table.

class datumaro.components.comparator.DistanceComparator(iou_threshold=0.5)[source]#

Bases: object

Method generated by attrs for class DistanceComparator.

match_annotations(item_a, item_b)[source]#
match_labels(item_a, item_b)[source]#
match_polygons(item_a, item_b)[source]#
match_masks(item_a, item_b)[source]#
match_boxes(item_a, item_b)[source]#
match_points(item_a, item_b)[source]#
match_lines(item_a, item_b)[source]#
class datumaro.components.comparator.EqualityComparator(*, match_images: bool = False, ignored_fields=_Nothing.NOTHING, ignored_attrs=_Nothing.NOTHING, ignored_item_attrs=_Nothing.NOTHING, all=False)[source]#

Bases: object

Method generated by attrs for class EqualityComparator.

match_images: bool#
errors: list#
compare_datasets(a, b)[source]#
static save_compare_report(output: Dict, report_dir: str) None[source]#

Saves the comparison report to JSON and text files.

Parameters:
  • output – A dictionary containing the comparison data.

  • report_dir – A string representing the directory to save the report files.

class datumaro.components.comparator.TableComparator[source]#

Bases: object

Class for comparing datasets and generating comparison report table.

Method generated by attrs for class TableComparator.

compare_datasets(first: Dataset, second: Dataset, mode: str = 'all') Tuple[str, str, str, Dict][source]#

Compares two datasets and generates comparison reports.

Parameters:
  • first – The first dataset to compare.

  • second – The second dataset to compare.

Returns:

A tuple containing high-level table, mid-level table, low-level table, and a dictionary representation of the comparison.

static save_compare_report(high_level_table: str, mid_level_table: str, low_level_table: str, comparison_dict: Dict, report_dir: str) None[source]#

Saves the comparison report to JSON and text files.

Parameters:
  • high_level_table – High-level comparison table as a string.

  • mid_level_table – Mid-level comparison table as a string.

  • low_level_table – Low-level comparison table as a string.

  • comparison_dict – A dictionary containing the comparison data.

  • report_dir – A string representing the directory to save the report files.