-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.html.jinja2
374 lines (287 loc) · 19.6 KB
/
base.html.jinja2
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="OlaWod">
<title>Voice Conversion MOS Page</title>
<!-- Bootstrap core CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!-- Custom styles for this template -->
<link href="css/clean-blog.css" rel="stylesheet">
<link rel="stylesheet" href="./css/fontawesome.all.min.css">
<script defer src="./js/fontawesome.all.min.js"></script>
<!-- Bootstrap core JavaScript -->
<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/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<!-- Custom scripts for this template -->
<script src="js/clean-blog.js"></script>
<script src="js/interp.js"></script>
<script>
const rows = [["1", "1", "vc/wav2vec-vc/vctk/237_126133_0024-F_p244_008.wav"], ["1", "2", "vc/vqmivc/vctk/237_126133_0024-F_p244_008.wav"], ["1", "3", "vc/ours/vctk/237_126133_0024-F_p244_008.wav"], ["1", "4", "vc/yourtts/vctk/237_126133_0024-F_p244_008.wav"], ["2", "1", "vc/vqmivc/vctk/260_123440_0009-F_p294_016.wav"], ["2", "2", "vc/yourtts/vctk/260_123440_0009-F_p294_016.wav"], ["2", "3", "vc/wav2vec-vc/vctk/260_123440_0009-F_p294_016.wav"], ["2", "4", "vc/ours/vctk/260_123440_0009-F_p294_016.wav"], ["3", "1", "vc/ours/vctk/2300_131720_0034-M_p278_023.wav"], ["3", "2", "vc/wav2vec-vc/vctk/2300_131720_0034-M_p278_023.wav"], ["3", "3", "vc/yourtts/vctk/2300_131720_0034-M_p278_023.wav"], ["3", "4", "vc/vqmivc/vctk/2300_131720_0034-M_p278_023.wav"], ["4", "1", "vc/vqmivc/vctk/1995_1826_0005-M_p254_023.wav"], ["4", "2", "vc/wav2vec-vc/vctk/1995_1826_0005-M_p254_023.wav"], ["4", "3", "vc/ours/vctk/1995_1826_0005-M_p254_023.wav"], ["4", "4", "vc/yourtts/vctk/1995_1826_0005-M_p254_023.wav"], ["5", "1", "vc/ours/vctk/908_31957_0006-M_p258_228.wav"], ["5", "2", "vc/vqmivc/vctk/908_31957_0006-M_p258_228.wav"], ["5", "3", "vc/wav2vec-vc/vctk/908_31957_0006-M_p258_228.wav"], ["5", "4", "vc/yourtts/vctk/908_31957_0006-M_p258_228.wav"], ["6", "1", "vc/vqmivc/vctk/672_122797_0046-F_p244_008.wav"], ["6", "2", "vc/yourtts/vctk/672_122797_0046-F_p244_008.wav"], ["6", "3", "vc/ours/vctk/672_122797_0046-F_p244_008.wav"], ["6", "4", "vc/wav2vec-vc/vctk/672_122797_0046-F_p244_008.wav"], ["7", "1", "vc/yourtts/vctk/1089_134691_0014-F_p294_016.wav"], ["7", "2", "vc/vqmivc/vctk/1089_134691_0014-F_p294_016.wav"], ["7", "3", "vc/ours/vctk/1089_134691_0014-F_p294_016.wav"], ["7", "4", "vc/wav2vec-vc/vctk/1089_134691_0014-F_p294_016.wav"], ["8", "1", "vc/vqmivc/vctk/1188_133604_0022-F_p257_023.wav"], ["8", "2", "vc/ours/vctk/1188_133604_0022-F_p257_023.wav"], ["8", "3", "vc/yourtts/vctk/1188_133604_0022-F_p257_023.wav"], ["8", "4", "vc/wav2vec-vc/vctk/1188_133604_0022-F_p257_023.wav"], ["9", "1", "vc/yourtts/vctk/61_70968_0053-M_p278_023.wav"], ["9", "2", "vc/ours/vctk/61_70968_0053-M_p278_023.wav"], ["9", "3", "vc/wav2vec-vc/vctk/61_70968_0053-M_p278_023.wav"], ["9", "4", "vc/vqmivc/vctk/61_70968_0053-M_p278_023.wav"], ["10", "1", "vc/wav2vec-vc/vctk/1995_1837_0000-M_p278_023.wav"], ["10", "2", "vc/yourtts/vctk/1995_1837_0000-M_p278_023.wav"], ["10", "3", "vc/ours/vctk/1995_1837_0000-M_p278_023.wav"], ["10", "4", "vc/vqmivc/vctk/1995_1837_0000-M_p278_023.wav"], ["11", "1", "vc/wav2vec-vc/vctk/908_157963_0014-F_p244_008.wav"], ["11", "2", "vc/vqmivc/vctk/908_157963_0014-F_p244_008.wav"], ["11", "3", "vc/yourtts/vctk/908_157963_0014-F_p244_008.wav"], ["11", "4", "vc/ours/vctk/908_157963_0014-F_p244_008.wav"], ["12", "1", "vc/wav2vec-vc/vctk/1580_141083_0025-M_p258_228.wav"], ["12", "2", "vc/ours/vctk/1580_141083_0025-M_p258_228.wav"], ["12", "3", "vc/vqmivc/vctk/1580_141083_0025-M_p258_228.wav"], ["12", "4", "vc/yourtts/vctk/1580_141083_0025-M_p258_228.wav"], ["13", "1", "vc/ours/vctk/61_70968_0006-F_p257_023.wav"], ["13", "2", "vc/wav2vec-vc/vctk/61_70968_0006-F_p257_023.wav"], ["13", "3", "vc/yourtts/vctk/61_70968_0006-F_p257_023.wav"], ["13", "4", "vc/vqmivc/vctk/61_70968_0006-F_p257_023.wav"], ["14", "1", "vc/vqmivc/vctk/260_123286_0022-M_p254_023.wav"], ["14", "2", "vc/wav2vec-vc/vctk/260_123286_0022-M_p254_023.wav"], ["14", "3", "vc/yourtts/vctk/260_123286_0022-M_p254_023.wav"], ["14", "4", "vc/ours/vctk/260_123286_0022-M_p254_023.wav"], ["15", "1", "vc/vqmivc/vctk/1089_134686_0000-F_p257_023.wav"], ["15", "2", "vc/yourtts/vctk/1089_134686_0000-F_p257_023.wav"], ["15", "3", "vc/ours/vctk/1089_134686_0000-F_p257_023.wav"], ["15", "4", "vc/wav2vec-vc/vctk/1089_134686_0000-F_p257_023.wav"]]
function myFunction(){
console.log("Button clicked!");
var res = {};
var s = "";
var i = 1;
$("input[type='radio']:checked").each(function(){
var name = $(this).attr('name');
var id = $(this).attr('id')
var value = $(this).val();
res[name]=value;
s = s + String(id) + "|" + String(name) + "|" + String(value) + "<br>";
i = i + 1;
});
console.log(res);
document.getElementById("result").innerHTML = s;
alert("已更新结果");
}
function populateAudioGroup() {
let num = document.getElementById("audio-group-selector").value;
let inner_div = document.createElement("div");
let utt = num;
let table = document.createElement("table");
table.className = "mdl-data-table";
let headerRow = table.createTHead().insertRow();
// Define your headers or use the appropriate values
let headers = ["ID ", "Score wav", "MOS Score"];
headers.forEach((header) => {
let th = document.createElement("th");
th.scope = "col";
th.innerText = header;
headerRow.appendChild(th);
});
console.log(rows);
// 清除先前的音频控件
rows.filter(wav => Number(wav[0]) === Number(num)).forEach(wav => {
let row = table.insertRow();
row.insertCell().innerText = num + '-' + wav[1]; // Assuming id is at index 0
// Add audio controls for Score Audio
let scoreAudioCell = row.insertCell();
let scoreAudio = createAudio(wav[2]);
scoreAudioCell.appendChild(scoreAudio);
// Input for Score
let scoreInputCell = row.insertCell();
let scoreInputContainer = document.createElement("div");
scoreInputContainer.style.marginBottom = "10px"; // Set the margin-bottom property to 10 pixels
let scoreInputLabel = document.createElement("label");
scoreInputContainer.appendChild(scoreInputLabel);
for (let i = 1; i <= 5; i++) {
let scoreInput = document.createElement("input");
scoreInput.type = "radio";
scoreInput.value = i;
scoreInput.id = (num-1)*4 + Number(wav[1]);
scoreInput.name = wav[2];
let scoreInputLabel = document.createElement("label");
scoreInputLabel.innerHTML = i;
scoreInputLabel.setAttribute("for", scoreInput.id);
scoreInputContainer.appendChild(scoreInput);
scoreInputContainer.appendChild(scoreInputLabel);
if (i === 1) {
scoreInput.checked = true;
}
}
scoreInputCell.appendChild(scoreInputContainer);
});
let uttTitle = document.createTextNode("Utterance " + utt);
let uttTitleEl = document.createElement("h6");
uttTitleEl.appendChild(uttTitle);
inner_div.appendChild(uttTitleEl);
inner_div.appendChild(table);
var div = document.getElementById("audio-example");
div.innerHTML = inner_div.innerHTML;
}
function createAudio(utterance) {
const audio = document.createElement("audio");
audio.controls = "controls";
audio.preload = "none";
audio.src = utterance;
audio.innerText = "Your browser does not support the audio element.";
return audio;
}
document.addEventListener("DOMContentLoaded", function() {
populateAudioGroup();
});
</script>
<script>
function copyText() {
// 获取要复制的文本
var textToCopy = document.getElementById("result");
// 创建一个文本域元素
var textarea = document.createElement("textarea");
// 将要复制的文本设置为文本域的值
textarea.value = textToCopy.innerText;
// 将文本域添加到文档中
document.body.appendChild(textarea);
// 选择文本域中的文本
textarea.select();
// 尝试执行复制操作
document.execCommand('copy');
// 移除文本域元素
document.body.removeChild(textarea);
// 提示用户已复制文本
alert("已复制文本: " + textToCopy.innerText);
}
</script>
</head>
<body id="page-top">
<nav class="navbar navbar-expand-lg fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">MOS Test For Voice Conversion</a>
<button class="navbar-toggler navbar-toggler-right font-weight-bold text-white rounded" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">Menu <i class="fas fa-bars"></i></button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#MOS-1">具体评分标准</a>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#MOS-2">测试说明</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#vctk">听音序列</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#result">结果提交</a></li>
</ul>
</div>
</div>
</nav>
<!-- Page Header -->
<header class="masthead" style="background-image: url('img/home-bg.jpg')">
<div class="container" style="padding-bottom:10px">
<div class="row">
<div class="col-lg-10 col-md-10 mx-auto">
<div class="site-heading">
<h1>MOS Test For Voice Conversion</h1>
<span class="subheading">
<h3>Thanks for your listening!</h3>
</span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<div class="container">
<div class="site-heading" id="MOS-1">
<h3>具体MOS评分标准</h3>
<table border="1">
<tr>
<th>分数区间</th>
<th>主观感受描述</th>
</tr>
<tr>
<td>5</td>
<td><b>Excellent</b> (超好,挑不出瑕疵)</td>
</tr>
<tr>
<td>4</td>
<td><b>Good</b> (很好,但总觉得还不够完美)</td>
</tr>
<tr>
<td>3</td>
<td> <b>Fair</b> (不太差但也不太好,可能有点小噪音或者有点糊)</td>
</tr>
<tr>
<td>2</td>
<td><b>Poor</b> (很差,但能听清在说啥)</td>
</tr>
<tr>
<td>1</td>
<td><b>Bad </b>(超差,根本听不清在说啥)</td>
</tr>
</table>
</div>
<div class="site-heading" id="MOS-2">
<h3 style="font-weight: bold;">示例</h3>
<p><b>1 - Bad</b> (超差,根本听不清在说啥)</p>
<p>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/1/sys50bf1-utt028ce17.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/1/sys9525c-utta8b7c9d.wav">
</audio>
</p>
<p><b>2 - Poor</b> (很差,但能听清在说啥)</p>
<p>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/2/sys4a150-utt7e6ea4e.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/2/sys50bf1-utt6cbfd7d.wav">
</audio>
</p>
<p><b>3 - Fair</b> (不太差但也不太好,可能有点小噪音或者有点糊)</p>
<p>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/3/sysdde30-uttc13179a.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/3/sysbce79-uttdbc8f15.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/3/sys50848-utt009c19b.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/3/sysd2ea4-uttd8cf886.wav">
</audio>
</p>
<p><b>4 - Good</b> (很好,但总觉得还不够完美)</p>
<p>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/4/sys2a001-utt4feda8b.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/4/sys2a001-utt6850d2c.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/4/sys2a001-uttd470593.wav">
</audio>
</p>
<p><b>5 - Excellent</b> (超好,挑不出瑕疵)</p>
<p>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/5/sysf9ead-utt06699b0.wav">
</audio>
<audio controls preload="none">
<source src="https://vcmos.oss-cn-shenzhen.aliyuncs.com/mos/5/sys8f532-uttb91937f.wav">
</audio>
</p>
<h3 style="font-weight: bold;">测试说明</h3>
<p style="font-style: italic; margin-bottom: 14px;">
MOS:评估转换后语音质量;<br>
SMOS:评估转换后语音的说话人和目标语音的说话人相似性。</p>
<p>请在安静环境下,戴上耳机进行听音</p>
<p style="font-weight: bold; margin-bottom: 14px;">每次通过下方选项框从1-15组语音中选择一组进行听音测试,测试分数输入为0-5,输入至Score分数框中。每次听完一组测试,点击下方submit按钮,点击后下方会显示听音结果,将该结果复制到<b>mos.txt</b>文件进行保存,每组测试结果依次放在同一个<b>mos.txt</b>文件中。<br>
(注:此页面没有 cookie,所以打分的时候别刷新,刷新就得重新打分了) (不过可以按多次 submit,想改答案的话就改了然后再按一次 submit)
</p>
</div>
<div class="row">
<div class="post-preview" id="vctk">
<h3 class="title">Audio Examples</h3>
<label for="audio-group-selector">Select Audio Group:</label>
<select id="audio-group-selector" onchange="populateAudioGroup()">
{% for group_id in range(1, 16) %}
{% if group_id == 1 %}
<option value="{{group_id}}" selected>{{1}}</option>
{% else %}
<option value="{{group_id}}">{{group_id}}</option>
{% endif %}
{% endfor %}
</select>
</div>
<br /><br />
<div class="content has-text-justified" id="audio-example">
<div class="audio-group-content" id="audio-group-content">
<!-- This div will be populated with the selected audio group content -->
</div>
</div>
<div class="col-lg-14 col-md-12 mx-auto">
<hr>
<input type="button" value="Submit" onclick="myFunction()">
<input type="button" value="Copy" onclick="copyText()">
<p id="result">Results:</p>
<hr>
</div>
</div>
</body>
</html>