This repo is a quick demonstration to run ONNX Runtime Web in the browser using a bundler. Since ONNX uses WebAssembly, it is neccesary to set up a custom webpack configuration.
git clone [email protected]:sahirgomez1/react-onnxruntime.git
Install all dependencies from the project root folder.
npm install
To compile the bundle run.
npm run build
This creates a dist
folder with a bundle.min.js
file, which containes all dependencies bundled and minified by webpack.
Make sure there is a script tag as the following <script src="./dist/bundle.min.js"></script>
inside the index.html
file.
Finally, to start the devServer run.
npm start
open your browser and navigate to the URL http://localhost:9000
.