iaa_od.visualisation

iaa_od.visualisation.compare_images_with_macrocategories(result, filename, filepath, collapsed_categories, /, *, enable_labels=False, show_image_filename=False, sc_data=None)[source]

Displays the specified image with bounding box annotations from all ground truths in the provided Result object, comparing both the original categories (top row) and the collapsed macro-categories (bottom row).

Parameters:
  • result (Result) – The Result object containing the ground truths and annotations.

  • filename (str) – The filename of the image to display.

  • filepath (str) – The filepath where the image is located.

  • collapsed_categories (dict[str, list[int]]) – A dictionary mapping macro-category names to lists of category IDs that belong to that macro-category.

  • enable_labels (bool, optional) – Whether to display category labels above bounding boxes. Defaults to False.

  • show_image_filename (bool, optional) – Whether to include the image filename in the title above the image. Defaults to False.

  • sc_data (ScaleComplexity | None) – Optional ScaleComplexity object containing Scale Complexity data for the images, which will be displayed in the title of the bottom row if provided. Defaults to None.

Return type:

None

iaa_od.visualisation.get_image_path(filename, filepath)[source]

Utility function that simply constructs the entire path for a given image filename. If necessary, the function also adds the ending forwards slash to the filepath.

Parameters:
  • filename (str) – The image filename.

  • filepath (str) – The filepath where the image is located.

Returns:

The full path to the image.

Return type:

str

iaa_od.visualisation.show_fatigue_data_with_agreement(sessions)[source]

Visualise the fatigue evaluation of annotators by plotting Alpha values against normalised timestamps for each GT. The graph also shows a mean Alpha value across all GTs to provide an overall trend of annotator fatigue over time. :type sessions: dict[str, dict[int, list[AnnotationTimestamp]]] :param sessions: A dictionary where keys are GT names and values are dictionaries mapping session IDs to lists of AnnotationTimestamp objects. :type sessions: dict[str, dict[int, list[AnnotationTimestamp]]]

Return type:

None

iaa_od.visualisation.show_fatigue_data_with_granularity(sessions, granularities)[source]

Visualise annotator fatigue through per-image granularity instead of Krippendorff’s alpha.

For each GT, this plots the per-image count granularity (top) and size granularity (bottom) against the normalised timestamps, one line per annotation session, together with a mean trend line across all sessions. Under the dataset-wide benchmark normalisation used by per_image_fatigue_granularities, a value of 1.0 is the benchmark (median) annotator; values drifting above or below 1.0 over the course of a session indicate the annotator shifting their granularity strategy (e.g. toward larger, group-level boxes as fatigue sets in: lower count granularity, higher size granularity).

Parameters:
  • sessions (dict[str, dict[int, list[AnnotationTimestamp]]]) – A dictionary where keys are GT names and values are dictionaries mapping session IDs to lists of AnnotationTimestamp objects, as returned by evaluate_annotator_fatigue.

  • granularities (dict[str, Granularities]) – A mapping from image filename to that image’s Granularities, as returned by per_image_fatigue_granularities.

Return type:

None

iaa_od.visualisation.show_gts_with_annotations(result, filepath, /, *, show_stats=False, enable_labels=False, full_legend=False, show_image_filename=False)[source]

A wrapper for the function “show_image_with_annotations” that runs it for all images in a given ground truth set.

Parameters:
  • result (Result) – The Result object containing the ground truths and annotations.

  • filepath (str) – The filepath where the images are located.

  • show_stats (bool, optional) – Whether to show statistics alongside the annotations. Defaults to False.

  • enable_labels (bool, optional) – Whether to display category labels above bounding boxes. Defaults to False.

  • full_legend (bool, optional) – Whether to include all categories in the legend, even if not present in the image. Defaults to False.

  • show_image_filename (bool, optional) – Whether to include the image filename in the title above the image. Defaults to False.

Return type:

None

iaa_od.visualisation.show_gts_with_disagreements(result, filepath, /, *, compare_categories=False, show_image_filename=False)[source]

