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 TensorFlow Lite FlatBuffer models. The binary format stored in modelBinary must be a TensorFlow Lite FlatBuffer model, and modelType selects the LiteRT / TFLite backend:

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 must be a TensorFlow Lite FlatBuffer model for every 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.