<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLObjectDetector/DataSource/directoryWithImages(at:annotationFile:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML16MLObjectDetectorV10DataSourceO19directoryWithImagesyAE10Foundation3URLV_AItcAEmF"
  },
  "title" : "MLObjectDetector.DataSource.directoryWithImages(at:annotationFile:)"
}
-->

# MLObjectDetector.DataSource.directoryWithImages(at:annotationFile:)

An object-detector data source you create by selecting the location of a directory of image files, and the
location of a JSON annotation file.

```
case directoryWithImages(at: URL, annotationFile: URL)
```

## Parameters

`directoryWithImages`

The location of a directory that contains image files.

`annotationFile`

The location of a JSON file with object annotations for the images.

---

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)