-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
157 lines (157 loc) · 10.7 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
<!doctype html>
<html>
<head>
<link rel='icon' type='image/png' href='assets/icon.png' />
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ASR</title>
<script src='scripts/ffmpeg/ffmpeg.min.js'></script>
<!-- Load ONNX.js --><!-- <script src='https://cdn.jsdelivr.net/npm/onnxjs/dist/onnx.min.js'></script>-->
<script>
(function(window, undefined) {
const s = document.createElement('script');
const env = location.hostname === '' ? 'offline' : 'online';
s.src = `scripts/onnxruntime/ort.min.${env}.js`;
document.head.appendChild(s);
})(this);
</script>
<script src='scripts/upng/UPNG.js'></script>
<link rel='stylesheet' href='media/style.css'/>
</head>
<body>
<div id='blocker'>
<p>Loading..</p>
</div>
<h3 id='title'>Timestamps detection</h3>
<img id='output-video'></img><br />
<div id='dropZone'>
<!-- ondrop='dropHandler(event);' ondragover='dragOverHandler(event);'>-->
<p id='file_info'>Drag one file to this Drop Zone... (Audio or video)</p>
<div class='flex'>
<input type='file' id='uploader' class='flex_item'/>
<button type='button' id='test' class='flex_item'>Demo File</button>
</div>
<div id='progring' hidden>
<div class="cancel">
<!--<img src='assets/stop-button.svg'/>-->
</div>
<div class="circular">
<div class="inner"></div>
<div class="number">0%</div>
<div class="circle">
<div class="bar left">
<div class="progress"></div>
</div>
<div class="bar right">
<div class="progress"></div>
</div>
</div>
</div>
</div>
</div>
<div id='settings_svg'>
<!-- onclick='updateContent()'>-->
<svg width='32px' height='32px' style='enable-background:new 0 0 24 24;' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'>
<title>Окно настроек</title>
<g>
<path d='m13.12 24h-2.24c-.757 0-1.396-.567-1.486-1.32l-.239-1.876c-.477-.155-.937-.346-1.374-.569l-1.494 1.161c-.606.469-1.459.415-1.985-.126l-1.575-1.575c-.537-.521-.591-1.374-.122-1.979l1.161-1.495c-.224-.437-.415-.897-.569-1.374l-1.88-.239c-.75-.092-1.317-.731-1.317-1.488v-2.24c0-.757.567-1.396 1.32-1.486l1.876-.239c.155-.477.346-.937.569-1.374l-1.16-1.494c-.47-.606-.415-1.46.127-1.986l1.575-1.575c.521-.537 1.375-.59 1.979-.122l1.494 1.162c.437-.223.897-.414 1.375-.569l.239-1.88c.09-.75.729-1.317 1.486-1.317h2.24c.757 0 1.396.567 1.486 1.32l.239 1.876c.478.155.938.346 1.375.569l1.494-1.161c.607-.469 1.459-.415 1.985.127l1.575 1.575c.537.521.591 1.374.122 1.979l-1.161 1.495c.224.437.415.897.569 1.374l1.88.239c.749.091 1.316.73 1.316 1.487v2.24c0 .757-.567 1.396-1.32 1.486l-1.876.239c-.155.477-.346.937-.569 1.374l1.161 1.494c.47.606.415 1.459-.127 1.985l-1.575 1.575c-.521.537-1.375.592-1.979.122l-1.495-1.161c-.437.224-.897.415-1.374.569l-.239 1.88c-.091.75-.73 1.317-1.487 1.317zm-5.39-4.86c.083 0 .168.021.244.063.551.308 1.148.556 1.774.736.192.055.333.219.358.417l.28 2.2c.03.251.247.444.494.444h2.24c.247 0 .464-.193.493-.439l.281-2.204c.025-.198.166-.362.358-.417.626-.18 1.223-.428 1.774-.736.175-.098.393-.081.55.042l1.75 1.36c.201.156.483.143.655-.034l1.585-1.585c.181-.176.195-.458.039-.66l-1.36-1.75c-.123-.158-.14-.375-.042-.55.308-.551.556-1.148.736-1.774.055-.192.219-.333.417-.358l2.2-.28c.251-.031.444-.248.444-.495v-2.24c0-.247-.193-.464-.439-.493l-2.204-.281c-.198-.025-.362-.166-.417-.358-.18-.626-.428-1.223-.736-1.774-.098-.175-.082-.392.042-.55l1.36-1.75c.157-.202.143-.484-.033-.654l-1.585-1.585c-.175-.182-.458-.196-.66-.039l-1.75 1.36c-.159.123-.376.14-.551.042-.549-.308-1.146-.555-1.774-.736-.192-.055-.333-.219-.358-.417l-.28-2.2c-.031-.252-.248-.445-.495-.445h-2.24c-.247 0-.464.193-.493.439l-.281 2.204c-.025.198-.166.362-.358.418-.628.18-1.225.428-1.774.735-.175.099-.392.081-.551-.041l-1.75-1.36c-.202-.157-.483-.143-.654.033l-1.585 1.586c-.181.176-.195.458-.039.66l1.36 1.75c.123.158.14.375.042.55-.309.551-.556 1.148-.736 1.774-.055.192-.219.333-.417.358l-2.2.28c-.251.03-.444.247-.444.494v2.24c0 .247.193.464.439.493l2.204.281c.198.025.362.166.417.358.18.626.428 1.223.736 1.774.098.175.082.392-.042.55l-1.36 1.75c-.157.202-.143.484.033.654l1.585 1.585c.175.181.456.195.66.039l1.75-1.36c.091-.068.199-.104.308-.104z'/>
<path d='m12 17c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5zm0-9c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4z'/>
</g>
</svg>
</div>
<div id="lang_switcher">
<a id='lang_ru'>RU</a>
<span>/</span>
<a id='lang_en'>EN</a>
</div>
<div id='micro_svg'>
<svg width='32px' height='32px' fill='#000' style='enable-background:new 0 0 490 490;' viewBox='0 0 490 490' xmlns='http://www.w3.org/2000/svg'>
<title>Записать звук</title>
<g>
<path d="M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5 C149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5 c0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z"/>
<path d="M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3 s5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8 c0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9 C106.6,220,101.2,214.5,94.4,214.5z"/>
</g>
</svg>
</div>
<p id='message'></p>
<div>
<div class='group'>
<svg width='32px' height='32px' version='1.1' id='prev' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'
viewBox='0 0 512 512' style='enable-background:new 0 0 512 512;' xml:space='preserve'>
<title>Предыдущая временная метка</title>
<path d='M256,0C114.618,0,0,114.618,0,256s114.618,256,256,256s256-114.618,256-256S397.382,0,256,0z M256,469.333
c-117.818,0-213.333-95.515-213.333-213.333S138.182,42.667,256,42.667S469.333,138.182,469.333,256S373.818,469.333,256,469.333
z'/>
<path d='M313.752,134.248c-8.331-8.331-21.839-8.331-30.17,0L176.915,240.915c-8.331,8.331-8.331,21.839,0,30.17l106.667,106.667
c8.331,8.331,21.839,8.331,30.17,0c8.331-8.331,8.331-21.839,0-30.17L222.17,256l91.582-91.582
C322.083,156.087,322.083,142.58,313.752,134.248z'/>
</svg>
</div>
<div class='group'>
<audio id='audiofile' controls='controls' type='audio/wav'></audio>
</div>
<div class='group'>
<svg width='32px' height='32px' version='1.1' id='next' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'
viewBox='0 0 512 512' style='enable-background:new 0 0 512 512;' xml:space='preserve'>
<title>Следующая временная метка</title>
<path d='M256,0C114.618,0,0,114.618,0,256s114.618,256,256,256s256-114.618,256-256S397.382,0,256,0z M256,469.333
c-117.818,0-213.333-95.515-213.333-213.333S138.182,42.667,256,42.667S469.333,138.182,469.333,256S373.818,469.333,256,469.333
z'/>
<path d='M228.418,134.248c-8.331-8.331-21.839-8.331-30.17,0c-8.331,8.331-8.331,21.839,0,30.17L289.83,256l-91.582,91.582
c-8.331,8.331-8.331,21.839,0,30.17c8.331,8.331,21.839,8.331,30.17,0l106.667-106.667c8.331-8.331,8.331-21.839,0-30.17
L228.418,134.248z'/>
</svg>
</div>
<div class='group'>
<svg width='32px' height='32px' version='1.1' id='expand' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px'
viewBox='0 0 512 512' style='enable-background:new 0 0 512 512;' xml:space='preserve'>
<title>Развернуть/свернуть список временных меток</title>
<path d='M256,0C114.618,0,0,114.618,0,256s114.618,256,256,256s256-114.618,256-256S397.382,0,256,0z M256,469.333
c-117.818,0-213.333-95.515-213.333-213.333S138.182,42.667,256,42.667S469.333,138.182,469.333,256S373.818,469.333,256,469.333
z'/>
<path d='M347.582,198.248L256,289.83l-91.582-91.582c-8.331-8.331-21.839-8.331-30.17,0c-8.331,8.331-8.331,21.839,0,30.17
l106.667,106.667c8.331,8.331,21.839,8.331,30.17,0l106.667-106.667c8.331-8.331,8.331-21.839,0-30.17
C369.42,189.917,355.913,189.917,347.582,198.248z'/>
</svg>
</div>
</div>
<div id='actions' hidden>
<div class='group'><img id='undo' src='assets/undo.svg' title='Отмена'/></div>
<div class='group'><img id='copy' src='assets/copy.svg' title='Скопировать в буфер'/></div>
</div>
<pre id='timestamps' hidden></pre>
<div class='content' hidden>
<p>
<input type='file' id='model' />
<label for='model'>Model</label>
</p>
<p>
<input type='number' name='offset' id='offset' min='0' value='0'/>
<label for='offset'>Offset</label>
</p>
<p>
<input type='number' name='duration' id='duration' min='1' max='1000' value='50'/>
<label for='duration'>Duration</label>
</p>
<p>
<div class='group'>
<input type='range' step=0.05 name='threshold' id='threshold' min='-3.0' max='3.0' value='0.0'/>
<label for='threshold'>Threshold</label>
</div>
<div class='group thrval'>0.0</div>
</p>
<p>
<button type='button' id='process'>Compute all</button>
</p>
<p>
<button type='button' id='compute'>Compute segment</button>
</p>
<p>
<button type='button' id='reset'>Reset</button>
</p>
</div>
<script async src='scripts/logic.js'></script>
<!--<script src='scripts/onnxruntime/ort.wasm.js' async onload="createURLfromHexObject(ortWasm,['wasmBinaryFile','lt'], 'decode onnxWasm')"></script>
<script src='scripts/model/asr.hex.js' async onload="createURLfromHexObject(modelHex,['modelPath'], 'decode ASRmodel')"></script>-->
</body>
</html>