`dfx new --type=rust` + burn-rs MNIST web inference example

Overview

ic-mnist

  1. The frontend provides a canvas where users can draw a digit.
  2. The drawn digit is then sent to the backend canister running burn-rs for inference using a pretrained MNIST model.
  3. The backend performs the inference and returns the predicted digit to the frontend.

Installation

To set up the project, follow these steps: 0. Have Rust and Nodejs installed.

  1. Installl IC-SDK (building from master branch because we need gzip feature which is not available in the latest release)
git clone https://github.com/dfinity/sdk.git ./ic-sdk
cargo build --manifest-path=ic-sdk/Cargo.toml -p dfx
  1. Clone and deploy this project
git clone https://github.com/smallstepman/ic-mnist.git ./ic-mnist
cd ic-mnist
../ic-sdk/target/debug/dfx start --background --clean
../ic-sdk/target/debug/dfx deploy

License

The code in this repository is licensed under the MIT License.

Acknowledgements

Based on burn (https://burn-rs.github.io), backend and frontend implementation copied from this example https://github.com/burn-rs/burn/tree/main/examples/mnist-inference-web,

You might also like...
Simple type-safe relational algebra evaluator built entirely in Rust

ra-evaluator A simple type-safe relational algebra evaluator. Relational algebra provides the theoretical foundation for relational databases and the

A lesson in Humility - or how a boy teaches himself a new programming language.

Learning Rust - A Lesson in Humility J. M. Barrie - Author of Peter Pan Life is a long lesson in humility... and so is learning Rust. I tried to teach

A linear algebra library with excellent type safety

Static L.A. (Linear Algebra) A fast minimal ultra type safe linear algebra library. While ndarray offers no compile time type checking on dimensionali

🦀 Example of serving deep learning models in Rust with batched prediction
🦀 Example of serving deep learning models in Rust with batched prediction

rust-dl-webserver This project provides an example of serving a deep learning model with batched prediction using Rust. In particular it runs a GPT2 m

Example of Rust API for Machine Learning

rust-machine-learning-api-example Example of Rust API for Machine Learning API example that uses resnet224 to infer images received in base64 and retu

Docker for PyTorch rust bindings `tch`. Example of pretrain model.

tch-rs-pretrain-example-docker Docker for PyTorch rust bindings tch-rs. Example of pretrain model. Docker files support the following install libtorch

Proof of concept for a web API that can export 3MF files from parametric OpenSCAD models

Model API About A proof of concept for a web API that can export 3MF files from a parametric OpenSCAD model. A typical use would be to have a form on

Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Owner
Marcin Nowak-Liebiediew
Marcin Nowak-Liebiediew
A Rust library with homemade machine learning models to classify the MNIST dataset. Built in an attempt to get familiar with advanced Rust concepts.

mnist-classifier Ideas UPDATED: Finish CLI Flags Parallelize conputationally intensive functions Class-based naive bayes README Image parsing Confusio

Neil Kaushikkar 0 Sep 2, 2021
Using OpenAI Codex's "davinci-edit" Model for Gradual Type Inference

OpenTau: Using OpenAI Codex for Gradual Type Inference Current implementation is focused on TypeScript Python implementation comes next Requirements r

Gamma Tau 11 Dec 18, 2022
Wonnx - a GPU-accelerated ONNX inference run-time written 100% in Rust, ready for the web

Wonnx is a GPU-accelerated ONNX inference run-time written 100% in Rust, ready for the web. Supported Platforms (enabled by wgpu) API Windows Linux &

WebONNX 354 Jan 6, 2023
Stable Diffusion v1.4 ported to Rust's burn framework

Stable-Diffusion-Burn Stable-Diffusion-Burn is a Rust-based project which ports the V1 stable diffusion model into the deep learning framework, Burn.

null 156 Aug 8, 2023
Stable Diffusion XL ported to Rust's burn framework

Stable-Diffusion-XL-Burn Stable-Diffusion-XL-Burn is a Rust-based project which ports stable diffusion xl into the Rust deep learning framework burn.

null 194 Sep 4, 2023
pyke Diffusers is a modular Rust library for optimized Stable Diffusion inference 🔮

pyke Diffusers is a modular Rust library for pretrained diffusion model inference to generate images, videos, or audio, using ONNX Runtime as a backen

pyke 12 Jan 5, 2023
Rust+OpenCL+AVX2 implementation of LLaMA inference code

RLLaMA RLLaMA is a pure Rust implementation of LLaMA large language model inference.. Supported features Uses either f16 and f32 weights. LLaMA-7B, LL

Mikko Juola 344 Apr 16, 2023
Tiny, no-nonsense, self-contained, Tensorflow and ONNX inference

Sonos' Neural Network inference engine. This project used to be called tfdeploy, or Tensorflow-deploy-rust. What ? tract is a Neural Network inference

Sonos, Inc. 1.5k Jan 8, 2023
Orkhon: ML Inference Framework and Server Runtime

Orkhon: ML Inference Framework and Server Runtime Latest Release License Build Status Downloads Gitter What is it? Orkhon is Rust framework for Machin

Theo M. Bulut 129 Dec 21, 2022
An example of using TensorFlow rust bindings to serve trained machine learning models via Actix Web

Serving TensorFlow with Actix-Web This repository gives an example of training a machine learning model using TensorFlow2.0 Keras in python, exporting

Kyle Kosic 39 Dec 12, 2022