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.
1. Tools
HostPC
# (1) Minimum configuration installation with no dependent packages installed
$ 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
or
# (2) When installing all dependent packages such as onnx-simplifier, onnxruntime, numpy, etc...
$ pip install -U simple-onnx-processing-tools[full] \
&& 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 \
ghcr.io/pinto0309/simple-onnx-processing-tools:1.1.31
No. | Tool Name | Tags | Summary |
---|---|---|---|
1 | snc4onnx |
Simple tool to combine(merge) onnx models. Simple Network Combine Tool for ONNX. | |
2 | sne4onnx |
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 |
Simple node deletion tool for onnx. Simple Node Deletion for ONNX. | |
4 | scs4onnx |
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 |
Simple ONNX operation generator. Simple Operation Generator for ONNX. | |
6 | sam4onnx |
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 |
A very simple tool that forces a change in the opset of an ONNX graph. Simple Opset Changer for ONNX. | |
8 | scc4onnx |
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 |
Simple node addition tool for onnx. Simple Node Addition for ONNX. | |
10 | sbi4onnx |
A very simple script that only initializes the batch size of ONNX. Simple Batchsize Initialization for ONNX. | |
11 | sor4onnx |
Simple OP Renamer for ONNX. | |
12 | soa4onnx |
Simple model Output OP Additional tools for ONNX. | |
13 | sod4onnx |
Simple model Output OP Deletion tools for ONNX. | |
14 | ssi4onnx |
Simple Shape Inference tool for ONNX. | |
15 | sit4onnx |
Tools for simple inference testing using TensorRT, CUDA and OpenVINO CPU/GPU and CPU providers. Simple Inference Test for ONNX. | |
16 | onnx2json |
Exports the ONNX file to a JSON file. | |
17 | json2onnx |
Converts a JSON file to an ONNX file. | |
18 | sed4onnx |
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. | |
19 | ssc4onnx |
Checker with simple ONNX model structure. Simple Structure Checker for ONNX. Analyzes and displays the structure of huge size models that cannot be displayed by Netron. | |
20 | sio4onnx |
Simple tool to change the INPUT and OUTPUT shape of ONNX. | |
21 | svs4onnx |
A very simple tool to swap connections between output and input variables in an ONNX graph. Simple Variable Switch for ONNX. | |
22 | onnx2tf |
Self-Created Tools to convert ONNX files (NCHW) to TensorFlow format (NHWC). The purpose of this tool is to solve the massive Transpose extrapolation problem in onnx-tensorflow (onnx-tf). | |
23 | sng4onnx |
A simple tool that automatically generates and assigns an OP name to each OP in an old format ONNX file. | |
24 | sde4onnx |
Simple doc_string eraser for ONNX. | |
25 | spo4onnx |
Simple tool for partial optimization of ONNX. Further optimize some models that cannot be optimized with onnx-optimizer and onnxsim by several tens of percent. In particular, models containing Einsum and OneHot. | |
26 | components_of_onnx |
[WIP] | 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 | ONNX model visualizer. Model structure can be edited on the visualization tool. | |
2 | onnx-modifier |
ZhangGe6 | To edit an ONNX model, One common way is to visualize the model graph, and edit it using ONNX Python API. | |
3 | onnx-simplifier | daquexian | ONNX Simplifier is presented to simplify the ONNX model. It infers the whole computation graph and then replaces the redundant operators with their constant outputs. | |
4 | Sparsify |
neuralmagic | Easy-to-use UI for automatically sparsifying neural networks and creating sparsification recipes for better inference performance and a smaller footprint. | |
5 | DeepSparse Engine |
neuralmagic | Sparsity-aware neural network inference engine for GPU-class performance on CPUs. | |
6 | Sparsebit | megvii-research | Sparsebit is a toolkit with pruning and quantization capabilities. It is designed to help researchers compress and accelerate neural network models by modifying only a few codes in existing pytorch project. | |
7 | onnion | Idein | onnion project. compile onnx to python. runtime depends only numpy. |
2-1. OnnxGraphQt - [WIP] Startup Method Sample
git clone https://github.com/fateshelled/OnnxGraphQt
cd OnnxGraphQt
# build docker image
./docker/build.bash
# run
./docker/run.bash
3. Acknowledgments
- https://github.com/onnx/onnx/blob/main/docs/PythonAPIOverview.md
- https://docs.nvidia.com/deeplearning/tensorrt/onnx-graphsurgeon/docs/index.html
- https://github.com/NVIDIA/TensorRT/tree/main/tools/onnx-graphsurgeon
- https://github.com/onnx/onnx/blob/main/docs/Operators.md
4. References
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
Built Distribution
File details
Details for the file simple_onnx_processing_tools-1.1.32.tar.gz
.
File metadata
- Download URL: simple_onnx_processing_tools-1.1.32.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d1198bb79198c9d12f723f342290f48a3f71bb24f3c9a28cc7a488af81f1ede |
|
MD5 | 0a88c5e6dce98af91e8207d18faae9ab |
|
BLAKE2b-256 | dec9272e2ec4f8c3764a629a7a0fe2376d5d7727c081221e335ab96906f7a9ac |
File details
Details for the file simple_onnx_processing_tools-1.1.32-py3-none-any.whl
.
File metadata
- Download URL: simple_onnx_processing_tools-1.1.32-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af575ff69b606822d6218a6c5e2224c15b424685ce998f1e4bab38f3968ee18d |
|
MD5 | d728386ff52b1baae2103ff8836d1830 |
|
BLAKE2b-256 | 20a66df4a132bf75aec6ee9a5822b1630364e26ea9cb555173e761ac19d59a46 |