One Logo Pool Ball
CreateMLComponents · IOS API REFERENCE

MLModelImageFeatureExtractor

struct · iOS 16.0+ · SDK 27.1

struct MLModelImageFeatureExtractor

An image feature extractor provided by an MLModel.

Members (6)

init · iOS 16.0+

init

TypeScript
static initContentsOfConfigurationInputNameOutputNameContext(url: string, configuration: _CoreML_MLModelConfiguration, inputName: string, outputName: string, context?: _CoreImage_CIContext): Promise<MLModelImageFeatureExtractor>
Swift declaration
init(contentsOf url: URL, configuration: MLModelConfiguration, inputName: String = "image", outputName: String, context: CIContext = CIContext()) async throws

Creates an image feature extractor from a CoreML model URL. - Parameters: - url: URL of the .mlmodel file. - configuration: The model configuration of the CoreML model. - inputName: The name of the input which the `model` expects. - outputName: The name of the output from the `model`. - context: The Core Image context.

get · iOS 16.0+

outputName

TypeScript
get outputName(): string
Swift declaration
let outputName: String

The model's output feature name.

init · iOS 16.0+

init

TypeScript
static initModelInputNameOutputNameContext(model: _CoreML_MLModel, inputName: string, outputName: string, context?: _CoreImage_CIContext): MLModelImageFeatureExtractor
Swift declaration
init(model: MLModel, inputName: String = "image", outputName: String, context: CIContext = CIContext()) throws

Creates an image feature extractor from a CoreML model. - Parameters: - model: The CoreML model which will be used for feature extraction. - inputName: The name of the input which the `model` expects. - outputName: The name of the output from the `model`. - context: A Core Image context.

get · iOS 16.0+

model

TypeScript
get model(): _CoreML_MLModel
Swift declaration
let model: MLModel

The CoreML model with .mlmodel extension. This model should satisfy the following requirements: 1. Take in one input of type .image and its key name should be same as `inputName`. 2. Any other input should be optional. 3. Give at least one output of type .multiarray and its key name should be same as `outputName`

method · iOS 16.0+

applied

TypeScript
applied(input: _CoreImage_CIImage, eventHandler?: (((arg0: Event) => void)) | null): Promise<_CoreML_MLShapedArray<number>>
Swift declaration
func applied(to input: CIImage, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Float>

Uses the CoreML model to create image features from the input pixel buffer. - Parameters: - input: An image. - eventHandler: An event handler. - Returns: `ImageFeatures` generated by passing the `pixelBuffer` through the `model`.

get · iOS 16.0+

inputName

TypeScript
get inputName(): string
Swift declaration
let inputName: String

The model's input feature name.

Skipped declarations

No declarations were skipped in this snapshot.

All CreateMLComponents types →