averagePrecision - Evaluate average precision metric of instance segmentation results - MATLAB (original) (raw)

Main Content

Evaluate average precision metric of instance segmentation results

Since R2024b

Syntax

Description

[ap](#mw%5F7339ba61-c770-450a-a427-e244abaa922c) = averagePrecision([metrics](#mw%5F74012b70-997a-4aa3-8a73-f6d7b641c8ca)) evaluates the average precision (AP) for all classes and overlap thresholds ofmetrics.

AP aggregates the precision across different recall levels, providing a single metric to assess the overall ability of an object detector to identify objects accurately while minimizing false detections.

[ap](#mw%5F7339ba61-c770-450a-a427-e244abaa922c) = averagePrecision([metrics](#mw%5F74012b70-997a-4aa3-8a73-f6d7b641c8ca),[Name=Value](#namevaluepairarguments)) specifies options for the average precision evaluation using one or more name-value arguments. For example, ClassNames=["cars" "people"] specifies to evaluate the average precision metric for the cars and people classes.

Input Arguments

Name-Value Arguments

collapse all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: averagePrecision(metrics,ClassNames=[cars people]) specifies to evaluate the average precision metric for the cars and people classes.

Class names of segmented objects, specified as an array of strings or a cell array of character vectors. By default, theaveragePrecision function returns the average precision metrics for all classes specified by theClassNames property of the instanceSegmentationMetrics objectmetrics.

Overlap threshold to use for evaluating the average precision, specified as a numeric scalar or numeric vector of box overlap threshold values. To evaluate multiple overlap thresholds, specify this argument as a numeric vector. By default, theaveragePrecision object function returns the average precision metrics for all overlap thresholds specified by theOverlapThreshold property of the instanceSegmentationMetrics objectmetrics.

Output Arguments

collapse all

Average precision (AP) for specified classes and overlap thresholds, specified as an M_-by-N matrix.M is the number of classes in the ClassNames property and_N is the number of specified overlap thresholdsOverlapThreshold.

The AP metric evaluates instance segmentation performance by quantifying the accuracy of the model in identifying object instances across different confidence thresholds, enabling you to assess both the precision (correctness of detections) and recall (completeness of detections).

Version History

Introduced in R2024b