iaa_od.utils.sample_gts

Functions

get_min_max_bbox_size(gts, /, *[, filename])

Computes the minimum and maximum bounding box sizes (areas) across all annotations in the provided Ground Truths.

sample_avg_bbox_size(gt, /)

Computes the average bounding box size (area) across all annotations in the given Ground Truth.

sample_avg_bboxes_per_image(gt, /)

Computes the average number of bounding boxes per image in the given Ground Truth.

sample_global_avg_bbox_size(gts, /)

Computes the global average bounding box size (area) across all provided Ground Truths.

sample_global_avg_bboxes_per_image(gts, /)

Computes the global average number of bounding boxes per image across all provided Ground Truths.

iaa_od.utils.sample_gts.get_min_max_bbox_size(gts, /, *, filename=None)[source]

Computes the minimum and maximum bounding box sizes (areas) across all annotations in the provided Ground Truths.

Parameters:
  • gts (list) – A list of Ground Truth objects.

  • filename (Optional[str]) – If provided, only annotations from the specified image filename will be considered. If None, all annotations from all images will be considered.

Returns:

A tuple containing the minimum and maximum bounding box sizes (areas) across the specified annotations.

Return type:

tuple[float, float]

iaa_od.utils.sample_gts.sample_avg_bbox_size(gt, /)[source]

Computes the average bounding box size (area) across all annotations in the given Ground Truth.

Parameters:

gt – The Ground Truth object containing images and annotations.

Returns:

The average bounding box size (area) across all annotations.

Return type:

float

iaa_od.utils.sample_gts.sample_avg_bboxes_per_image(gt, /)[source]

Computes the average number of bounding boxes per image in the given Ground Truth.

Parameters:

gt – The Ground Truth object containing images and annotations.

Returns:

The average number of bounding boxes per image.

Return type:

float

iaa_od.utils.sample_gts.sample_global_avg_bbox_size(gts, /)[source]

Computes the global average bounding box size (area) across all provided Ground Truths.

Parameters:

gts (list) – A list of Ground Truth objects.

Returns:

The global average bounding box size (area) across all provided Ground Truths.

Return type:

float

iaa_od.utils.sample_gts.sample_global_avg_bboxes_per_image(gts, /)[source]

Computes the global average number of bounding boxes per image across all provided Ground Truths.

Parameters:

gts (list) – A list of Ground Truth objects.

Returns:

The global average number of bounding boxes per image across all provided Ground Truths.

Return type:

float