bytecodealliance / wasi-nn

High-level bindings for wasi-nn system calls
Apache License 2.0
41 stars 33 forks source link

Implementing bindings for the new Image2Tensor feature #58

Closed brianjjones closed 2 years ago

brianjjones commented 2 years ago

New bindings for the optional Image2Tensor feature of Wasmtime wasi-nn. This exposes the functions provided by the image2tensor crate, which converts standard images to tensors. Note: this requires wasmtime to be compiled using --features "wasmtime-wasi-nn/i2t" to work. If the wasmtime version you are using doesn't have this feature, the rust bindings will still work because they will default to using the image2tensor crate directly. However, the AssemblyScript bindings will not work, since image2tensor is written in rust.

bjorn3 commented 2 years ago

This PR permanently grows the git repo by ~640kb due to the images. This will unnecessarily increase disk space and clone time when cloning wasmtime even if you don't use wasi-nn. Could you please use significantly smaller images? 128px by 128px or something like that should be enough for classification, right? Maybe even 64px by 64px?

brianjjones commented 2 years ago

@bjorn3 A reasonable point. The images are only for the examples so I'll add a change to fetch them rather than have them stored here.

bjorn3 commented 2 years ago

Could you squash the image removal commit into the one adding the images? Otherwise they will still be part of the repo.

brianjjones commented 2 years ago

Closing for now. We can revisit if there's interest in the future.