Skip to content

ONNX Script editor & visualiser running completely in the browser thanks to Pyodide and Netron

License

Notifications You must be signed in to change notification settings

josephrocca/onnxscript-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

Demo: https://josephrocca.github.io/onnxscript-editor/demo

A prototype to code up an ONNX model with ONNX Script while visualising your edits live with Netron. It runs completely in the browser - no server involved. This is thanks to Pyodide - a Python runtime compiled to wasm.

The onnxscript package is pure Python so it was easy to get working (just clone repo, install pyodide-build with pip, and then run pyodide build). Building onnx was a bit harder since it has C++ code. The build process for onnx is detailed here.

quick_demo.mp4

Changes made to Netron

A few things hackily changed to get this prototype working:

  • Replace these lines with resolve() to remove telemetry stuff.
  • Add this if(!window.___iframeExports) window.___iframeExports = {}; window.___iframeExports.open = this._open.bind(this); here.
  • Remove this line and this line - otherwise netron steals focus every time a model is visualised.
  • Remove this line.

About

ONNX Script editor & visualiser running completely in the browser thanks to Pyodide and Netron

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published