Creates a Core ML model object from a compiled model file.
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 11.0+
- watchOS 4.0+
- Core ML
The path to a compiled model file (ModelName
.mlmodelc), typically with the
In most cases your app won't need to create a model object directly. First consider using the wrapper class that Xcode generates automatically, as described in Add a Model to Your Xcode Project.
However, if the wrapper class doesn't meet your app's needs, then use this initializer to create a model object from any compiled model file your app has access to. Typically, you use this initializer after your app has downloaded and compiled a model, which is one technique for saving space in your app. See Downloading and Compiling a Model on the User's Device.