MNist Online

Here is a small demo MNIST classifier built with WebAssembly using the Raylib and ONNXRuntime libraries. On the canvas below, you can draw a number. A neural net will then run in your browser to determine which number it is (0 through 9). The red bars will indicate the likelyhood of each number as you draw on the canvas.

This demo is entirely created in C++ and served statically from github. The technolgies used here are essentially raylib (for drawing stuff) and ONNXRuntime (for running neural networks). To load the model at runtime, we use xxd to convert the .onnx file to a C file, and consequently add it to the binary. These two technolgies are quite nice for this task as the authors have kindly provided easy ways to cross compile them. In my view it nicely showcases what’s possible with WASM! We live in exciting times.

Note that on slower network connections it may not load immediately!