iaa_od.metrics.granularity
Functions
|
Compute Count and Size Granularities for all annotators in the provided Ground Truths, using a new approach based on "pseudo-units" and lenient IoU matching. |
|
Compute Count and Size Granularities separately for each image in the dataset. |
- iaa_od.metrics.granularity.all_granularities(result, /, *, iom_thr=0.5)[source]
Compute Count and Size Granularities for all annotators in the provided Ground Truths, using a new approach based on “pseudo-units” and lenient IoU matching.
- Parameters:
result (Result) – The Result object containing the Ground Truths and Units to compute granularities on.
iom_thr (float) – The Intersection over Minimum threshold to consider an annotation as “contained” within a unit. Defaults to STD_IOM_THR.
- Returns:
An object containing the computed granularities for all annotators, along with the median values and benchmarks.
- Return type:
- iaa_od.metrics.granularity.per_image_granularities(result, /, *, iom_thr=0.5, benchmark=None)[source]
Compute Count and Size Granularities separately for each image in the dataset.
This mirrors all_granularities, but instead of aggregating the per-unit contributions over the whole dataset, it restricts the computation to the units belonging to a single image at a time and returns one Granularities object per image.
- Normalisation behaviour is controlled by benchmark:
When benchmark is None (default), each image is self-contained: the per-annotator values are normalised by the median computed within that image. A value of 1.0 therefore identifies the median annotator on that image, and the benchmark annotator may differ from one image to the next. Use this to inspect who annotates by group/instance relative to the others on a given image.
When benchmark is supplied (typically the result of all_granularities(result)), every image is normalised by the global medians (benchmark.count_median and benchmark.size_median). Values are then comparable across images and against the global result, which is the appropriate choice for tracking how a single annotator’s behaviour drifts image by image (e.g. for labelling-fatigue analysis).
Images whose units are all singletons carry no granularity information and are omitted from the result. For a given image, only annotators that contribute to at least one non-singleton unit on that image appear in the returned dictionaries.
- Parameters:
result (Result) – The Result object containing the Ground Truths and Units.
iom_thr (float) – The IoM threshold to consider an annotation as “contained” within a unit. Defaults to 0.5.
benchmark (Granularities | None) – If provided, its count_median and size_median are used as the normalisation divisor for every image instead of each image’s own median, and its benchmark annotators are carried over. Defaults to None.
- Returns:
A mapping from image filename to the Granularities computed from that image’s units alone.
- Return type:
dict[str, Granularities]