Contents

MLImageConstraint

The width, height, and pixel format constraints of an image feature.

Declaration

class MLImageConstraint

Overview

In CoreML, an image is a collection of pixels represented by CVPixelBuffer (Swift) or CVPixelBuffer (Objective-C). An image feature is a model input or output that accepts or produces, respectively, an image bundled in an MLFeatureValue. MLImageConstraint defines the image feature’s limitations for the images within an MLFeatureValue.

If a model has an image feature for an input or output, the model author uses an image feature description by creating an MLFeatureDescription. The feature description for an image input or output has:

Image features that support additional image sizes provide a range of sizes, or a list of discrete sizes, in their image constraint’s sizeConstraint property.

Topics

Accessing the constraints

Inspecting acceptable sizes

Initializers

See Also

Creating image feature values