From d329eb90bc5125312ce48ab8e96692e67b166571 Mon Sep 17 00:00:00 2001 From: alabulei1 Date: Fri, 17 Dec 2021 17:25:33 +0800 Subject: [PATCH] fix tensorflow interface --- faas/mobilenet_birds/Cargo.toml | 2 +- faas/mobilenet_birds/src/lib.rs | 4 ++-- faas/mobilenet_food/Cargo.toml | 2 +- faas/mobilenet_food/src/lib.rs | 4 ++-- faas/mobilenet_insects/Cargo.toml | 2 +- faas/mobilenet_insects/src/lib.rs | 4 ++-- faas/mobilenet_plants/Cargo.toml | 2 +- faas/mobilenet_plants/src/lib.rs | 4 ++-- faas/mtcnn/Cargo.toml | 2 +- faas/mtcnn/src/lib.rs | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/faas/mobilenet_birds/Cargo.toml b/faas/mobilenet_birds/Cargo.toml index 6458ba4e..ae23ca94 100644 --- a/faas/mobilenet_birds/Cargo.toml +++ b/faas/mobilenet_birds/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] wasm-bindgen = "=0.2.61" -ssvm_tensorflow_interface = "^0.1.3" +wasmedge_tensorflow_interface = "^0.2.2" image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] } imageproc = "0.21.0" serde = { version = "^1.0.59", features = ["derive"] } diff --git a/faas/mobilenet_birds/src/lib.rs b/faas/mobilenet_birds/src/lib.rs index a88ce60f..d722941c 100644 --- a/faas/mobilenet_birds/src/lib.rs +++ b/faas/mobilenet_birds/src/lib.rs @@ -1,5 +1,5 @@ use wasm_bindgen::prelude::*; -use ssvm_tensorflow_interface; +use wasmedge_tensorflow_interface; use std::str; use std::time::{Instant}; @@ -22,7 +22,7 @@ pub fn infer(image_data: &[u8]) -> String { let model_data: &[u8] = include_bytes!("mobilenet_v2_192res_1.0_inat_bird.pb"); let labels = include_str!("aiy_birds_V1_labelmap.txt"); - let mut session = ssvm_tensorflow_interface::Session::new(model_data, ssvm_tensorflow_interface::ModelType::TensorFlow); + let mut session = wasmedge_tensorflow_interface::Session::new(model_data, wasmedge_tensorflow_interface::ModelType::TensorFlow); session.add_input("map/TensorArrayStack/TensorArrayGatherV3", &flat_img, &[1, 192, 192, 3]) .add_output("prediction") .run(); diff --git a/faas/mobilenet_food/Cargo.toml b/faas/mobilenet_food/Cargo.toml index 6458ba4e..ae23ca94 100644 --- a/faas/mobilenet_food/Cargo.toml +++ b/faas/mobilenet_food/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] wasm-bindgen = "=0.2.61" -ssvm_tensorflow_interface = "^0.1.3" +wasmedge_tensorflow_interface = "^0.2.2" image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] } imageproc = "0.21.0" serde = { version = "^1.0.59", features = ["derive"] } diff --git a/faas/mobilenet_food/src/lib.rs b/faas/mobilenet_food/src/lib.rs index b6975199..16f74e2c 100644 --- a/faas/mobilenet_food/src/lib.rs +++ b/faas/mobilenet_food/src/lib.rs @@ -1,5 +1,5 @@ use wasm_bindgen::prelude::*; -use ssvm_tensorflow_interface; +use wasmedge_tensorflow_interface; use std::str; use std::time::{Instant}; @@ -22,7 +22,7 @@ pub fn infer(image_data: &[u8]) -> String { let model_data: &[u8] = include_bytes!("mobilenet_v1_192res_1.0_seefood.pb"); let labels = include_str!("aiy_food_V1_labelmap.txt"); - let mut session = ssvm_tensorflow_interface::Session::new(model_data, ssvm_tensorflow_interface::ModelType::TensorFlow); + let mut session = wasmedge_tensorflow_interface::Session::new(model_data, wasmedge_tensorflow_interface::ModelType::TensorFlow); session.add_input("input", &flat_img, &[1, 192, 192, 3]) .add_output("MobilenetV1/Predictions/Softmax") .run(); diff --git a/faas/mobilenet_insects/Cargo.toml b/faas/mobilenet_insects/Cargo.toml index 6458ba4e..ae23ca94 100644 --- a/faas/mobilenet_insects/Cargo.toml +++ b/faas/mobilenet_insects/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] wasm-bindgen = "=0.2.61" -ssvm_tensorflow_interface = "^0.1.3" +wasmedge_tensorflow_interface = "^0.2.2" image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] } imageproc = "0.21.0" serde = { version = "^1.0.59", features = ["derive"] } diff --git a/faas/mobilenet_insects/src/lib.rs b/faas/mobilenet_insects/src/lib.rs index 2e15ef17..699b44c6 100644 --- a/faas/mobilenet_insects/src/lib.rs +++ b/faas/mobilenet_insects/src/lib.rs @@ -1,5 +1,5 @@ use wasm_bindgen::prelude::*; -use ssvm_tensorflow_interface; +use wasmedge_tensorflow_interface; use std::str; use std::time::{Instant}; @@ -20,7 +20,7 @@ pub fn infer(image_data: &[u8]) -> String { let model_data: &[u8] = include_bytes!("mobilenet_v2_192res_1.0_inat_insect.pb"); let labels = include_str!("aiy_insects_V1_labelmap.txt"); - let mut session = ssvm_tensorflow_interface::Session::new(model_data, ssvm_tensorflow_interface::ModelType::TensorFlow); + let mut session = wasmedge_tensorflow_interface::Session::new(model_data, wasmedge_tensorflow_interface::ModelType::TensorFlow); session.add_input("map/TensorArrayStack/TensorArrayGatherV3", &flat_img, &[1, 192, 192, 3]) .add_output("prediction") .run(); diff --git a/faas/mobilenet_plants/Cargo.toml b/faas/mobilenet_plants/Cargo.toml index 6458ba4e..ae23ca94 100644 --- a/faas/mobilenet_plants/Cargo.toml +++ b/faas/mobilenet_plants/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] wasm-bindgen = "=0.2.61" -ssvm_tensorflow_interface = "^0.1.3" +wasmedge_tensorflow_interface = "^0.2.2" image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] } imageproc = "0.21.0" serde = { version = "^1.0.59", features = ["derive"] } diff --git a/faas/mobilenet_plants/src/lib.rs b/faas/mobilenet_plants/src/lib.rs index 65139b76..d5287f8b 100644 --- a/faas/mobilenet_plants/src/lib.rs +++ b/faas/mobilenet_plants/src/lib.rs @@ -1,5 +1,5 @@ use wasm_bindgen::prelude::*; -use ssvm_tensorflow_interface; +use wasmedge_tensorflow_interface; use std::str; use std::time::{Instant}; @@ -20,7 +20,7 @@ pub fn infer(image_data: &[u8]) -> String { let model_data: &[u8] = include_bytes!("mobilenet_v2_192res_1.0_inat_plant.pb"); let labels = include_str!("aiy_plants_V1_labelmap.txt"); - let mut session = ssvm_tensorflow_interface::Session::new(model_data, ssvm_tensorflow_interface::ModelType::TensorFlow); + let mut session = wasmedge_tensorflow_interface::Session::new(model_data, wasmedge_tensorflow_interface::ModelType::TensorFlow); session.add_input("map/TensorArrayStack/TensorArrayGatherV3", &flat_img, &[1, 192, 192, 3]) .add_output("prediction") .run(); diff --git a/faas/mtcnn/Cargo.toml b/faas/mtcnn/Cargo.toml index 6e0e56d8..428dc502 100644 --- a/faas/mtcnn/Cargo.toml +++ b/faas/mtcnn/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] wasm-bindgen = "=0.2.61" -ssvm_tensorflow_interface = "^0.1.3" +wasmedge_tensorflow_interface = "^0.2.2" image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] } imageproc = "0.21.0" serde = { version = "^1.0.59", features = ["derive"] } diff --git a/faas/mtcnn/src/lib.rs b/faas/mtcnn/src/lib.rs index efbece1a..73962066 100644 --- a/faas/mtcnn/src/lib.rs +++ b/faas/mtcnn/src/lib.rs @@ -1,5 +1,5 @@ use wasm_bindgen::prelude::*; -use ssvm_tensorflow_interface; +use wasmedge_tensorflow_interface; use image::{GenericImageView, Pixel}; use imageproc::drawing::draw_hollow_rect_mut; use imageproc::rect::Rect; @@ -20,7 +20,7 @@ pub fn infer(image_data: &[u8]) -> Vec { let model_data: &[u8] = include_bytes!("mtcnn.pb"); - let mut session = ssvm_tensorflow_interface::Session::new(model_data, ssvm_tensorflow_interface::ModelType::TensorFlow); + let mut session = wasmedge_tensorflow_interface::Session::new(model_data, ssvm_tensorflow_interface::ModelType::TensorFlow); session.add_input("min_size", &[20.0f32], &[]) .add_input("thresholds", &[0.6f32, 0.7f32, 0.7f32], &[3]) .add_input("factor", &[0.709f32], &[])