Skip to content

Instantly share code, notes, and snippets.

@ozgurshn
Created June 2, 2020 07:58
Show Gist options
  • Save ozgurshn/eeed0c9a5e29cc889cde41080b668f33 to your computer and use it in GitHub Desktop.
Save ozgurshn/eeed0c9a5e29cc889cde41080b668f33 to your computer and use it in GitHub Desktop.
Playground Core ML model loading
/// URL of model assuming it was installed in the same bundle as this class
// class var urlOfModelInThisBundle : URL {
// let bundle = Bundle(for: ObjectDetectionAccurate.self)
// return bundle.url(forResource: "ObjectDetectionAccurate", withExtension:"mlmodelc")!
// }
class var urlOfModelInThisBundle: URL {
return try! MLModel.compileModel(at: URL(fileURLWithPath:"/Users/ozgur/Library/Autosave Information/ThermDetector.playground/Resources/ObjectDetectionAccurate.mlmodel"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment