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

# MLHandPoseClassifier.DataSource

A hand pose classifier dataset that contains annotated images or hand
joint location data.

```
enum DataSource
```

## Topics

### Creating a data source

[`case labeledDirectories(at: URL)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledDirectories(at:))

Creates a data source from a folder with subfolders that each
contain images of a hand pose.

[`case labeledFiles(at: URL)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledFiles(at:))

Creates a data source from a folder that contains images, each named
after the hand pose it represents.

[`case directoryWithImagesAndAnnotation(at: URL, annotationFile: URL, imageColumn: String, labelColumn: String)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/directoryWithImagesAndAnnotation(at:annotationFile:imageColumn:labelColumn:))

Creates a data source from a folder that contains images and an
annotation file.

[`case labeledImageDataFrame(DataFrame, imageColumn: String, labelColumn: String)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledImageDataFrame(_:imageColumn:labelColumn:))

Creates a data source from a data frame that contains the location
and annotation for a set of image files.

[`case labeledKeypointsDataFrame(DataFrame, sessionIdColumn: String, labelColumn: String, featureColumn: String)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledKeypointsDataFrame(_:sessionIdColumn:labelColumn:featureColumn:))

Creates a data source from a data frame of hand pose observations
that each contain the locations of each hand joint and an
annotation.

[`case labeledImageData(table: MLDataTable, imageColumn: String, labelColumn: String)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledImageData(table:imageColumn:labelColumn:))

Creates a data source from a data table that contains the hand joint
locations and annotation for a set of image files.

[`case labeledKeypointsData(table: MLDataTable, sessionIdColumn: String, labelColumn: String, featureColumn: String)`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledKeypointsData(table:sessionIdColumn:labelColumn:featureColumn:))

Creates a data source from a data table of hand pose observations
that each contain the locations of each hand joint and an
annotation.

### Extracting keypoints

[`func extractKeypoints() throws -> DataFrame`](/documentation/CreateML/MLHandPoseClassifier/DataSource/extractKeypoints())

Extracts key points from video files if necessary.

### Getting annotated file names

[`func gatherAnnotatedFileNames() throws -> DataFrame?`](/documentation/CreateML/MLHandPoseClassifier/DataSource/gatherAnnotatedFileNames())

Processes the data source and returns a data frame that contains file URLs and annotations.

### Exporting a data source

[`func labeledMedia() throws -> [String : [URL]]`](/documentation/CreateML/MLHandPoseClassifier/DataSource/labeledMedia())

Generates a dictionary that contains the data source’s classification
labels paired with an array of URLs to the label’s image files.

[`func imagesWithAnnotations() throws -> MLDataTable`](/documentation/CreateML/MLHandPoseClassifier/DataSource/imagesWithAnnotations())

Generates a data table that contains a column for the data source’s
image file URLs and a column of annotations.

[`func keypointsWithAnnotations() throws -> MLDataTable`](/documentation/CreateML/MLHandPoseClassifier/DataSource/keypointsWithAnnotations())

Generates a data table that contains a column for hand joint
locations and hand pose annotations.

[`func stratifiedSplit(proportions: [Double], seed: Int, labelColumn: String) throws -> MLDataTable`](/documentation/CreateML/MLHandPoseClassifier/DataSource/stratifiedSplit(proportions:seed:labelColumn:))

Generates a data table by splitting the data source into strata.



---

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)