Views
No views yet
linkseg-web —
LinkSeg.load() fetches this file (OPFS-cached) and runs the full pipeline.M. Buisson, B. McFee, S. Essid — Using Pairwise Link Prediction and Graph Attention Networks for Music Structure Analysis, ISMIR 2024.
cdist,
GroupNorm, EMA adaptive-pool and batch-stat BatchNorm decomposed to ONNX-standard ops) does not
modify the learned parameters and was validated byte-exact against the original PyTorch/DGL model.
The port/glue code (the linkseg-web package) is MIT; the model weights remain CC-BY 4.0.N. ~1.5 MB.mel: float32 (N, 1, 64, 64) — per-beat log-mel windows. torchaudio
MelSpectrogram(sr=22050, n_fft=1024, hop=256, n_mels=64, f_min=0, f_max=11025, power=2) +
AmplitudeToDB(power), computed on the client (STFT stays out of the graph). N = number of
(requantized) beats; needs ≥ 4.bound (N-1,) — per-adjacent-beat boundary activations (sigmoid).label (N, 7) — class logits over {silence, verse, chorus, intro, outro, inst, bridge}.apred (N, N, 3) — pairwise link logits (not used by the default decoder).1import {LinkSeg} from 'linkseg-web';
2
3const model = await LinkSeg.load(); // downloads this ONNX, caches in OPFS; WebGPU→WASM
4const sections = await model.analyze({
5 audio, // Float32Array, mono (resampled to 22050 internally if needed)
6 sampleRate, // e.g. 44100
7 beats, // number[] beat times in seconds (your beat tracker)
8});
9// → [{ start, end, label }, ...]