Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Pysjtu | 37 | 6 days ago | 8 | December 21, 2020 | 1 | gpl-3.0 | HTML | |||
The Python iSJTU client for Humans. | ||||||||||
Onnx2json | 18 | 4 months ago | mit | Python | ||||||
Exports the ONNX file to a JSON file and JSON dict. | ||||||||||
Json2onnx | 13 | 9 months ago | mit | Python | ||||||
Converts a JSON file to an ONNX file. | ||||||||||
Sed4onnx | 5 | 1 | 5 months ago | 2 | May 25, 2022 | mit | Python | |||
Simple ONNX constant encoder/decoder. Since the constant values in the JSON files generated by onnx2json are Base64-encoded values, ASCII <-> Base64 conversion is required when rewriting JSON constant values. |
Exports the ONNX file to a JSON file and JSON dict. Click here for json2onnx.
PINTO0309/simple-onnx-processing-tools
### option
$ echo export PATH="~/.local/bin:$PATH" >> ~/.bashrc \
&& source ~/.bashrc
### run
$ pip install -U onnx protobuf \
&& python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com \
&& pip install -U onnx2json
PINTO0309/simple-onnx-processing-tools
usage:
onnx2json [-h]
-if INPUT_ONNX_FILE_PATH
-oj OUTPUT_JSON_PATH
[-i JSON_INDENT]
optional arguments:
-h, --help
show this help message and exit
-if INPUT_ONNX_FILE_PATH, --input_onnx_file_path INPUT_ONNX_FILE_PATH
Input ONNX model path. (*.onnx)
-oj OUTPUT_JSON_PATH, --output_json_path OUTPUT_JSON_PATH
Output JSON file path (*.json) If not specified, no JSON file is output.
-i JSON_INDENT, --json_indent JSON_INDENT
Number of indentations in JSON. (default=2)
>>> from onnx2json import convert
>>> help(convert)
Help on function convert in module onnx2json.onnx2json:
convert(
input_onnx_file_path: Union[str, NoneType] = '',
onnx_graph: Union[onnx.onnx_ml_pb2.ModelProto, NoneType] = None,
output_json_path: Union[str, NoneType] = '',
json_indent: Union[int, NoneType] = 2
)
Parameters
----------
input_onnx_file_path: Optional[str]
Input onnx file path.
Either input_onnx_file_path or onnx_graph must be specified.
Default: ''
onnx_graph: Optional[onnx.ModelProto]
onnx.ModelProto.
Either input_onnx_file_path or onnx_graph must be specified.
onnx_graph If specified, ignore input_onnx_file_path and process onnx_graph.
output_json_path: Optional[str]
Output JSON file path (*.json) If not specified, no JSON file is output.
Default: ''
json_indent: Optional[int]
Number of indentations in JSON.
Default: 2
Returns
-------
onnx_json: dict
Converted JSON dict.
$ onnx2json \
--input_onnx_file_path NonMaxSuppression.onnx \
--output_json_path NonMaxSuppression.json \
--json_indent 2
from onnx2json import convert
onnx_json = convert(
input_onnx_file_path="NonMaxSuppression.onnx",
output_json_path="NonMaxSuppression.json",
json_indent=2,
)
# or
onnx_json = convert(
onnx_graph=graph,
)
https://github.com/PINTO0309/simple-onnx-processing-tools/issues