Tensorflow
The Rust function for image classification is . It utilizes the WasmEdge Tensorflow extension API as well as the for passing call parameters.
You can use the standard command to build it into a WebAssembly function.
cd rust_tflite_food cargo build --target wasm32-wasi --release cp target/wasm32-wasi/release/rust_tflite_food_lib.wasm ../ cd ../
You can use our AOT compiler to instrument the WebAssembly file to make it run much faster. Learn more.
The source code shows how to instantiate a WasmEdge runtime with the Tensorflow extension, and how to pass the image data to the Rust function in WasmEdge to run the inference.
The following command builds the Go host application with the WasmEdge Go SDK and its tensorflow extension.
Now you can run the Go application. It calls the WebAssembly function in WasmEdge to run inference on the input image.
The results are as follows.
Go: Args: [./tflite_food rust_tflite_food_lib.wasm food.jpg] It is very likely a Hot dog in the picture