<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLStyleTransfer/DataSource",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML15MLStyleTransferV10DataSourceO"
  },
  "title" : "MLStyleTransfer.DataSource"
}
-->

# MLStyleTransfer.DataSource

A data source for a style transfer model.

```
enum DataSource
```

## Topics

### Creating a data source

[`case images(styleImage: URL, contentDirectory: URL, processingOption: VNImageCropAndScaleOption?)`](/documentation/CreateML/MLStyleTransfer/DataSource/images(styleImage:contentDirectory:processingOption:))

The locations of a style-image file and content-image directory in the file system.

### Stylizing images

[`func processImages(textelDensity: Int, styleImageDestination: URL?, contentImagesDestination: URL?) throws -> (processedStyleImage: URL, processedContentImages: URL)`](/documentation/CreateML/MLStyleTransfer/DataSource/processImages(textelDensity:styleImageDestination:contentImagesDestination:))

Converts the content images to square images and saves them to a destination directory.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)