Created
March 5, 2019 04:41
-
-
Save jamesonthecrow/a103af3bd258689d57e1a4d3d4146713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PUT A BREAKPOINT HERE | |
// Compile the model. | |
let compiledModelURL = try! MLModel.compileModel(at: assetPath!) | |
// Initialize the model for use on a specific set of hardware | |
let config = MLModelConfiguration() | |
config.computeUnits = .all // can be .all, .cpuAndGPU, or .cpuOnly | |
let mlmodel = try! MLModel(contentsOf: compiledModelURL, configuration: config) | |
// Create a feature provider specific to your own model. | |
let inputFeatureProvider = // … You'll need to write some code here | |
// Run the model. | |
let result = try! model.prediction(from: inputFeatureProvider) | |
// PUT ANOTHER BREAKPOINT HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment