After building the container, we run onnx-modifier by mapping docker port and a local folder `modified_onnx`
```bash
mkdir -p modified_onnx
docker run -d -t \
--name onnx-modifier \
-u $(id -u ${USER}):$(id -g ${USER}) \
-v $(pwd)/modified_onnx:/modified_onnx \
-p 5000:5000 \
onnx-modifier
```
Then we have access to onnx-modifer from URL <http://127.0.0.1:5000>. The modified ONNX models are expected to be found inside the local folder `modified_onnx`.
# Usage
Graph-level-operation elements are placed on the left-top of the page. Currently, there are four buttons: `Refresh`, `Reset`, `Download` and `Add node`. They can do:
- `Refresh`: Refresh the model graph to preview editing effects.
> In this version, the model graph is refreshed automatically as soon as an editing operation is invoked. So this button can be used much fewer than earlier versions.
- `Reset`: Reset the whole model graph to its initial state;
- `Download`: Save the modified model into disk.
- `Add node`: Add a new node into the model.
Node-level-operation elements are all in the sidebar, which can be invoked by clicking a specific node.
Node-level-operation elements are all in the sidebar, which can be invoked by clicking a specific node.
Let's take a closer look.
@ -109,7 +133,7 @@ Change the original attribute to a new value, then we are done.
Sometimes we want to add new nodes into the existed model. `onnx-modifier` supports this feature experimentally now.
Sometimes we want to add new nodes into the existed model. `onnx-modifier` supports this feature experimentally now.
Note there is an `Add node` button, following with a selector elements on the top-left of the index page. To do this, what we need to do is as easy as 3 steps: