forked from webmachinelearning/webnn-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
237 lines (234 loc) · 10.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>WebNN Semantic Segmentation Example</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href='../common/css/style.css' rel='stylesheet'>
<link rel="icon" type="image/x-icon" href="../common/img/favicon/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="../common/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="../common/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../common/img/favicon/favicon-16x16.png">
<link rel="manifest" href="../common/img/favicon/site.webmanifest">
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark">
<a href="../index.html">
<div class="logosvg" id="logosvg"></div>
</a>
<span class="navbar-brand">Semantic Segmentation</span>
<ul class="navbar-nav"></ul>
</nav>
<div class='container' id='container'>
<div class="card mt-2 mb-2">
<div class="card-body">
<div class="row mb-2 align-items-center justify-content-md-left">
<div class="col-1 col-md-1">
<span>Backend</span>
</div>
<div class="col-md-auto">
<div class="btn-group-toggle" data-toggle="buttons" id="backendBtns">
<label class="btn btn-outline-info custom" name="polyfill">
<input type="radio" name="backend" id="polyfill_cpu" autocomplete="off">Wasm (CPU)
</label>
<label class="btn btn-outline-info custom" name="polyfill">
<input type="radio" name="backend" id="polyfill_gpu" autocomplete="off">WebGL (GPU)
</label>
<label class="btn btn-outline-info custom" name="webnn">
<input type="radio" name="backend" id="webnn_cpu" autocomplete="off">WebNN (CPU)
</label>
<label class="btn btn-outline-info custom" name="webnn">
<input type="radio" name="backend" id="webnn_gpu" autocomplete="off">WebNN (GPU)
</label>
</div>
</div>
</div>
<!-- <div class="row mb-2 align-items-center">
<div class="col-1 col-md-1">
<span>Layout</span>
</div>
<div class="col-md-auto">
<div class="btn-group-toggle" data-toggle="buttons" id="layoutBtns">
<label class="btn btn-outline-info btn-sm">
<input type="radio" name="layout" id="nchw" autocomplete="off">NCHW
</label>
<label class="btn btn-outline-info btn-sm active">
<input type="radio" name="layout" id="nhwc" autocomplete="off" checked>NHWC
</label>
</div>
</div>
</div> -->
<div class="row mb-2 align-items-center">
<div class="col-1 col-md-1">
<span>Model</span>
</div>
<div class="col-md-auto">
<div class="btn-group-toggle" data-toggle="buttons" id="modelBtns">
<label class="btn btn-outline-info btn-sm active">
<input type="radio" name="model" id="deeplabv3mnv2" autocomplete="off">DeepLab V3 MobileNet
V2
</label>
</div>
</div>
</div>
</div>
</div>
<ul class='nav nav-tabs nav-justified mb-3' id='tabs' role='tablist'>
<li class='nav-item' id='img' role='presentation'>
<a class='nav-link active' data-toggle='tab' href='#imagetab' role='tab' aria-controls='ex3-tabs-1'
aria-selected='true'>IMAGE</a>
</li>
<li class='nav-item' id='cam' role='presentation'>
<a class='nav-link' data-toggle='tab' href='#cameratab' role='tab' aria-controls='ex3-tabs-2'
aria-selected='false'>LIVE CAMERA</a>
</li>
</ul>
<div class='tab-content clearfix' style='display: none;' id='progressmodel'>
<div class='loading-page'>
<div class='counter'>
<div class='loading'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<p id='progressstep'>Loading model ...</p>
</div>
</div>
</div>
<div class='tab-content text-center mt-5 col-sm' id='hint'>
<h2 class="text-uppercase text-info">No model selected</h2>
<p class="font-weight-lighter">Please select model to start prediction.</p>
</div>
<div class='tab-content clearfix row' id='semanticsegmentation'>
<div class='icdisplay col-sm' style='display: none;'>
<div class='tab-pane text-center active col-sm'>
<div class='icdisplay'>
<div class='col-lg-12 col-xs-12 text-center'>
<div class='col mb-3'>
<span id='fps' class="badge badge-pill badge-success"></span>
</div>
<div class='col bt-3 mb-3' style='display: flex;'>
<canvas id='outputCanvas'></canvas>
</div>
</div>
</div>
</div>
</div>
<div class='shoulddisplay col-sm' style='display: none; font-size: 0.9rem;'>
<div class='row tc'>
<ul class="list-inline list-pipe text-center">
<li class="list-inline-item">
Load time: <span class='ir' id='loadTime'></span>
</li>
<li class="list-inline-item">
Build time: <span class='ir' id='buildTime'></span>
</li>
<li class="list-inline-item">
<span id='computeLabel'></span>
<span class='ir' id='computeTime'></span>
</li>
</ul>
</div>
<div class='controls text-left' data-select='blur'>
<div class='row'>
<div class='label'>
EFFECT:</span>
</div>
<div class='btn-group btn-group-toggle btn-group-sm effects-select' data-toggle='buttons'>
<label class='btn btn-secondary'>
<input type='radio' value='label' autocomplete='off' checked> MAP
</label>
<label class='btn btn-secondary'>
<input type='radio' value='fill' autocomplete='off'> FILL
</label>
<label class='btn btn-secondary'>
<input type='radio' value='image' autocomplete='off'> IMG
</label>
<label class='btn btn-secondary'>
<input type='radio' value='blur' autocomplete='off'> BLUR
</label>
</div>
</div>
<div class='row refine-edge-wrapper'>
<div class='label'>
REFINE EDGE: <span class='refine-edge-value'></span>
</div>
<div class='slidecontainer'><input type='range' min='0' max='60' value='0' class='slider'
id='refineEdgeSlider'></div>
</div>
<div class='row blur-wrapper'>
<div class='label'>
BLUR RADIUS: <span class='blur-radius-value'></span>
</div>
<div class='slidecontainer'><input type='range' min='0' max='50' value='0' class='slider' id='blurSlider'>
</div>
</div>
<div class='row color-picker-wrapper justify-content-center'>
<div class='label'>
BACKGROUND: <span class='bg-value'></span>
</div>
<div id='color-picker-container'></div>
</div>
<div class='row select-bg-wrapper justify-content-center text-center'>
<div class='label'>
<label class='btn btn-outline-primary btn-sm'>
Select Background <input type='file' id='chooseBackground' accept='image/*' hidden>
</label>
<button id='clearBackground' class='btn btn-outline-secondary btn-sm'>
Clear Background
</button>
</div>
</div>
<div class='row color-map-alpha-wrapper'>
<div class='label'>
OPACITY: <span class='color-map-alpha-value'></span>
</div>
<div class='slidecontainer'><input type='range' min='0' max='100' value='0' class='slider'
id='colorMapAlphaSlider'></div>
</div>
<div class='row labels-wrapper' id='labelitem'>
</div>
</div>
</div>
</div>
<div class='row mt-1 text-center' id='pickimage'>
<div class='col'>
<label class='btn btn-outline-info btn-lg shoulddisplay' style='display: none;'>
<input type='file' id='imageFile' accept='image/*' hidden />
<span>Pick Image</span>
</label>
</div>
</div>
</div>
<footer class="text-muted text-center text-small mt-5">
<div id="badge"></div>
<div id="footer"></div>
</footer>
<img id='feedElement' hidden crossorigin='anonymous' src=''>
<video id='feedMediaElement' autoplay playsinline hidden></video>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@jaames/iro@5"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"
integrity="sha256-thVOvsS0U8X0/2twH3+6dCK3ZPTvgWgFSivgfpj5vQQ="
crossorigin="anonymous"></script>
<script type="module" src="./main.js"></script>
<script type="module" src="../common/component/component.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6TK7JD3KKY"></script>
<script src="../common/libs/gtag.js"></script>
</body>
</html>