<!--
{
  "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/DetectedObject",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents14DetectedObjectV"
  },
  "title" : "DetectedObject"
}
-->

# DetectedObject

An item in a detection result.

```
struct DetectedObject<Label> where Label : Comparable, Label : Hashable
```

## Topics

### Creating a detected object

[`init(boundingBox: CGRect, label: Label, probability: Float)`](/documentation/CreateMLComponents/DetectedObject/init(boundingBox:label:probability:))

Creates a detected object with bounding box, object label and confidence.

### Getting the properties

[`var boundingBox: CGRect`](/documentation/CreateMLComponents/DetectedObject/boundingBox)

The bounding box of the detected object.

[`var confidence: Float`](/documentation/CreateMLComponents/DetectedObject/confidence)

The detection confidence. The value will always be between 0.0 and 1.0.

[`var label: Label`](/documentation/CreateMLComponents/DetectedObject/label)

The detected object label.

## Relationships

### Conforms To

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

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

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

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

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

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

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

---

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)