AveragePrecisionRecall#

class AveragePrecisionRecall[source]#

Abstract class to calculate average precision and recall for various vision tasks.

Parameters
max_dets: Union[List[int], Tuple[int]], default: [1, 10, 100]

Maximum number of detections per class.

area_range: tuple, default: (32**2, 96**2)

Slices for small/medium/large buckets.

return_option: str, default: ‘ap’

ap: ap only, ar: ar only, None: all (not ignite compliant).

average: str, default: none

The method for averaging over the classes. If none, returns the result per class.

iou_range: Tuple[float, float, float], default: (0.5, 0.95, 10)

The closed range of the iou values (min, max (including), number of points)

__init__(*args, max_dets: Union[List[int], Tuple[int]] = (1, 10, 100), area_range: Tuple = (1024, 9216), return_option: Optional[str] = 'ap', average: str = 'none', iou_range: Tuple[float, float, float] = (0.5, 0.95, 10), **kwargs)[source]#
__new__(*args, **kwargs)#

Attributes

AveragePrecisionRecall.required_output_keys

Methods

AveragePrecisionRecall.attach(engine, name)

Attaches current metric to provided engine.

AveragePrecisionRecall.calc_pairwise_ious(...)

Get a single result from group_class_detection_label and return a matrix of IoUs.

AveragePrecisionRecall.completed(engine, name)

Helper method to compute metric's value and put into the engine.

AveragePrecisionRecall.compute()

Compute metric value.

AveragePrecisionRecall.detach(engine[, usage])

Detaches current metric from the engine and no metric's computation is done during the run.

AveragePrecisionRecall.filter_res(res[, ...])

Get the value of a result by the filtering values.

AveragePrecisionRecall.get_classes_scores_at(res)

Get the mean value of the classes scores and the result values.

AveragePrecisionRecall.get_confidences(...)

Get detections object of single image and should return confidence for each detection.

AveragePrecisionRecall.get_detection_areas(...)

Get detection object of single image and should return area for each detection.

AveragePrecisionRecall.get_labels_areas(labels)

Get labels object of single image and should return area for each label.

AveragePrecisionRecall.group_class_detection_label(...)

Group detection and labels in dict of format {class_id: {'detected' [...], 'ground_truth': [...]}}.

AveragePrecisionRecall.is_attached(engine[, ...])

Checks if current metric is attached to provided engine.

AveragePrecisionRecall.iteration_completed(engine)

Helper method to update metric's computation.

AveragePrecisionRecall.load_state_dict(...)

Method replaces internal state of the class with provided state dict data.

AveragePrecisionRecall.reset()

Reset metric state.

AveragePrecisionRecall.started(engine)

Helper method to start data gathering for metric's computation.

AveragePrecisionRecall.state_dict()

Method returns state dict with attributes of the metric specified in its _state_dict_all_req_keys attribute.

AveragePrecisionRecall.update(output)

Update metric with batch of samples.