Skip to content

Commit 11876b3

Browse files
committed
[Examples] Update the WASI-NN examples to the latest wasi-nn crate.
Signed-off-by: YiYing He <yiying@secondstate.io>
1 parent 9385e2b commit 11876b3

File tree

16 files changed

+22
-72
lines changed

16 files changed

+22
-72
lines changed

‎openvino-mobilenet-image/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This crate depends on the `wasi-nn` in the `Cargo.toml`:
1010

1111
```toml
1212
[dependencies]
13-
wasi-nn = "0.2.1"
13+
wasi-nn = "0.3.0"
1414
```
1515

1616
## Build
@@ -36,7 +36,7 @@ First download the fixture files with the script:
3636
./download_mobilenet.sh
3737
```
3838

39-
The testing image `input.jpg` is downloaded from https://github.com/bytecodealliance/wasi-nn/raw/main/rust/examples/images/1.jpg with license Apache-2.0
39+
The testing image `input.jpg` is downloaded from <https://github.com/bytecodealliance/wasi-nn/raw/main/rust/examples/images/1.jpg> with license Apache-2.0
4040

4141
Users should [install the WasmEdge with WASI-NN OpenVINO backend plug-in](https://wasmedge.org/book/en/write_wasm/rust/wasinn.html#get-wasmedge-with-wasi-nn-plug-in-openvino-backend).
4242

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
[package]
22
name = "wasmedge-wasinn-example-mobilenet-image"
3-
version = "0.19.0"
3+
version = "0.1.0"
44
authors = ["Second-State"]
55
readme = "README.md"
6-
edition = "2018"
6+
edition = "2021"
77
publish = false
88

99
[dependencies]
1010
image = { version = "0.23.14", default-features = false, features = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt", "dds", "farbfeld"] }
11-
wasi-nn = { version = "0.2.1" }
11+
wasi-nn = { version = "0.3.0" }
1212

13-
# This crate is built with the wasm32-wasi target, so it's separate
14-
# from the main Wasmtime build, so use this directive to exclude it
15-
# from the parent directory's workspace.
1613
[workspace]

‎openvino-mobilenet-image/rust/src/main.rs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ use wasi_nn;
77
mod imagenet_classes;
88

99
pub fn main() {
10-
main_entry();
11-
}
12-
13-
#[no_mangle]
14-
fn main_entry() {
15-
infer_image();
16-
}
17-
18-
fn infer_image() {
1910
let args: Vec<String> = env::args().collect();
2011
let model_xml_name: &str = &args[1];
2112
let model_bin_name: &str = &args[2];
Binary file not shown.

‎openvino-mobilenet-raw/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This crate depends on the `wasi-nn` in the `Cargo.toml`:
1010

1111
```toml
1212
[dependencies]
13-
wasi-nn = "0.2.1"
13+
wasi-nn = "0.3.0"
1414
```
1515

1616
## Build
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
[package]
22
name = "wasmedge-wasinn-example-mobilenet"
3-
version = "0.19.0"
3+
version = "0.1.0"
44
authors = ["Second-State"]
55
readme = "README.md"
6-
edition = "2018"
6+
edition = "2021"
77
publish = false
88

99
[dependencies]
10-
wasi-nn = { version = "0.2.1" }
10+
wasi-nn = { version = "0.3.0" }
1111

12-
# This crate is built with the wasm32-wasi target, so it's separate
13-
# from the main Wasmtime build, so use this directive to exclude it
14-
# from the parent directory's workspace.
1512
[workspace]

‎openvino-mobilenet-raw/rust/src/main.rs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ use wasi_nn;
55
mod imagenet_classes;
66

77
pub fn main() {
8-
main_entry();
9-
}
10-
11-
#[no_mangle]
12-
fn main_entry() {
13-
infer_image();
14-
}
15-
16-
fn infer_image() {
178
let args: Vec<String> = env::args().collect();
189
let model_xml_name: &str = &args[1];
1910
let model_bin_name: &str = &args[2];
76.9 KB
Binary file not shown.

‎pytorch-mobilenet-image/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This crate depends on the `wasi-nn` in the `Cargo.toml`:
1010

1111
```toml
1212
[dependencies]
13-
wasi-nn = "0.2.1"
13+
wasi-nn = "0.3.0"
1414
```
1515

1616
## Build
@@ -44,7 +44,7 @@ python3 gen_mobilenet_model.py
4444

4545
### Test Image
4646

47-
The testing image `input.jpg` is downloaded from https://github.com/bytecodealliance/wasi-nn/raw/main/rust/examples/images/1.jpg with license Apache-2.0
47+
The testing image `input.jpg` is downloaded from <https://github.com/bytecodealliance/wasi-nn/raw/main/rust/examples/images/1.jpg> with license Apache-2.0
4848

4949
### Generate Tensor
5050

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
[package]
22
name = "wasmedge-wasinn-example-mobilenet-image"
3-
version = "0.19.0"
3+
version = "0.1.0"
44
authors = ["Second-State"]
55
readme = "README.md"
6-
edition = "2018"
6+
edition = "2021"
77
publish = false
88

99
[dependencies]
1010
image = { version = "0.23.14", default-features = false, features = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt", "dds", "farbfeld"] }
11-
wasi-nn = { version = "0.2.1" }
11+
wasi-nn = { version = "0.3.0" }
1212

13-
# This crate is built with the wasm32-wasi target, so it's separate
14-
# from the main Wasmtime build, so use this directive to exclude it
15-
# from the parent directory's workspace.
1613
[workspace]

0 commit comments

Comments
 (0)