-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
248 lines (242 loc) · 11.9 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
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="./docs/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui/dist/css/layui.css">
<script src="https://cdn.jsdelivr.net/npm/layui/dist/layui.min.js"></script>
<title>Hello WebAI.js</title>
</head>
<body>
<ul class="layui-nav">
<li class="layui-nav-item">
<a href="javascript:;"><img src="./docs/logo.png" class="layui-nav-img">WebAI.js</a>
<dl class="layui-nav-child">
<dd><a href="https://github.com/AgentMaker/WebAI.js">Github</a></dd>
<dd><a href="https://gitee.com/AgentMaker/WebAI.js">Gitee</a></dd>
</dl>
</li>
<li class="layui-nav-item layui-this">
<a href="javascript:" id='aDet'>Detection</a>
</li>
<li class="layui-nav-item">
<a href="javascript:" id='aCls'>Classification</a>
</li>
<li class="layui-nav-item">
<a href="javascript:" id='aSeg'>Segmentation</a>
</li>
<li class="layui-nav-item">
<a href="javascript:" id='aConvertor'>Configs Convertor</a>
</li>
</ul>
<div class="layui-container" style="width: 98%" id='predictor'>
<br>
<div>
Model select:
<select id="detModel" class="det">
<option value="blazeface_1000e">blazeface_1000e</option>
<option value="ssdlite_mobilenet_v3_small_320_coco">ssdlite_mobilenet_v3_small_320_coco</option>
<option value="ppyolo_tiny_650e_coco">ppyolo_tiny_650e_coco</option>
<option value="ssd_mobilenet_v1_300_120e_voc">ssd_mobilenet_v1_300_120e_voc</option>
</select>
<select id="clsModel" class='cls' style="display: none">
<option value="efficientnetb0_imagenet">efficientnetb0_imagenet</option>
<option value="mobilenetv3_small_x0_5_imagenet">mobilenetv3_small_x0_5_imagenet</option>
<option value="pplcnet_x0_25_imagenet">pplcnet_x0_25_imagenet</option>
</select>
<select id="segModel" class='seg' style="display: none">
<option value="ppseg_lite_portrait_398x224">ppseg_lite_portrait_398x224</option>
<option value="stdc1_seg_voc12aug_512x512_40k">stdc1_seg_voc12aug_512x512_40k</option>
<option value="bisenet_cityscapes_1024x1024_160k">bisenet_cityscapes_1024x1024_160k</option>
</select>
</div>
<br>
<div class="det">
Draw threshold:
<input type="range" value="0.5" min='0.0' max="1.0" step="0.01" class="drawThreshold">
<input type="number" value="0.5" min='0.0' max="1.0" step="0.01" class="drawThreshold">
</div>
<div class="cls" style="display: none">
TopK:
<input type="range" value="5" min='1' max="10" step="1" class="topK">
<input type="number" value="5" min='1' max="10" step="1" class="topK">
</div>
<div class="seg" style="display: none">
Mixing factor:
<input type="range" value="0.5" min='0.0' max="1.0" step="0.01" class='mixingFactor'>
<input type="number" value="0.5" min='0.0' max="1.0" step="0.01" class='mixingFactor'>
</div>
<br>
<div>
Image infer:
<input type="file" accept="image/*" id="inputFile" disabled='true'>
</div>
<br>
<div>
Camera infer:
<button id='buttonUser' disabled='true'>Open User Camera</button>
<button id='buttonEnv' disabled='true'>Open Environment Camera</button>
</div>
<br>
<div>
<img src="" alt="" id="imgDom" style="display: none">
<video id="videoDom" style="display: none"></video>
<canvas id="canvasDom"></canvas>
</div>
<br>
<div style="display: none" id='tableDiv'>
<table id="tableDom"></table>
</div>
</div>
<div class="layui-container" style="width: 98%; display: none;" id='convertor'>
<form class="layui-form" action="" lay-filter="configs">
<fieldset class="layui-elem-field layui-field-title">
<legend>decode</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">mode</label>
<div class="layui-input-inline" style="width: 40%;">
<select name="mode">
<option value="RGB">RGB</option>
<option value="BGR">BGR</option>
</select>
</div>
</div>
<fieldset class="layui-elem-field layui-field-title">
<legend>resize</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">resize</label>
<div class="layui-input-block">
<input type="checkbox" name="resize" lay-skin="switch" value='true' checked='true'>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">keep ratio</label>
<div class="layui-input-block">
<input type="checkbox" name="keep_ratio" lay-skin="switch" value='true' checked='true'>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">limit max</label>
<div class="layui-input-block">
<input type="checkbox" name="limit_max" lay-skin="switch" value='true'>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">interpolation</label>
<div class="layui-input-inline" style="width: 40%;">
<select name="interp">
<option value="0">cv.INTER_NEAREST [0]</option>
<option value="1" selected='true'>cv.INTER_NEAREST [1]</option>
<option value="2">cv.INTER_CUBIC [2]</option>
<option value="3">cv.INTER_AREA [3]</option>
<option value="4">cv.INTER_LANCZOS4 [4]</option>
<option value="5">cv.INTER_LINEAR_EXACT [5]</option>
<option value="6">cv.INTER_NEAREST_EXACT [6]</option>
<option value="7">cv.INTER_MAX [7]</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">target size</label>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="target_size.h" min='0' step="1" value="320" class="layui-input"
lay-verify="size">
</div>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="target_size.w" min='0' step="1" value="320" class="layui-input"
lay-verify="size">
</div>
</div>
<fieldset class="layui-elem-field layui-field-title">
<legend>crop</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">center crop</label>
<div class="layui-input-block">
<input type="checkbox" name="crop" lay-skin="switch">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">crop size</label>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="crop_size.h" min='0' step="1" value="224" class="layui-input"
lay-verify="size">
</div>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="crop_size.w" min='0' step="1" value="224" class="layui-input"
lay-verify="size">
</div>
</div>
<fieldset class="layui-elem-field layui-field-title">
<legend>normalize</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">scale</label>
<div class="layui-input-block">
<input type="checkbox" name="is_scale" lay-skin="switch" value='true' checked='true'>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">mean</label>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="mean.R" min='0' max="255" step="0.1" value="0.5" class="layui-input"
lay-verify="mean_std">
</div>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="mean.G" min='0' max="255" step="0.1" value="0.5" class="layui-input"
lay-verify="mean_std">
</div>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="mean.B" min='0' max="255" step="0.1" value="0.5" class="layui-input"
lay-verify="mean_std">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">std</label>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="std.R" min='0' max="255" step="0.1" value="0.5" class="layui-input"
lay-verify="mean_std">
</div>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="std.G" min='0' max="255" step="0.1" value="0.5" class="layui-input"
lay-verify="mean_std">
</div>
<div class="layui-input-inline" style="width: 10%;">
<input type="number" name="std.B" min='0' max="255" step="0.1" value="0.5" class="layui-input"
lay-verify="mean_std">
</div>
</div>
<fieldset class="layui-elem-field layui-field-title">
<legend>permute</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">permute</label>
<div class="layui-input-block">
<input type="checkbox" name="permute" lay-skin="switch" value='true' checked='true'>
</div>
</div>
<fieldset class="layui-elem-field layui-field-title">
<legend>label</legend>
</fieldset>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">label list</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name='label_list'></textarea>
</div>
</div>
<div class="layui-form-item">
<div style="text-align:center">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">Download</button>
<button type="button" class="layui-btn layui-btn-warm" id='buttonLoad'>Load<input type="file"
accept=".yaml,.yml,.json" id="inputLoad" class="layui-upload-file"></button>
<button type="reset" class="layui-btn layui-btn-danger">Reset</button>
</div>
</div>
</form>
</div>
<script type="module" src="./main.js"></script>
</body>
</html>