Skip to main content

A set of simple tools for splitting, merging, OP deletion, size compression, rewriting attributes and constants, OP generation, change opset, change to the specified input order, addition of OP, RGB to BGR conversion, change batch size, batch rename of OP, and JSON convertion for ONNX models.

Project description

simple-onnx-processing-tools

A set of simple tools for splitting, merging, OP deletion, size compression, rewriting attributes and constants, OP generation, change opset, change to the specified input order, addition of OP, RGB to BGR conversion, change batch size, batch rename of OP, and JSON convertion for ONNX models.

Downloads GitHub PyPI

1. Tools

HostPC

$ pip install -U simple-onnx-processing-tools \
&& pip install -U onnx \
&& python3 -m pip install -U onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com

Docker

$ docker run --rm -it \
-v `pwd`:/workdir \
-w /workdir \
pinto0309/simple-onnx-processing-tools:1.0.14
No. Tool Name Tags Summary
1 snc4onnx PyPIsnc Simple tool to combine(merge) onnx models. Simple Network Combine Tool for ONNX.
2 sne4onnx PyPIsne A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want. Simple Network Extraction for ONNX.
3 snd4onnx PyPIsnd Simple node deletion tool for onnx. Simple Node Deletion for ONNX.
4 scs4onnx PyPIscs A very simple tool that compresses the overall size of the ONNX model by aggregating duplicate constant values as much as possible. Simple Constant value Shrink for ONNX.
5 sog4onnx PyPIsog Simple ONNX operation generator. Simple Operation Generator for ONNX.
6 sam4onnx PyPIsam A very simple tool to rewrite parameters such as attributes and constants for OPs in ONNX models. Simple Attribute and Constant Modifier for ONNX.
7 soc4onnx PyPIsam A very simple tool that forces a change in the opset of an ONNX graph. Simple Opset Changer for ONNX.
8 scc4onnx PyPIsam Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX.
9 sna4onnx PyPIsog Simple node addition tool for onnx. Simple Node Addition for ONNX.
10 sbi4onnx PyPIsbi4onnx A very simple script that only initializes the batch size of ONNX. Simple Batchsize Initialization for ONNX.
11 sor4onnx PyPIsor4onnx Simple OP Renamer for ONNX.
12 onnx2json PyPIonnx2json Exports the ONNX file to a JSON file.
13 json2onnx PyPIsog Converts a JSON file to an ONNX file.
14 components_of_onnx [WIP]PyPIsog ONNX parts yard. The various operations described in Operator Schemas are converted in advance into OP stand-alone ONNX files.

2. Very useful tools

No. Tool Name Author Tags Summary
1 OnnxGraphQt fateshelled [WIP] ONNX model visualizer. Model structure can be edited on the visualization tool.imageimage

2-1. OnnxGraphQt - [WIP] Startup Method Sample

$ xhost +local: && \
docker run -it --rm \
-v `pwd`:/home/user/workdir \
-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \
--net=host \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e DISPLAY=$DISPLAY \
--privileged \
ghcr.io/pinto0309/openvino2tensorflow:latest

$ git clone https://github.com/fateshelled/OnnxGraphQt \
&& cd OnnxGraphQt \
&& sudo python3 -m pip install -r requirements.txt -U \
&& cd ..

$ python3 OnnxGraphQt/onnxgraphqt/main.py

3. Acknowledgments

  1. https://github.com/onnx/onnx/blob/main/docs/PythonAPIOverview.md
  2. https://docs.nvidia.com/deeplearning/tensorrt/onnx-graphsurgeon/docs/index.html
  3. https://github.com/NVIDIA/TensorRT/tree/main/tools/onnx-graphsurgeon
  4. https://github.com/onnx/onnx/blob/main/docs/Operators.md

4. References

  1. https://github.com/PINTO0309/PINTO_model_zoo

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_onnx_processing_tools-1.0.14.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_onnx_processing_tools-1.0.14-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file simple_onnx_processing_tools-1.0.14.tar.gz.

File metadata

File hashes

Hashes for simple_onnx_processing_tools-1.0.14.tar.gz
Algorithm Hash digest
SHA256 d963b877cdb5cf5f49eea0add30056d5ef1599b168b8b947547213bdc4827c1a
MD5 8577f2f0b9008e7ac89051427839da2c
BLAKE2b-256 4a03d4a5ee0f2d05e0b51c7797809cf7a2bf571b73fe883cd3784c866c56efa6

See more details on using hashes here.

File details

Details for the file simple_onnx_processing_tools-1.0.14-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_onnx_processing_tools-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7007b686fac77a61898e3e3b931d34a1c02a54ea28c8153c0c3bb01f40ab20d3
MD5 68f31daed90c8a9684987bd079123e43
BLAKE2b-256 12a1c9c3ea83d42bbda0931e723766f5c91f619751b0d934e3f566c4f756c260

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page