Contents

init(pixelBuffer:)

Creates a feature value that contains an image from a pixel buffer.

Declaration

convenience init(pixelBuffer value: CVPixelBuffer)

Parameters

Discussion

Core ML supports different pixel format types depending on the model’s feature description. For information about ImageFeatureType, see Core ML Format Reference. When the image feature’s color space is GRAYSCALE, use kCVPixelFormatType_OneComponent8; and when it’s GRAYSCALE_FLOAT16, use kCVPixelFormatType_OneComponent16Half; otherwise, use kCVPixelFormatType_32BGRA when it’s set to RGB or BGR.

See Also

Creating image feature values