runModelInference

fun runModelInference(modelName: String, modelType: Pipeline.ModelInferenceType, modelBinary: SharedMemory, inputs: Array<Pipeline.ModelNodeEncoding>, outputs: Array<Pipeline.ModelNodeEncoding>)

Run the inference of an algorithm model provided in binary package.

This API supports both QNN context binaries and TensorFlow Lite FlatBuffer models. The binary format stored in modelBinary must match the selected modelType:

Existing calls that use ModelInferenceType.QNN_HTP keep their original behavior and do not require any code changes.

Parameters

modelName

the name tag for the algorithm binary package.

modelType

the type of the algorithm model.

modelBinary

the shared memory which stored the algorithm binary package. The binary package's format must match the modelType.

inputs

the descriptions and tensor association of inputs to the selected model when it is executed. You can use this array to select which computation graph nodes will accept data from pipeline tensors.

outputs

the descriptions and tensor association of outputs from the selected model after execution. You can use this array to select from which computation graph nodes you would like to read values into pipeline tensors.