Welcome to ONNX.js Examples section
The following examples are to demonstrate how to run ONNX.js
in browser using HTTP server. Details are provided with their corresponding README files:
-
Add (./browser/add) Simple example which adds two Tensors and validates the result.
-
Resnet50 (./browser/resnet50) Loads and runs a Resnet50 Model, which is a highly accurate image classification model train on ImageNet.
-
Squeezenet (./browser/squeezenet) Loads and runs a Squeezenet Model, which is a highly efficient image classification model trained on ImageNet.
The following example shows how to run ONNX.js
using node
. Further details are provided with its README file:
- Add (./node/add) Simple example which adds two Tensors and validates the result.
This file should be available to the browser whenever the usage of WebAssembly backend is desired. It is suggested to place this file1 in the same path containing the .html file
This file should be available to the browser whenever the usage of WebAssembly backend with Web Workers is desired. It is suggested to place this file1 in the same path containing the .html file
1 - There are several ways to get this file:
- The file can be found at https://cdn.jsdelivr.net/npm/onnxjs/dist/
- If consuming the module though NPM, this file can be found at
node_modules/onnxjs/dist
- By building the source code - after running
npm run build
, this file will be found in thedist
folder of the repo