Skip to content

Commit

Permalink
[Tizen/Web] Remove input text box when create offloading pipeline
Browse files Browse the repository at this point in the history
This patch removes input text box and use nsd service
when create offloading pipeline.

Signed-off-by: Yelin Jeong <[email protected]>
  • Loading branch information
niley7464 committed Jul 12, 2024
1 parent a84d5a5 commit 96e85e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
3 changes: 0 additions & 3 deletions Tizen.web/ImageClassificationOffloading/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ body {
margin: 10px;
text-align: center;
}
.canvas {
margin: 50px
}
6 changes: 1 addition & 5 deletions Tizen.web/ImageClassificationOffloading/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Image Classification SingleShot Example" />
<meta name="description" content="Tizen Image Classification Offloading Example" />
<title>Tizen Image Classification Offloading Example</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/util.js" type="module"></script>
Expand All @@ -22,10 +22,6 @@ <h1 align="center" margin-bottom="50px">Image Classification</h1>
</div>
<div class="element">
<button class="button" id="start_offloading">Create Offloading Pipeline</button>
<br>
<input class="button" id="ip" type="text" name="ip" value="127.0.0.1"/>
<br>
<input class="button" id="port" type="text" name="port" value="3000"/>
<div id="offloading">
<canvas id="canvas_offloading" width="224" height="224"></canvas>
<div id="label_offloading">Tab here</div>
Expand Down
17 changes: 14 additions & 3 deletions Tizen.web/ImageClassificationOffloading/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
loadLabelInfo,
startHybridService,
startMessagePort,
gRemoteServices,
} from "./utils.js";

let fHandle = null;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 96e85e8

Please sign in to comment.