This sub project is to benchmark and compare ONNX.js peformance vs other leading in-browser AI Inference frameworks.
- TensorFlow.js
- Keras.js
- WebDNN
- ONNX.js
(not all backends supported by all platforms)
- WebGL
- WebAssembly
- CPU
(not all framework/backend combinations are supported by all browsers)
- Chrome (WebGL 2)
- Edge (WebGL 1)
Please download all the sub-folders (containing the model files and corresponding test data) under https://github.com/Microsoft/onnxjs-demo/tree/data/data/benchmark and place them in ./benchmark/data prior to running the benchmark tests
- Ensure that the ONNX.js project (the parent) is already installed and built:
npm ci
npm run build
- Change to
benchmark
subfolder and run npm ci and build in the benchmark folder
cd benchmark
npm install
npm run build
- Run tests (Chrome)
npm run test
- Run tests (Edge)
Note that the Edge tests are likely to crash the broswer. A recommended way would be to comment out
all Frameworks and backends except one and repeat this for all others. Look in the definition for
BenchmarkImageNetData
in src/index.js
npm run test-edge