Structure

MLObjectDetectorMetrics

Metrics used to evaluate an object detector’s performance.

Declaration

struct MLObjectDetectorMetrics

Overview

An object detector generates intersection-over-union (IoU) metrics, which is a way to measure the similarity of two bounding boxes. The IoU metric is the overlapping area divided by the area of the union of the bounding boxes.

For example, two bounding boxes that overlap perfectly have an IoU of 1.0, because their overlap is the same area as the union. Two bounding boxes that have no overlap have an IoU of 0.0. Anything between 0.0 and 1.0 either means the two bounding boxes partially overlap or one box completely encases the other.

Topics

Creating Metrics

init(averagePrecision: (variedIoU: [String : Double], IoU50: [String : Double]), meanAveragePrecision: (variedIoU: Double, IoU50: Double))

Creates metrics for an object detector given an average precision and a mean average precision.

Assessing the Model

var averagePrecision: (variedIoU: [String : Double], IoU50: [String : Double])

Two dictionaries of average precisions at different threshholds.

var meanAveragePrecision: (variedIoU: Double, IoU50: Double)

Two mean-average precisions at different threshholds.

Handling Errors

var isValid: Bool

A Boolean value indicating whether the object detector model was able to calculate metrics.

var error: Error?

The underlying error present when the metrics are invalid.

Describing Metrics

var description: String

A text representation of the object detector metrics.

var debugDescription: String

A text representation of the object detector metrics that’s suitable for output during debugging.

var playgroundDescription: Any

A description of the object detector metrics shown in a playground.

See Also

Assessing Model Accuracy

var trainingMetrics: MLObjectDetectorMetrics

Measurements of the object detector’s performance on the training data set.

var validationMetrics: MLObjectDetectorMetrics

Measurements of the object detector’s performance on the validation data set.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software