diff --git a/docs/add_new_node.gif b/docs/add_new_node.gif new file mode 100644 index 0000000..6808566 Binary files /dev/null and b/docs/add_new_node.gif differ diff --git a/docs/buttons.png b/docs/buttons.png deleted file mode 100644 index efca253..0000000 Binary files a/docs/buttons.png and /dev/null differ diff --git a/docs/change_attr.gif b/docs/change_attr.gif new file mode 100644 index 0000000..05ade18 Binary files /dev/null and b/docs/change_attr.gif differ diff --git a/docs/delete_node.gif b/docs/delete_node.gif new file mode 100644 index 0000000..ff8f6ce Binary files /dev/null and b/docs/delete_node.gif differ diff --git a/docs/node_prop_buttos.png b/docs/node_prop_buttos.png deleted file mode 100644 index c0bf091..0000000 Binary files a/docs/node_prop_buttos.png and /dev/null differ diff --git a/docs/onnx_modifier_delete.png b/docs/onnx_modifier_delete.png deleted file mode 100644 index ae26982..0000000 Binary files a/docs/onnx_modifier_delete.png and /dev/null differ diff --git a/docs/rename_io.gif b/docs/rename_io.gif new file mode 100644 index 0000000..81aaeac Binary files /dev/null and b/docs/rename_io.gif differ diff --git a/docs/rename_node_io.png b/docs/rename_node_io.png deleted file mode 100644 index a5f6d1b..0000000 Binary files a/docs/rename_node_io.png and /dev/null differ diff --git a/docs/top_left_buttons.png b/docs/top_left_buttons.png deleted file mode 100644 index 7a0bcc7..0000000 Binary files a/docs/top_left_buttons.png and /dev/null differ diff --git a/onnx_modifier.py b/onnx_modifier.py index d08c110..8c50f75 100644 --- a/onnx_modifier.py +++ b/onnx_modifier.py @@ -139,8 +139,8 @@ class onnxModifier: def modify(self, modify_info): # print(modify_info['node_states']) - # print(modify_info['node_renamed_io']) - print(modify_info['node_changed_attr']) + print(modify_info['node_renamed_io']) + # print(modify_info['node_changed_attr']) # print(modify_info['added_node_info']) self.remove_node_by_node_states(modify_info['node_states']) self.modify_node_io_name(modify_info['node_renamed_io']) diff --git a/readme.md b/readme.md index 28fb59c..2dbf9d8 100644 --- a/readme.md +++ b/readme.md @@ -48,18 +48,10 @@ Click the url in the output info generated by flask (`http://127.0.0.1:5000/` fo Click `Open Model...` to upload the ONNX model to edit. The model will be parsed and shown on the page. # Usage - -
top left buttons (Graph-level-operations) |
- sidebar buttons (Node-level-operations) |
-
+The following figure shows a typical deleting process:
+
## Rename the name of node inputs/outputs
@@ -95,13 +85,15 @@ For example, Now we want remove the preprocess operators (`Sub->Mul->Sub->Trans
> Note: To link node $A$ (`data_0` in the above example) to node $B$ (the 1st `Conv` in the above example), **it is suggested to edit the input of node $B$ to the output of node `A`, rather than edit the output of node $A$ to the input of node `B`.** Because the input of $B$ can also be other node's output and unexpected result will happen.
-
+The process is shown in the following figure:
+
+
## Edit the attribute of nodes
Change the original attribute to a new value, then we are done.
-
+
## Add new node
Sometimes we want to add new nodes into the exsited model. `onnx-modifier` supports this feature experimentally now.
@@ -112,9 +104,11 @@ Note there is an `Add node` button, following with a selector elements on the to
2. Click the new node and edit it in the invoked siderbar. What we need to fill are the node Attributes (`undefined` by default) and its Inputs/Outputs (which decide where the node will be inserted in the graph).
3. We are done.
+
+
The following are some notes for this feature:
-1. :warning: Currently, adding nodes with initializer (such as weight parameters) are not supported (such as `Conv`, `BatchNormalization`). Adding nodes without initializer are tested and work as expected in my tested case (such as `Flatten`, `ArgMax`, `Concat`).
+1. :warning: Currently, adding nodes with initializer (such as weight parameters) is not supported (such as `Conv`, `BatchNormalization`). Adding nodes without initializer are tested and work as expected in my tested case (such as `Flatten`, `ArgMax`, `Concat`).
2. Click the selector and type the first letter for the new node type (`f` for `Flatten` node for example), we can be quickly navigated to the node type.