Class

VNCoreMLModel

A container for a Core ML model used with Vision requests.

Declaration

class VNCoreMLModel : NSObject

Overview

A Core ML model encapsulates the information trained from a data set used to drive Vision recognition requests. See Getting a Core ML Model for instructions on training your own. Once you have the trained model, use this class to initialize a VNCoreMLRequest for identification.

Topics

Initializing a Model

init(for: MLModel)

Creates a model container to be used with VNCoreMLRequest.

Providing Features

var featureProvider: MLFeatureProvider?

An optional object to support inputs outside Vision.

var inputImageFeatureName: String

The name of the MLFeatureValue that Vision sets from the request handler.

Relationships

Inherits From

Conforms To

See Also

Initializing with a Core ML Model

init(model: VNCoreMLModel)

Creates a model container to be used with VNCoreMLRequest based on a Core ML model.

init(model: VNCoreMLModel, completionHandler: VNRequestCompletionHandler?)

Creates a model container to be used with VNCoreMLRequest based on a Core ML model, with an optional completion handler.

var model: VNCoreMLModel

The Core ML model on which the request is based, wrapped in a VNCoreMLModel.