<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLObjectDetector/makeTrainingSession(trainingData:annotationType:parameters:sessionParameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML16MLObjectDetectorV19makeTrainingSession12trainingData14annotationType10parameters17sessionParametersAA010MLTrainingG0CyACGAC0I6SourceO_AC010AnnotationK0OAC05ModelN0VAA0ogN0VtKFZ"
  },
  "title" : "makeTrainingSession(trainingData:annotationType:parameters:sessionParameters:)"
}
-->

# makeTrainingSession(trainingData:annotationType:parameters:sessionParameters:)

Creates an asynchronous object-detector training session.

```
static func makeTrainingSession(trainingData: MLObjectDetector.DataSource, annotationType: MLObjectDetector.AnnotationType, parameters: MLObjectDetector.ModelParameters = ModelParameters(), sessionParameters: MLTrainingSessionParameters = __Defaults.sessionParameters) throws -> MLTrainingSession<MLObjectDetector>
```

## Parameters

`trainingData`

The annotated images the task uses to train the object detector.

`annotationType`

The format type of the image annotations in the data source.

`parameters`

An [`MLObjectDetector.ModelParameters`](/documentation/CreateML/MLObjectDetector/ModelParameters-swift.struct) instance you use to set the model
configuration settings for the training session.

`sessionParameters`

An [`MLTrainingSessionParameters`](/documentation/CreateML/MLTrainingSessionParameters) instance you use to configure the training session.

## Return Value

An [`MLTrainingSession`](/documentation/CreateML/MLTrainingSession) that represents the object-detector training session.

## Discussion

Use [`resume(_:)`](/documentation/CreateML/MLObjectDetector/resume(_:)) to start the [`MLTrainingSession`](/documentation/CreateML/MLTrainingSession) instance you get from this method.

---

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)