EVB inference engine backend
This backend leverages Ambiq SoCs to run inference on the edge.
The model, inputs, and outputs are sent to the EVB using eRPC.
By default, the backend will scan serial ports looking for the EVB.
Therefore, the EVB must be connected and running prior to using this backend.
Parameters
Parameters of EvbBackend| Name | Type | Default | Description |
|---|
params | HKTaskParams | Required | Task parameters |
|---|
Open connection to EVB
The following steps are performed:
- Scan serial ports for EVB
- Connect to EVB
- Send model to EVB via eRPC
Close connection to EVB
This method will close the connection to the EVB.
Send model to EVB
This method sends the model to the EVB using eRPC. The TFLite flatbuffer will be read from disk
and sent to the EVB.
set_inputs(inputs: npt.NDArray)
Set inputs for inference
The inputs are flattened and sent to the EVB using eRPC.
Parameters
Parameters of set_inputs| Name | Type | Default | Description |
|---|
inputs | npt.NDArray | Required | Inputs for inference |
|---|
Perform inference
This method sends the inference command to the EVB and waits for the inference to complete.
get_outputs() -> npt.NDArray
Get outputs from inference
The outputs are fetched from the EVB and converted to a numpy array.
Returns
Returns of get_outputs| Type | Description |
|---|
npt.NDArray | npt.NDArray: Outputs from inference |