Module: onnx_utils
generate_dummy_input(model_path)
Generate dummy input for an ONNX model, read the input shape from the model and generate random input data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_path |
Path
|
Path to the ONNX model |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ONNXInput |
ONNXInput
|
Dictionary containing dummy input for the model. Keys are the input names and values are the dummy input data. |
Source code in src/infernet_ml/utils/onnx_utils.py
get_onnx_input_names(onnx_file_path)
Get the input names of an ONNX model, from the model file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
onnx_file_path |
Path
|
Path to the ONNX model file |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List of input names |
Source code in src/infernet_ml/utils/onnx_utils.py
get_onnx_output_names(onnx_file_path)
Get the output names of an ONNX model, from the model file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
onnx_file_path |
Path
|
Path to the ONNX model file |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List of output names |