A wrapper for the function “show_image_with_disagreements_new” that runs it for all images in a given ground truth set.

Parameters:
  • result (Result) – The Result object containing the ground truths and units.

  • filepath (str) – The filepath where the images are located.

  • compare_categories (bool) – Whether to compare categories for agreement status, or just localisation.

  • show_image_filename (bool) – Whether to show the image filename in the title of the plot. Defaults to False.

Return type:

None

iaa_od.visualisation.show_image_with_annotations(result, filename, filepath, /, *, show_stats=False, enable_labels=False, full_legend=False, show_image_filename=False)[source]

Displays the specified image with bounding box annotations from all ground truths in the provided Result object.

Parameters:
  • result (Result) – The Result object containing the ground truths and annotations.

  • filename (str) – The filename of the image to display.

  • filepath (str) – The filepath where the image is located.

  • show_stats (bool, optional) – Whether to show statistics alongside the annotations. Defaults to False.

  • enable_labels (bool, optional) – Whether to display category labels above bounding boxes. Defaults to False.

  • full_legend (bool, optional) – Whether to include all categories in the legend, even if not present in the image. Defaults to False.

  • show_image_filename (bool, optional) – Whether to include the image filename in the title above the image. Defaults to False.

Return type:

None

iaa_od.visualisation.show_image_with_annotations_macrocategories(result, filename, filepath, collapsed_categories, /, *, enable_labels=False, full_legend=False, show_image_filename=False)[source]

Displays the specified image with bounding box annotations from all ground truths in the provided Result object.

Parameters:
  • result (Result) – The Result object containing the ground truths and annotations.

  • filename (str) – The filename of the image to display.

  • filepath (str) – The filepath where the image is located.

  • collapsed_categories (dict[str, list[int]]) – A dictionary mapping macro-category names to lists of category IDs that belong to that macro-category.

  • enable_labels (bool, optional) – Whether to display category labels above bounding boxes. Defaults to False.

  • full_legend (bool, optional) – Whether to include all macro-categories in the legend, even if not present in the image. Defaults to False.

  • show_image_filename (bool, optional) – Whether to include the image filename in the title above the image. Defaults to False.

Return type:

None

iaa_od.visualisation.show_image_with_disagreements(result, filename, filepath, /, *, compare_categories=False, show_image_filename=False)[source]

Shows which bounding boxes on a given image contribute to agreement (in green) and which don’t (in red).

Parameters:
  • result (Result) – The Result object containing the ground truths and units.

  • filename (str) – The filename of the image to display.

  • filepath (str) – The filepath where the image is located.

  • compare_categories (bool) – Whether to compare categories for agreement status, or just localisation.

  • show_image_filename (bool) – Whether to show the image filename in the title of the plot. Defaults to False.

Return type:

None

iaa_od.visualisation.show_iou_sweep(results)[source]

Function which plots Alpha values against IoU thresholds from a list of Result objects.

Parameters:

results (list[Result]) – The list of Result objects containing Kappa and Alpha values for different IoU thresholds.

Return type:

None

iaa_od.visualisation.show_units(result, filename, filepath, /)[source]

Function which shows all units found for a given image in the provided Result object.

Parameters:
  • result (Result) – The Result object containing the ground truths and units.

  • filename (str) – The filename of the image to display.

  • filepath (str) – The filepath where the image is located.

Return type:

None

iaa_od.visualisation.upsert_handle(handles, new_handle)[source]

Utility function that adds a new legend handle to the list of handles if it does not already exist.

Parameters:
  • handles (list[Patch]) – The list of existing legend handles.

  • new_handle (Patch) – The new legend handle to add.

Return type:

None

Modules

show_annotations

show_disagreements

show_fatigue_evaluation

show_iou_sweep(results)

Function which plots Alpha values against IoU thresholds from a list of Result objects.

show_units(result, filename, filepath, /)

Function which shows all units found for a given image in the provided Result object.

show_utils