<!--
{
  "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/MLHandActionClassifier/DataSource",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML22MLHandActionClassifierV10DataSourceO"
  },
  "title" : "MLHandActionClassifier.DataSource"
}
-->

# MLHandActionClassifier.DataSource

A hand action classifier dataset that contains annotated videos or hand joint location data.

```
enum DataSource
```

## Topics

### Creating a data source

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

Creates a data source from a folder with subfolders that each contain videos of a hand action.

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

Creates a data source from a folder that contains videos, each named after the hand action they represent.

[`case directoryWithVideosAndAnnotation(at: URL, annotationFile: URL, videoColumn: String, labelColumn: String, startTimeColumn: String?, endTimeColumn: String?)`](/documentation/CreateML/MLHandActionClassifier/DataSource/directoryWithVideosAndAnnotation(at:annotationFile:videoColumn:labelColumn:startTimeColumn:endTimeColumn:))

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

[`case labeledVideoDataFrame(DataFrame, videoColumn: String, labelColumn: String, startTimeColumn: String?, endTimeColumn: String?)`](/documentation/CreateML/MLHandActionClassifier/DataSource/labeledVideoDataFrame(_:videoColumn:labelColumn:startTimeColumn:endTimeColumn:))

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

[`case labeledVideoData(table: MLDataTable, videoColumn: String, labelColumn: String, startTimeColumn: String?, endTimeColumn: String?)`](/documentation/CreateML/MLHandActionClassifier/DataSource/labeledVideoData(table:videoColumn:labelColumn:startTimeColumn:endTimeColumn:))

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

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

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

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

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

### Exporting a data source

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

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

[`func videosWithAnnotations() throws -> MLDataTable`](/documentation/CreateML/MLHandActionClassifier/DataSource/videosWithAnnotations())

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

[`func keypointsWithAnnotations(targetFrameRate: Double) throws -> MLDataTable`](/documentation/CreateML/MLHandActionClassifier/DataSource/keypointsWithAnnotations(targetFrameRate:))

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

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

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

[`func extractKeypoints(targetFrameRate: Double) throws -> DataFrame`](/documentation/CreateML/MLHandActionClassifier/DataSource/extractKeypoints(targetFrameRate:))

Extracts key points from video files if necessary.

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

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



---

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)