MLFeatureValue
A generic wrapper around an underlying value and the value’s type.
Declaration
class MLFeatureValueOverview
A Core ML feature value wraps an underlying value and bundles it with that value’s type, which is one of the types that MLFeatureType defines. Apps typically access feature values indirectly by using the methods in the wrapper class Xcode automatically generates for Core ML model files.
If your app accesses an MLModel directly, it must create and consume MLFeatureProvider instances. For each prediction, Core ML accepts a feature provider for its inputs, and generates a separate feature provider for its outputs. The input feature provider contains one MLFeatureValue instance per input, and the output feature provider contains one per output. See MLFeatureDescription for more information about the model input and output features.
Topics
Creating a feature value
Creating numeric feature values
Creating string feature values
Creating multidimensional feature values
Creating collection feature values
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:)MLImageConstraintMLFeatureValue.ImageOption
Creating undefined feature values
Accessing the feature’s type
Accessing the feature’s value
isUndefinedint64ValuedoubleValuestringValueimageBufferValueshapedArrayValue(of:)multiArrayValuesequenceValuedictionaryValue
Comparing feature values
Supporting types
Initializers
init(cgImage:constraint:options:)init(cgImage:orientation:constraint:options:)init(cgImage:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)init(cgImage:pixelsWide:pixelsHigh:pixelFormatType:options:)init(coder:)init(imageAt:constraint:options:)init(imageAt:orientation:constraint:options:)init(imageAt:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:)init(imageAt:pixelsWide:pixelsHigh:pixelFormatType:options:)