MLImageConstraint
The width, height, and pixel format constraints of an image feature.
Declaration
class MLImageConstraintOverview
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:
Its type property set to MLFeatureType.image
Its imageConstraint property set to an MLImageConstraint instance configured to the image feature’s size and format
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
init(pixelBuffer:)init(CGImage:pixelsWide:pixelsHigh:pixelFormatType:options:)init(CGImage:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)init(CGImage:constraint:options:)init(CGImage:orientation:constraint:options:)init(imageAtURL:pixelsWide:pixelsHigh:pixelFormatType:options:)init(imageAtURL:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)init(imageAtURL:constraint:options:)init(imageAtURL:orientation:constraint:options:)MLFeatureValue.ImageOption