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

# MLObjectDetector.ObjectAnnotation

The label, location, and confidence score of an item the object detector found in an image.

```
struct ObjectAnnotation
```

## Topics

### Creating an annotation

[`init(label: String, boundingBox: CGRect, confidence: Double)`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/init(label:boundingBox:confidence:))

Creates an annotation for an item an object detector finds in an image.

### Inspecting an annotation

[`var label: String`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/label)

The name of the item the object detector found in an image.

[`var boundingBox: CGRect`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/boundingBox)

A rectangular region that encloses an item the object detector found in the image.

[`var confidence: Double`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/confidence)

The object detector’s confidence score for its prediction’s accuracy.

### Describing an annotation

[`var description: String`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/description)

A text representation of the object annotation.

[`var debugDescription: String`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/debugDescription)

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

[`var playgroundDescription: Any`](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/playgroundDescription)

A description of the object annotation within a playground.

### Default Implementations

[CustomDebugStringConvertible Implementations](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/CustomDebugStringConvertible-Implementations)

[CustomPlaygroundDisplayConvertible Implementations](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/CustomPlaygroundDisplayConvertible-Implementations)

[CustomStringConvertible Implementations](/documentation/CreateML/MLObjectDetector/ObjectAnnotation/CustomStringConvertible-Implementations)

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomPlaygroundDisplayConvertible`](/documentation/Swift/CustomPlaygroundDisplayConvertible)

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

---

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)