Creates a model container to be used with VNCore
based on a Core ML model, with an optional completion handler.
SDKs
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 11.0+
Framework
- Vision
Declaration
- (instancetype)initWithModel:(VNCore MLModel *)model completionHandler:(VNRequest Completion Handler)completionHandler;
Parameters
model
The Core ML model on which to base the Vision request.
completionHandler
An optional block of code to execute after model initialization.
Discussion
Initialization can fail if the model isn't supported in Vision. For example, Core ML models that don't accept an image as input will fail.