<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ObjectDetectionAnnotation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents25ObjectDetectionAnnotationV"
  },
  "title" : "ObjectDetectionAnnotation"
}
-->

# ObjectDetectionAnnotation

An object detection annotation.

```
struct ObjectDetectionAnnotation<Label> where Label : Comparable, Label : Decodable, Label : Encodable, Label : Hashable
```

## Overview

The annotation consists of a list of bounding boxes and object labels for each image.

## Topics

### Getting the properties

[`let imageFileName: String`](/documentation/CreateMLComponents/ObjectDetectionAnnotation/imageFileName)

The name of the image file.

[`let objects: [ObjectDetectionAnnotation<Label>.Annotation]`](/documentation/CreateMLComponents/ObjectDetectionAnnotation/objects)

The list of object annotations in the image.

[`struct Annotation`](/documentation/CreateMLComponents/ObjectDetectionAnnotation/Annotation)

The annotation represented by an object label and its bounding box.

[`let prominentObject: Label`](/documentation/CreateMLComponents/ObjectDetectionAnnotation/prominentObject)

The most prominent object in the image.

### Encoding and decoding

[`enum CodingKeys`](/documentation/CreateMLComponents/ObjectDetectionAnnotation/CodingKeys)

Coding keys for object detection annotations

### Default Implementations

[Identifiable Implementations](/documentation/CreateMLComponents/ObjectDetectionAnnotation/Identifiable-Implementations)

## Relationships

### Conforms To

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

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

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

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

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

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

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

---

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)