diff --git a/README.md b/README.md index c027162..581ba71 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,8 @@ structure_check( │ Model Size │ 37.2MiB │ └────────────────────────┴────────────┘ INFO: file: deqflow_b_things_opset12_192x320.onnx +INFO: producer: pytorch 1.11.0 +INFO: opset: 12 INFO: input_name.1: input1 shape: [1, 3, 192, 320] dtype: float32 INFO: input_name.2: input2 shape: [1, 3, 192, 320] dtype: float32 INFO: output_name.1: flow_up shape: [1, 2, 192, 320] dtype: float32 diff --git a/ssc4onnx/__init__.py b/ssc4onnx/__init__.py index b776be9..168153e 100644 --- a/ssc4onnx/__init__.py +++ b/ssc4onnx/__init__.py @@ -1,3 +1,3 @@ from ssc4onnx.onnx_structure_check import structure_check, main -__version__ = '1.0.1' +__version__ = '1.0.2' diff --git a/ssc4onnx/onnx_structure_check.py b/ssc4onnx/onnx_structure_check.py index 28a4ae0..c0b2c88 100644 --- a/ssc4onnx/onnx_structure_check.py +++ b/ssc4onnx/onnx_structure_check.py @@ -143,6 +143,22 @@ def structure_check( f'{Color.GREEN}INFO:{Color.RESET} '+ \ f'{Color.BLUE}file:{Color.RESET} {input_onnx_file_path}' ) + producer_name = '' + if hasattr(onnx_graph, 'producer_name'): + producer_name = onnx_graph.producer_name + producer_version = '' + if hasattr(onnx_graph, 'producer_version'): + producer_version = onnx_graph.producer_version + if producer_name: + print(\ + f'{Color.GREEN}INFO:{Color.RESET} '+ \ + f'{Color.BLUE}producer:{Color.RESET} {producer_name} {producer_version}' + ) + if hasattr(onnx_graph, 'opset_import') and len(onnx_graph.opset_import) > 0: + print(\ + f'{Color.GREEN}INFO:{Color.RESET} '+ \ + f'{Color.BLUE}opset:{Color.RESET} {onnx_graph.opset_import[0].version}' + ) for idx, ort_input_name, ort_input_shape, onnx_input_type in zip(range(1, len(ort_input_names)+1), ort_input_names, ort_input_shapes, onnx_input_types): print(\ f'{Color.GREEN}INFO:{Color.RESET} '+ \