forked from webmachinelearning/webnn-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
203 lines (197 loc) · 9.09 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
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>WebNN Fast Style Transfer 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="../">
<div class="logosvg" id="logosvg"></div>
</a>
<span class="navbar-brand">Fast Style Transfer</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 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="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>
</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='gallery' id='gallery'>
<div class='gallery-item hl'><img class='gallery-image' id='starry-night'
src='./images/style-images/starrynight.jpg' title='The starry night'></div>
<div class='gallery-item'><img class='gallery-image' id='self-portrait'
src='./images/style-images/self-portrait.jpg' title='Self-Portrait' /></div>
<div class='gallery-item'><img class='gallery-image' id='bedroom'
src='./images/style-images/bedroom.jpg' title='Vincent`s Bedroom in Arles' /></div>
<div class='gallery-item'><img class='gallery-image' id='sunflowers-bew'
src='./images/style-images/Sunflowers-Bew.jpg' title='“Sunflowers” (1889)' /></div>
<div class='gallery-item'><img class='gallery-image' id='red-vineyards'
src='./images/style-images/Red-Vineyards.jpg' title='The Red Vineyard' /></div>
<div class='gallery-item'><img class='gallery-image' id='sien-with-a-cigar'
src='./images/style-images/sien_with_a_cigar.jpg' title='Sien with a cigar' /></div>
<div class='gallery-item'><img class='gallery-image' id='la-campesinos'
src='./images/style-images/la-campesinos.jpg' title='Rest from Work' /></div>
<div class='gallery-item'><img class='gallery-image' id='soup-distribution'
src='./images/style-images/Soup-Distribution.jpg' title='Soup Distribution in a Public Soup Kitchen' /></div>
<div class='gallery-item'><img class='gallery-image' id='wheatfield_with_crows'
src='./images/style-images/Wheatfield_with_Crows.jpg' title='Wheatfield with Crows' /></div>
</div>
<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 backend selected</h2>
<p class="font-weight-lighter">Please select backend to start prediction.</p>
</div>
<div class='shoulddisplay tab-content clearfix' style='display: none;'>
<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='tab-content clearfix row'>
<div class='tab-pane text-center active col-sm' id='imagetab'>
<div class='icdisplay'>
<div class='col-lg-12 col-xs-12 text-center'>
<div class='row'>
<div class='col bt-3 mb-3' style='display: flex;'>
<div id='div-photos' style='margin: auto; display: flex;' title='Original image'>
<img id='feedElement' hidden crossorigin='anonymous' class='img-fluid' alt='Responsive image'>
<canvas id='inputCanvas'></canvas>
</div>
</div>
<div class='col bt-3 mb-3' style='display: flex;' title='Transferred image'>
<div id='div-styles' style='margin: auto; display: flex;'>
<canvas id='outputCanvas'></canvas>
</div>
</div>
</div>
<div class='row'>
<div class='col'>
<div class='box'>
<h6 class='text-muted shoulddisplay' style='display: none;'>
<i>The painting style of <span class='text-uppercase badge badge-primary'><span></i>
</h6>
</div>
</div>
</div>
<div class='row mt-1'>
<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>
</div>
</div>
<div class='tab-pane text-center col-sm' id='cameratab'>
<div class='icdisplay'>
<div class='row'>
<div class='col mb-3'>
<span id='fps' class="badge badge-pill badge-success"></span>
</div>
</div>
<div class='row'>
<div class='col bt-3 mb-3' style='display: flex;'>
<div id='div-photos' style='margin: auto; display: flex;'>
<canvas id='camInCanvas'></canvas>
</div>
</div>
<video id='feedMediaElement' autoplay playsinline style='display: none;'></video>
<div class='col bt-3 mb-3' style='display: flex;'>
<div id='div-styles' style='margin: auto; display: flex;'>
<canvas id='camOutCanvas'></canvas>
</div>
</div>
</div>
<div class='row'>
<div class='col'>
<div class='box'>
<h6 class='text-muted shoulddisplay' style='display: none;'>
<i>The painting style of <span class='text-uppercase badge badge-primary'><span></i>
</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="text-muted text-center text-small mt-5">
<div id="badge"></div>
<div id="footer"></div>
</footer>
<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 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>