This project provides high-level wasi-nn bindings for Rust and AssemblyScript. The basic idea: write your machine learning application in a high-level language using these bindings, compile it to WebAssembly, and run it in a WebAssembly runtime that supports the wasi-nn proposal, such as Wasmtime.
NOTE: These bindings are experimental (use at your own risk) and subject to upstream changes in the wasi-nn specification.
- In Rust, download the crate from crates.io by adding
wasi-nn = "0.1"
as a Cargo dependency; more information in the Rust README. - In AssemblyScript, download the package from npmjs.com by adding
"as-wasi-nn": "^0.1"
as an NPM dependency; more information in the AssemblyScript README.
This repository includes examples of using these bindings. See the Rust example and AssemblyScript example to walk through an end-to-end image classification using an AlexNet model. Run them with:
./build.sh rust
runs the Rust example./build.sh as
runs the AssemblyScript example
This project is licensed under the Apache 2.0 license. See LICENSE for more details.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.