Flexible Mode
Please use the hbm_infer.hbm_rpc_session_flexible module for Flexible Mode.
API Parameter Descriptions
-
Global Method:
init_serverConstructs an
HbmRpcServerobject.- Parameters
- Returns
An instance of the
HbmRpcServerobject. -
Global Method:
deinit_serverClean up the server files on the board.
- Parameters
It is necessary to explicitly call the deinit_server interface to ensure that board-side storage resources are properly released.
-
Global Method:
init_hbmConstructs an
HbmHandleobject.- Parameters
- Returns
An instance of the
HbmHandleobject. -
Global Method:
deinit_hbmClean up the board-side HBM files.
- Parameters
It is necessary to explicitly call the deinit_hbm interface to ensure that board-side storage resources are properly released.
-
HbmRpcSession Member Method:
__init__Initializes an HbmRpcSession object.
- Parameters
The compression feature is processed by software, so enabling it usually leads to increased inference latency. The optimization of the compression function primarily focuses on reducing network load and improving throughput. The compression quality depends on the internal correlation within the input and output data. It is generally not recommended to enable compression for floating-point input/output, but it may be worth enabling for image inputs or segmentation outputs.
-
HbmRpcSession Member Method:
get_model_namesGet the list of model names in the current session.
- Returns
List of model names.
-
HbmRpcSession Member Method:
get_input_infoGet model input information.
- Parameters
- Returns
A dictionary describing the model input information. For specific format details, refer to the example below:
-
HbmRpcSession Member Method:
get_output_infoGet model output information.
- Parameters
- Returns
Returns a dictionary describing the model output information , with a format consistent with the return value of
get_input_info. -
HbmRpcSession Member Method:
show_input_output_infoPrint model input and output information.
- Parameters
-
HbmRpcSession Member Method:
__call__Perform model inference.
- Parameters
- Returns
Model output, of dictionary type. The
keyis the name of the output tensor, and thevalueis the output tensor, which has the same type as the model input. -
HbmRpcSession Member Method:
close_serverShut down the server and clean up server-side resources.
It is necessary to explicitly call the close_server interface to ensure that board-side processes, storage, and other resources are properly released.
-
HbmRpcSession Member Method:
get_profileTo obtain the time statistics for each stage of inference, the
with_profileparameter must be set toTrue.- Parameters
- Returns
Timing statistics for each inference stage, in dictionary format. The reference format is as follows:
-
HbmRpcSession Member Method:
get_profile_last_frameTo obtain the time statistics for each stage of the most recent frame inference, the
with_profileparameter must be set toTrue.- Parameters
- Returns
Timing statistics for each inference stage of the most recent frame, in dictionary format. The reference format is as follows:
