<!--
{
  "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/ObjectDetectionMetrics/extractLabels(from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents22ObjectDetectionMetricsV13extractLabels4fromShyxGSayAA0cD10AnnotationVyxGG_tFZ"
  },
  "title" : "extractLabels(from:)"
}
-->

# extractLabels(from:)

Extracts all the labels from a list of annotations.

```
static func extractLabels(from annotations: [ObjectDetectionAnnotation<Label>]) -> Set<Label>
```

## Parameters

`annotations`

A list of annotations.

## Return Value

A set of all the labels present in the annotations.

---

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)