ONE-vscode icon indicating copy to clipboard operation
ONE-vscode copied to clipboard

[Circle Editor] Plans for new Circle Editor feature

Open yoojincha opened this issue 2 years ago • 3 comments

[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:

  1. Pencil icon pencil icon

  2. VS Code style button bluebutton

yoojincha avatar Sep 14 '22 07:09 yoojincha

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!

llFreetimell avatar Sep 30 '22 12:09 llFreetimell

[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:

  1. 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.
  1. 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.
  1. 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
  1. CircleEditorProvider
  • Creates document and webview
  • Deliever message from webview to appropriate function in CircleEditorDocument

YuyeonHan avatar Sep 30 '22 13:09 YuyeonHan

[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

  1. 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
  1. 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
  1. CircleEditorException.ts
  • Custom Exception for circle editor
  1. MessageType.ts
  • Custom message types to communicate with vscode and webviews

src/Utils

  1. Dispose.ts
  • Register disposable events and release them all at once.

TODO

  1. 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

YuyeonHan avatar Oct 04 '22 15:10 YuyeonHan