Contents

init(for:)

Creates a model container to use with a Core ML request.

Declaration

convenience init(for model: MLModel) throws

Parameters

  • model:

    The model to create the model container from.

Discussion

This method may fail if the framework doesn’t support the Core ML model. For example, a model that doesn’t accept an image as any of its inputs will yield an VNErrorCode.invalidModel error.