evb
Classes
RpcCommands
EvbBackend
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:
-
(paramsHKTaskParams) –Task parameters
Source code in heartkit/backends/evb.py
Functions
open
Open connection to EVB
The following steps are performed: 1. Scan serial ports for EVB 2. Connect to EVB 3. Send model to EVB via eRPC
Source code in heartkit/backends/evb.py
close
Close connection to EVB
This method will close the connection to the EVB.
send_model
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.
Source code in heartkit/backends/evb.py
set_inputs
Set inputs for inference
The inputs are flattened and sent to the EVB using eRPC.
Parameters:
-
(inputsNDArray) –Inputs for inference
Source code in heartkit/backends/evb.py
perform_inference
Perform inference
This method sends the inference command to the EVB and waits for the inference to complete.
Source code in heartkit/backends/evb.py
get_outputs
Get outputs from inference
The outputs are fetched from the EVB and converted to a numpy array.
Returns:
-
NDArray–npt.NDArray: Outputs from inference