<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLObjectDetector/ObjectAnnotation/init(label:boundingBox:confidence:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML16MLObjectDetectorV16ObjectAnnotationV5label11boundingBox10confidenceAESS_So6CGRectVSdtcfc"
  },
  "title" : "init(label:boundingBox:confidence:)"
}
-->

# init(label:boundingBox:confidence:)

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

```
init(label: String, boundingBox: CGRect, confidence: Double)
```

## Parameters

`label`

The name of the item.

`boundingBox`

The location of the item in an image.

`confidence`

The confidence score of the item in the image. The value must be in the range `[0.0, 1.0]`,
where `1.0` is the most confident.

## Discussion

Don’t use this initializer to create an object annotation yourself. The object detector uses it to
create object annotations when it makes predictions on your images, such as when you use
[`prediction(from:)`](/documentation/CreateML/MLObjectDetector/prediction(from:)).

---

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)