<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLObjectDetectorMetrics",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML23MLObjectDetectorMetricsV"
  },
  "title" : "MLObjectDetectorMetrics"
}
-->

# MLObjectDetectorMetrics

Metrics you use to evaluate an object detector’s performance.

```
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:meanAveragePrecision:)`](/documentation/CreateML/MLObjectDetectorMetrics/init(averagePrecision:meanAveragePrecision:))

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

### Assessing the model

[`averagePrecision`](/documentation/CreateML/MLObjectDetectorMetrics/averagePrecision)

Two dictionaries of average precisions at different thresholds.

[`meanAveragePrecision`](/documentation/CreateML/MLObjectDetectorMetrics/meanAveragePrecision)

Two mean-average precisions at different thresholds.

### Handling errors

[`isValid`](/documentation/CreateML/MLObjectDetectorMetrics/isValid)

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

[`error`](/documentation/CreateML/MLObjectDetectorMetrics/error)

The underlying error present when the metrics are invalid.

### Describing metrics

[`description`](/documentation/CreateML/MLObjectDetectorMetrics/description)

A text representation of the object detector metrics.

[`debugDescription`](/documentation/CreateML/MLObjectDetectorMetrics/debugDescription)

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

[`playgroundDescription`](/documentation/CreateML/MLObjectDetectorMetrics/playgroundDescription)

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)