From 3230dfc716eea9d3a81df7ded19d03c72b1f8470 Mon Sep 17 00:00:00 2001 From: Yelin Jeong Date: Tue, 9 Jul 2024 14:44:54 +0900 Subject: [PATCH] [Tizen/Web] Remove input text box when create offloading pipeline This patch removes input text box and use nsd service when create offloading pipeline. Signed-off-by: Yelin Jeong --- .../ImageClassificationOffloading/css/style.css | 3 --- .../ImageClassificationOffloading/index.html | 6 +----- .../ImageClassificationOffloading/js/main.js | 17 ++++++++++++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Tizen.web/ImageClassificationOffloading/css/style.css b/Tizen.web/ImageClassificationOffloading/css/style.css index ffd019f7..a2b74028 100644 --- a/Tizen.web/ImageClassificationOffloading/css/style.css +++ b/Tizen.web/ImageClassificationOffloading/css/style.css @@ -21,6 +21,3 @@ body { margin: 10px; text-align: center; } -.canvas { - margin: 50px -} diff --git a/Tizen.web/ImageClassificationOffloading/index.html b/Tizen.web/ImageClassificationOffloading/index.html index 375495ef..c469fa73 100644 --- a/Tizen.web/ImageClassificationOffloading/index.html +++ b/Tizen.web/ImageClassificationOffloading/index.html @@ -3,7 +3,7 @@ - + Tizen Image Classification Offloading Example @@ -22,10 +22,6 @@

Image Classification

-
- -
-
Tab here
diff --git a/Tizen.web/ImageClassificationOffloading/js/main.js b/Tizen.web/ImageClassificationOffloading/js/main.js index a8c2b855..6c7c8b9f 100644 --- a/Tizen.web/ImageClassificationOffloading/js/main.js +++ b/Tizen.web/ImageClassificationOffloading/js/main.js @@ -15,6 +15,7 @@ import { loadLabelInfo, startHybridService, startMessagePort, + gRemoteServices, } from "./utils.js"; let fHandle = null; @@ -99,15 +100,25 @@ function runLocal() { * Run a pipeline that uses other device's resources */ function runOffloading() { + const remoteService = gRemoteServices.get("MobileNet"); + if ( + !gRemoteServices.has("MobileNet") || + !Object.prototype.hasOwnProperty.call(remoteService, "ip") || + !Object.prototype.hasOwnProperty.call(remoteService, "port") + ) { + console.log("No remote service available"); + return; + } + const filter = "tensor_query_client host=" + ip + " port=" + - document.getElementById("port").value + + remoteService["port"] + " dest-host=" + - document.getElementById("ip").value + + remoteService["ip"] + " dest-port=" + - document.getElementById("port").value + + remoteService["port"] + " timeout=1000"; const pipelineDescription = createPipelineDescription(false, filter);