iaa_od.models.result

Classes

Result(*, gts, iou_thr, iom[, alpha, ...])

Represents the result of comparing detected objects against ground truth data.

class iaa_od.models.result.Result(*, gts, iou_thr, iom, alpha=None, alpha_per_image=<factory>, mean_alpha=None, units=<factory>, observations=None, unfiltered_observations=None, mismatched_bounding_boxes=None)[source]

Bases: object

Represents the result of comparing detected objects against ground truth data.

gts

List of ground truth datasets used in the comparison.

Type:

list[GroundTruthProtocol]

iou_thr

The Intersection over Union (IoU) threshold used for matching.

Type:

float

iom

Whether Intersection over Minimum (IoM) matching was used.

Type:

bool

matching_algorithm

The algorithm used for matching annotations (only for Kappa).

Type:

MatchingAlgorithm | None

kappa

The calculated Kappa statistic (only for Kappa).

Type:

float | None

mean_kappa

The mean Kappa across images (only for Kappa).

Type:

float | None

kappa_per_image

Kappa values per image (only for Kappa).

Type:

dict[str, float]

counts

Overall comparison counts (only for Kappa).

Type:

ComparisonValues | None

counts_per_image

Comparison counts per image (only for Kappa).

Type:

dict[str, ComparisonValues]

alpha

The calculated Alpha statistic (only for Alpha).

Type:

float | None

alpha_per_image

Alpha values per image (only for Alpha).

Type:

dict[str, float]

mean_alpha

The mean Alpha across images (only for Alpha).

Type:

float | None

units

List of KAlphaUnit objects used in Alpha calculation (only for Alpha).

Type:

list[KAlphaUnit]

observations

Observations matrix for Alpha calculation (only for Alpha).

Type:

KAlphaObservationsMatrix | None

unfiltered_observations

Unfiltered observations matrix for Alpha calculation (only for Alpha).

Type:

KAlphaObservationsMatrix | None

mismatched_bounding_boxes

Number of mismatched bounding boxes (only for Alpha).

Type:

int | None

alpha: float | None
alpha_per_image: dict[str, float]
brief()[source]

Generate a brief summary of the Result object, including key fields and metrics.

Returns:

A formatted string summarizing the Result object.

Return type:

str

gts: list[GroundTruthProtocol]
iom: bool
iou_thr: float
mean_alpha: float | None
mismatched_bounding_boxes: int | None
property mismatched_bounding_boxes_percentage: float | None

Calculate the percentage of mismatched bounding boxes out of the total number of bounding boxes in the ground truths.

Returns:

The percentage of mismatched bounding boxes, or None if mismatched_bounding_boxes is not set.

Return type:

Optional[float]

observations: KAlphaObservationsMatrix | None
unfiltered_observations: KAlphaObservationsMatrix | None
units: list[KAlphaUnit]