ONE-vscode
ONE-vscode copied to clipboard
[Circle Editor] Plans for new Circle Editor feature
[Circle Editor] Plans for new Circle Editor feature
WHAT
We are planning to implement an editor feature to the currently embedded netron circle viewer.
WHY
There were demands for modifying data in circle file. However, it is difficult to manipulate data in circle file, which is in binary format. Therefore, we plan to increase convenience by enabling modification on the current circle viewer in GUI form.
HOW
We plan to add an edit button to the sidebar that appears when Circle graph is clicked. Our goal is to let users modify the data in Attribute/Input/Output sections by turning them into input areas when clicking the edit button.
Current Circle Viewer is set to be Read-Only, and does not allow modification. We plan to expand the existing CustomViewer, Provider, CustomDocument codes to enable data CRUD. Once the edit button is clicked on our new GUI, user input data will be transferred to our CustomEditor(updated version of the current CircleViewer) to apply the changes to the original Circle file.
Below are two designs we are considering for the edit button:
-
Pencil icon
-
VS Code style button
Test Model File
If you follow below steps, you can can inception_v3 circle model file!
- Download https://storage.googleapis.com/download.tensorflow.org/models/tflite/model_zoo/upload_20180427/inception_v3_2018_04_27.tgz and extract it. Then you can find
inception_v3.tflite
. - Download https://github.com/Samsung/ONE/releases/download/1.21.0/nncc-1.21.0.tar.gz and extract it. Then you can find
bin/tflite2circle
. - Execute
./tflite2circle inception_v3.tflite inception_v3.circle
- Open
inception_v3.circle
with the editor!
[Circle Editor] Add files for making Circle model object #1305
We have completed issue https://github.com/Samsung/ONE-vscode/issues/1269 and now ready to send pull request per each function.
These are brief explanations of the files we would like to merge:
- src/CircleEditor/circle_schema_generated.ts
- ts file auto generated with flatbuffers according to circle schema.
- Used for generating model object which is necessary for saving, editing and loading binary circle file.
- This should be updated if circle schema is modified.
- src/CircleEditor/CircleTypes.ts
- Resolved naming convention conflict with circle schema and webview
- To receive value dynamically in which cases the value is referring to enum. For instance, builtinOptionsType from operators could refer to enum BuilinOptions.
TODO
- Upload CircleEditorProvider class and CircleEditorDocument class to implement custom editor.
- CircleEditorDocument
- Manages state by maintaining modelT object as a field named _model on the document
- Load, save, revert, edit operator attribute, edit tensor, edit model through json editor
- CircleEditorProvider
- Creates document and webview
- Deliever message from webview to appropriate function in CircleEditorDocument
[Circle Editor] Add files for activating Circle custom editor
These are brief explanations of the files we would like to merge in pull request #1328
src/CircleEditor
- CircleEditorProvider.ts
- Custom editor provider that implements vscode extension API
- Creates customEditorDocument and webview
- Receives changes or messages from webview and calls appropriate function in CircleCustomDocument
- CircleEditorDocument.ts
- Custom editor document that implements vscode extension API
- Manages temporary model states opened in webviews
- Maintains _model object so that binary circle data can be computed as an object
- CircleEditorException.ts
- Custom Exception for circle editor
- MessageType.ts
- Custom message types to communicate with vscode and webviews
src/Utils
- Dispose.ts
- Register disposable events and release them all at once.
TODO
- CircleEditorDocument.ts
- Additional functions that we already completed will be requested for review.
- Functions will include
- Editing operator attributes and tensors
- Editing model through json format