---
title: "MLObjectDetector.DataSource.directoryWithImages(at:annotationFile:)"
framework: createml
role: symbol
role_heading: Case
path: "createml/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.

## Declaration

```swift
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.

## See Also

### Creating a data source

- [MLObjectDetector.DataSource.directoryWithImagesAndJsonAnnotation(at:)](createml/mlobjectdetector/datasource/directorywithimagesandjsonannotation(at:).md)
- [MLObjectDetector.DataSource.table(_:imageColumn:annotationColumn:)](createml/mlobjectdetector/datasource/table(_:imagecolumn:annotationcolumn:).md)
