182 lines
6.5 KiB
HTML
182 lines
6.5 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>基于旋律的音乐哼唱检索系统</title>
|
||
<link rel="stylesheet" href="/static/style.css" />
|
||
</head>
|
||
<body>
|
||
<header class="topbar">
|
||
<div class="brand">
|
||
<span class="logo">♪</span>
|
||
<div>
|
||
<h1>基于旋律的音乐哼唱检索系统</h1>
|
||
<p class="subtitle">Query by Humming · YIN 基频提取 + 多码本倒排索引 + 子序列 DTW</p>
|
||
</div>
|
||
</div>
|
||
<div class="topbar-right">
|
||
<div id="status" class="status">加载中…</div>
|
||
<div id="auth" class="auth"></div>
|
||
</div>
|
||
</header>
|
||
|
||
<nav class="tabs">
|
||
<button class="tab active" data-tab="search">哼唱检索</button>
|
||
<button class="tab" data-tab="library">曲库管理</button>
|
||
<button class="tab" data-tab="history">检索历史</button>
|
||
<button class="tab" data-tab="eval">评测与实验</button>
|
||
</nav>
|
||
|
||
<main>
|
||
<!-- ================= 检索 ================= -->
|
||
<section class="tab-panel active" id="tab-search">
|
||
<div class="layout">
|
||
<aside class="panel query-panel">
|
||
<h2>输入查询</h2>
|
||
|
||
<div class="query-mode">
|
||
<button id="btn-record" class="primary big">🎤 开始录音</button>
|
||
<p id="record-hint" class="hint">点击后对着麦克风哼唱 5–15 秒旋律片段</p>
|
||
</div>
|
||
|
||
<div class="divider">或</div>
|
||
|
||
<label class="file-drop">
|
||
<input type="file" id="file-input" accept="audio/*" hidden />
|
||
<span>📁 选择音频文件(WAV / MP3 / FLAC)</span>
|
||
</label>
|
||
|
||
<div class="divider">或</div>
|
||
|
||
<div class="demo-box">
|
||
<div class="demo-row">
|
||
<label for="demo-difficulty">随机示范查询</label>
|
||
<select id="demo-difficulty">
|
||
<option value="easy">简单</option>
|
||
<option value="normal" selected>中等</option>
|
||
<option value="hard">困难</option>
|
||
</select>
|
||
</div>
|
||
<button id="btn-demo" class="secondary big">🎲 生成机器哼唱并检索</button>
|
||
<p class="hint">由合成器模拟人声哼唱(移调 / 变速 / 丢音 / 加噪),答案已知,便于验证系统</p>
|
||
</div>
|
||
|
||
<div class="divider">参数</div>
|
||
<div class="demo-row">
|
||
<label for="top-k">返回条数</label>
|
||
<input type="number" id="top-k" value="10" min="1" max="50" />
|
||
</div>
|
||
|
||
<div id="query-info" class="query-info hidden">
|
||
<h3>识别到的旋律</h3>
|
||
<div id="query-chips" class="chips"></div>
|
||
<canvas id="query-contour" width="420" height="140"></canvas>
|
||
<p id="query-meta" class="hint"></p>
|
||
<audio id="query-audio" controls class="hidden"></audio>
|
||
</div>
|
||
</aside>
|
||
|
||
<section class="panel results-panel">
|
||
<div class="results-head">
|
||
<h2>检索结果</h2>
|
||
<span id="results-meta" class="hint"></span>
|
||
</div>
|
||
<div id="demo-banner" class="banner hidden"></div>
|
||
<div id="results" class="results">
|
||
<p class="placeholder">还没有查询。录一段哼唱、上传音频,或点「生成机器哼唱」试试。</p>
|
||
</div>
|
||
|
||
<div id="alignment-wrap" class="alignment hidden">
|
||
<h3>DTW 对齐</h3>
|
||
<canvas id="alignment" width="880" height="300"></canvas>
|
||
<p class="hint">左列为哼唱查询,右列为命中曲目片段;连线表示对齐路径,颜色越红表示音高偏差越大。</p>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- ================= 曲库 ================= -->
|
||
<section class="tab-panel" id="tab-library">
|
||
<div class="panel">
|
||
<div class="results-head">
|
||
<h2>曲库(<span id="lib-count">0</span> 首)</h2>
|
||
<div class="lib-actions">
|
||
<label class="button-like">
|
||
<input type="file" id="import-file" accept=".mid,.midi,audio/*" hidden />
|
||
导入 MIDI / 音频
|
||
</label>
|
||
<button id="btn-rebuild" class="secondary">重建索引</button>
|
||
</div>
|
||
</div>
|
||
<div class="table-wrap">
|
||
<table id="song-table">
|
||
<thead>
|
||
<tr><th>曲目</th><th>来源</th><th>标签</th><th>音符数</th><th>时长</th><th>操作</th></tr>
|
||
</thead>
|
||
<tbody></tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- ================= 历史 ================= -->
|
||
<section class="tab-panel" id="tab-history">
|
||
<div class="panel">
|
||
<div class="results-head">
|
||
<h2>检索历史</h2>
|
||
<button id="btn-clear-history" class="secondary">清空</button>
|
||
</div>
|
||
<p class="hint" id="history-scope"></p>
|
||
<div class="table-wrap">
|
||
<table id="history-table">
|
||
<thead>
|
||
<tr><th>时间</th><th>来源</th><th>查询音符</th><th>最佳匹配</th><th>分数</th><th>耗时</th></tr>
|
||
</thead>
|
||
<tbody></tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- ================= 评测 ================= -->
|
||
<section class="tab-panel" id="tab-eval">
|
||
<div class="layout">
|
||
<div class="panel">
|
||
<h2>运行评测</h2>
|
||
<p class="hint">用合成哼唱查询跑完整流水线,统计 Top-K / MRR / 粗召回率 / 延迟。</p>
|
||
<div class="demo-row">
|
||
<label for="eval-difficulty">难度</label>
|
||
<select id="eval-difficulty">
|
||
<option value="easy">简单</option>
|
||
<option value="normal" selected>中等</option>
|
||
<option value="hard">困难</option>
|
||
</select>
|
||
</div>
|
||
<div class="demo-row">
|
||
<label for="eval-per-song">每首查询数</label>
|
||
<input type="number" id="eval-per-song" value="2" min="1" max="10" />
|
||
</div>
|
||
<button id="btn-eval" class="primary big">▶ 开始评测</button>
|
||
<p id="eval-status" class="hint"></p>
|
||
</div>
|
||
<div class="panel">
|
||
<h2>最近一次评测</h2>
|
||
<div id="eval-report"><p class="placeholder">暂无评测报告。</p></div>
|
||
</div>
|
||
</div>
|
||
<div class="panel" id="noise-panel">
|
||
<h2>噪声鲁棒性实验</h2>
|
||
<div id="noise-report"><p class="placeholder">尚未运行(可执行 <code>python -m scripts.noise_experiment</code>)。</p></div>
|
||
</div>
|
||
</section>
|
||
</main>
|
||
|
||
<footer class="footer">
|
||
<span>本系统为课程/科研用途实现,曲库含公版旋律与合成旋律。</span>
|
||
</footer>
|
||
|
||
<script src="/static/app.js"></script>
|
||
</body>
|
||
</html>
|