get_onnx_input_infos
get_onnx_input_infos(model: str | Path | onnx.ModelProto) -> dict[str, dict[str, Any]]
-
Description: Returns input shape and dtype info of an ONNX model.
-
Dependencies
- Requires
onnx.
- Requires
-
Return format
- Returns
{input_name: {"shape": [...], "dtype": np.dtype}}. - Shape dims may be represented differently depending on the source:
- When
dim_paramis present: returns a string (e.g."batch"). - When
dim_value == 0or unknown: returns-1.
- When
- Returns
-
Example
from capybara.onnxengine import get_onnx_input_infos
infos = get_onnx_input_infos("model.onnx")
print(infos)