Here is a very basic example: GitHub - Jonathhhan/ofEmscriptenOnnx
It could be better automated, but this way it is possible to load .onnx models into OF Emscripten.
Onnx runtime also uses webAssembly, so two wasm Modules are “connected”.
https://onnx.handmadeproductions.de/
Here is a much simpler approach: GitHub - Jonathhhan/ofEmscriptenOnnx2
Just add main.js
with --pre-js
to config.emscripten.default.mk
and <script src="https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js"></script>
to template.html
.
It is possible to switch different backends with: {executionProviders: ["wasm"] }
in main.js
.
Tested options are wasm
, cpu
(seems to be the same as wasm
…) and webgl
.