---
title: "init(trainingData:imageColumn:annotationColumn:annotationType:parameters:)"
framework: createml
role: symbol
role_heading: Initializer
path: "createml/mlobjectdetector/init(trainingdata:imagecolumn:annotationcolumn:annotationtype:parameters:)"
---

# init(trainingData:imageColumn:annotationColumn:annotationType:parameters:)

Creates an object detector with a data table.

## Declaration

```swift
init(trainingData: MLDataTable, imageColumn: String, annotationColumn: String, annotationType: MLObjectDetector.AnnotationType, parameters: MLObjectDetector.ModelParameters = ModelParameters()) throws
```

## Parameters

- `trainingData`: An doc://com.apple.createml/documentation/CreateML/MLDataTable that contains the annotated images the task uses to train the object detector.
- `imageColumn`: The name of the column in the data table that contains the image file URLs.
- `annotationColumn`: The name of the column in the data table that contains the image annotations.
- `annotationType`: The format your data table uses for its image annotations.
- `parameters`: An doc://com.apple.createml/documentation/CreateML/MLObjectDetector/ModelParameters-swift.struct instance you use to set the model configuration settings for the training session.

## Discussion

Discussion Use this initializer to create an object detector with an MLDataTable.

## See Also

### Training an object detector synchronously

- [init(trainingData:parameters:annotationType:)](createml/mlobjectdetector/init(trainingdata:parameters:annotationtype:).md)
