<!--
{
  "availability" : [
    "macOS: 10.15.0 - 13.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLObjectDetector/init(trainingData:imageColumn:annotationColumn:annotationType:parameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML16MLObjectDetectorV12trainingData11imageColumn010annotationH00I4Type10parametersAcA11MLDataTableV_S2SAC010AnnotationJ0OAC15ModelParametersVtKcfc"
  },
  "title" : "init(trainingData:imageColumn:annotationColumn:annotationType:parameters:)"
}
-->

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

Creates an object detector with a data table.

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

## Parameters

`trainingData`

An [`MLDataTable`](/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 [`MLObjectDetector.ModelParameters`](/documentation/CreateML/MLObjectDetector/ModelParameters-swift.struct) instance you use to set the model
configuration settings for the training session.

## Discussion

Use this initializer to create an object detector with an [`MLDataTable`](/documentation/CreateML/MLDataTable).

---

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)