English | [简体中文](readme_zh-CN.md)
# Introduction
To edit an ONNX model, One common way is to visualize the model graph, and edit it using ONNX Python API. This works fine. However, we have to code to edit, then visualize to check. The two processes may iterate for many times, which is time-consuming. :wave:
What if we have a tool, which allow us **edit and preview the editing effect in a totally visualization fashion**?
Then `onnx-modifier` comes. With it, we can focus on editing the model graph in the visualization pannel. All the editing information will be summarized and processed by Python ONNX automatically at last. Then our time can be saved! :rocket:
`onnx-modifier` is built based on the popular network viewer [Netron](https://github.com/lutzroeder/netron) and the lightweight web application framework [flask](https://github.com/pallets/flask).
Currently, the following editing operations are supported:
- Delete a single node.
- Delete a node and all the nodes rooted on it.
- Recover a deleted node.
- Rename the input/output name of a node.
Hope it helps!
# Get started
Clone the repo and install the require Python packages by
```bash
git clone git@github.com:ZhangGe6/onnx-modifier.git
cd onnx-modifier
pip install onnx
pip install flask
```
Then run
```bash
python app.py
```
Click the url in the output info generated by flask (`http://127.0.0.1:5000/` for example), then `onnx-modifier` will be launched in the web browser.
Click `Open Model...` to upload the ONNX model to edit. The model will be parsed and shown on the page.
# Edit
top left buttons (Graph-level-operations) |
sidebar buttons (Node-level-operations) |