You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [main.rs](https://github.com/second-state/WasmEdge-WASINN-examples/tree/master/pytorch-mobilenet-image/rust/src/main.rs) is the complete example Rust source. First, read the image file and PyTorch model file names from the command line.
77
+
The [main.rs](https://github.com/second-state/WasmEdge-WASINN-examples/tree/master/pytorch-mobilenet-image/rust/src/main.rs) is the complete example Rust source. First, read the image file and PyTorch model file names from the command line.
Copy file name to clipboardExpand all lines: docs/develop/rust/wasinn/tensorflow_lite.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ wasmedge --dir .:. out.wasm lite-model_aiy_vision_classifier_birds_V1_3.tflite b
74
74
75
75
## Understand the code
76
76
77
-
The [main.rs](https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/tflite-birds_v1-image/rust/tflite-bird/src/main.rs) is the complete example Rust source. First, read the image file and Tensorflow Lite (tflite) model file names from the command line.
77
+
The [main.rs](https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/tflite-birds_v1-image/rust/tflite-bird/src/main.rs) is the complete example Rust source. First, read the image file and Tensorflow Lite (tflite) model file names from the command line.
Copy file name to clipboardExpand all lines: docs/develop/rust/wasinn/tf_plugin.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,19 @@
1
1
---
2
-
sidebar_position: 7
2
+
sidebar_position: 5
3
3
---
4
4
5
-
# TensorFlow Interface
5
+
# TensorFlow Plug-in For WasmEdge
6
6
7
-
Developers can use [WASI-NN](/category/neural-networks-for-wasi) to inference the models. However, for the TensorFlow and TensorFlow-Lite users, the WASI-NN APIs could be more friendly to retrieve the input and output tensors. Therefore WasmEdge provides the TensorFlow-related plug-in and rust SDK for inferencing models in WASM.
7
+
Developers can use [WASI-NN](https://github.com/WebAssembly/wasi-nn) to inference the models. However, for the TensorFlow and TensorFlow-Lite users, the WASI-NN APIs could be more friendly to retrieve the input and output tensors. Therefore WasmEdge provides the TensorFlow-related plug-in and rust SDK for inferencing models in WASM.
8
+
9
+
<!-- prettier-ignore -->
10
+
:::info
11
+
This is not a WASI-NN compatible plug-in. If you are finding the plug-ins working with the [WASI-NN crate](https://crates.io/crates/wasi-nn), please follow the [tensorflow-lite backend](tensorflow_lite.md) instead.
12
+
:::
8
13
9
14
## Prerequisite
10
15
11
-
Please ensure that you [Rust and WasmEdge installed](setup.md).
16
+
Please ensure that you [Rust and WasmEdge installed](../setup.md).
12
17
13
18
Developers will add the [`wasmedge_tensorflow_interface` crate](https://crates.io/crates/wasmedge_tensorflow_interface) as a dependency to their `Rust -> Wasm` applications. For example, add the following line to the application's `Cargo.toml` file.
14
19
@@ -27,7 +32,7 @@ use wasmedge_tensorflow_interface;
27
32
28
33
In this crate, we provide several functions to decode and convert images into tensors using the `WasmEdge-Image` host functions.
29
34
30
-
To use these functions in WASM and execute in WasmEdge, users should [install WasmEdge with WasmEdge-Image plug-in](../../start/install.md#wasmedge-image-plug-in).
35
+
To use these functions in WASM and execute in WasmEdge, users should [install WasmEdge with WasmEdge-Image plug-in](../../../start/install.md#wasmedge-image-plug-in).
31
36
32
37
For decoding the `JPEG` images, there are:
33
38
@@ -67,9 +72,9 @@ let flat_img = wasmedge_tensorflow_interface::load_jpg_image_to_rgb32f(&img_buf,
67
72
68
73
## Inferring TensorFlow And TensorFlow-Lite Models
69
74
70
-
For using the `TFSession` struct to inference the TensorFlow models and executing in WasmEdge, users should install the [WasmEdge-TensorFlow plug-in with dependencies](../../start/install.md#wasmedge-tensorflow-plug-in).
75
+
For using the `TFSession` struct to inference the TensorFlow models and executing in WasmEdge, users should install the [WasmEdge-TensorFlow plug-in with dependencies](../../../start/install.md#wasmedge-tensorflow-plug-in).
71
76
72
-
For using the `TFLiteSession` struct and to inference the TensorFlow-Lite models executing in WasmEdge, users should install the [WasmEdge-TensorFlowLite plug-in with dependencies](../../start/install.md#wasmedge-tensorflow-lite-plug-in).
77
+
For using the `TFLiteSession` struct and to inference the TensorFlow-Lite models executing in WasmEdge, users should install the [WasmEdge-TensorFlowLite plug-in with dependencies](../../../start/install.md#wasmedge-tensorflow-lite-plug-in).
Copy file name to clipboardExpand all lines: docs/embed/go/ai.md
+35-28Lines changed: 35 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,28 +9,23 @@ sidebar_position: 5
9
9
The WasmEdge extensions have been deprecated after the v0.12.1 version. We'll update to use the WasmEdge plug-in in the future.
10
10
:::
11
11
12
-
In this section, we will show you how to create a TensorFlow inference function in Rust for image classification and then embed it into a Go application. The project source code is [available here](https://github.com/second-state/WasmEdge-go-examples/tree/master/wasmedge-bindgen/go_TfliteFood).
12
+
In this section, we will show you how to create a TensorFlow or TensorFlow-Lite inference function in Rust for image classification and then embed it into a Go application. The project source code is [available here](https://github.com/second-state/WasmEdge-go-examples/blob/master/go_TfliteFood/).
13
13
14
14
## The WASM app in Rust
15
15
16
-
The Rust function for image classification is [available here](https://github.com/second-state/WasmEdge-go-examples/blob/master/wasmedge-bindgen/go_TfliteFood/rust_tflite_food/src/lib.rs). It utilizes the WasmEdge Tensorflow Lite plug-in as well as the [wasmedge_bindgen](function.md) for passing call parameters.
16
+
The Rust function for image classification is [available here](https://github.com/second-state/WasmEdge-go-examples/blob/master/go_TfliteFood/rust_tflite_food/src/lib.rs). It utilizes the WasmEdge Tensorflow Lite plug-in as well as the [wasmedge_bindgen](function.md) for passing call parameters.
The [Go host app](https://github.com/second-state/WasmEdge-go-examples/blob/master/wasmedge-bindgen/go_TfliteFood/tflite_food.go) 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.
54
+
The [Go host app](https://github.com/second-state/WasmEdge-go-examples/blob/master/go_TfliteFood/tflite_food.go) 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.
Copy file name to clipboardExpand all lines: docs/start/install.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,6 +217,34 @@ Then, go to [WASI-Crypto in Rust chapter](../develop/rust/wasicrypto.md) to see
217
217
218
218
The wasmEdge-Image plug-in can help developers to load and decode JPEG and PNG images and convert into tensors. To install this plug-in, please use the `--plugins wasmedge_image` parameter when [running the installer command](#generic-linux-and-macos).
219
219
220
+
Then, go to [TensorFlow interface (image part) in Rust chapter](../develop/rust/wasinn/tf_plugin.md#image-loading-and-conversion) to see how to run `WasmEdge-Image` functions.
221
+
222
+
### WasmEdge TensorFlow Plug-in
223
+
224
+
WasmEdge-TensorFlow plug-in can help developers to perform `TensorFlow` model inference as the similar API in python. To install this plug-in, please use the `--plugins wasmedge_tensorflow` parameter when [running the installer command](#generic-linux-and-macos).
225
+
226
+
The WasmEdge-Tensorflow plug-in depends on the `libtensorflow_cc` shared library.
227
+
228
+
<!-- prettier-ignore -->
229
+
:::note
230
+
If you install this plug-in WITHOUT installer, you can [refer to here to install the dependency](#tensorflow-dependencies).
231
+
:::note
232
+
233
+
Then, go to [TensorFlow interface in Rust chapter](../develop/rust/wasinn/tf_plugin.md) to see how to run `WasmEdge-TensorFlow` functions.
234
+
235
+
### WasmEdge TensorFlow-Lite Plug-in
236
+
237
+
The wasmEdge-TensorFlowLite plug-in can help developers to perform `TensorFlow-Lite` model inference as the similar API in python. To install this plug-in, please use the `--plugins wasmedge_tensorflowlite` parameter when [running the installer command](#generic-linux-and-macos).
238
+
239
+
The WasmEdge-TensorflowLite plug-in depends on the `libtensorflowlite_c` shared library to perform AI/ML computations, and it will be installed by the installer automatically.
240
+
241
+
<!-- prettier-ignore -->
242
+
:::note
243
+
If you install this plug-in WITHOUT installer, you can [refer to here to install the dependency](#tensorflow-lite-dependencies).
244
+
:::note
245
+
246
+
Then, go to [TensorFlow interface in Rust chapter](../develop/rust/wasinn/tf_plugin.md) to see how to run `WasmEdge-TensorFlowLite` functions.
Copy file name to clipboardExpand all lines: i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/networking.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,16 @@ The QuickJS WasmEdge Runtime supports Node.js's `http` and `fetch` APIs via the
8
8
9
9
The networking API in WasmEdge is non-blocking and hence supports asynchronous I/O-intensive applications. With this API, the JavaScript program can open multiple connections concurrently. It polls those connections or registers async callback functions to process data whenever data comes in, without waiting for any one connection to complete its data transfer. That allows the single-threaded application to handle multiple, multiple concurrent requests.
10
10
11
-
-[Networking](#networking)
12
-
-[Prerequisites](#prerequisites)
13
-
-[Fetch client](#fetch-client)
14
-
-[HTTP server](#http-server)
15
-
-[TCP server and client](#tcp-server-and-client)
11
+
-[Prerequisites](#prerequisites)
12
+
-[Fetch client](#fetch-client)
13
+
-[HTTP server](#http-server)
14
+
-[TCP server and client](#tcp-server-and-client)
16
15
17
16
## Prerequisites
18
17
19
-
[See here](./hello_world#prerequisites)
18
+
[Install WasmEdge](../../start/install.md). To make HTTPS requests, install the [WasmEdge TLS plug-in](../../start/install.md#tls-plug-in).
19
+
20
+
[Install WasmEdge-QuickJS](./hello_world#prerequisites). Make sure that the `modules` directory is located in your local directory where you want to execute the `wasmedge` command.
0 commit comments