Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Evaluation: the separation suite, its test mixes with known stems, and stems you can hear in the report and blind review

Claude54b634a4ae10
diff --git a/scripts/eval/cases/case.schema.json b/scripts/eval/cases/case.schema.json
index 98662c7d..59cd3821 100644
--- a/scripts/eval/cases/case.schema.json
+++ b/scripts/eval/cases/case.schema.json
@@ -541,7 +541,9 @@
"temporal",
"lipsync",
"continuity",
- "palette"
+ "palette",
+ "separation",
+ "wer"
]
}
},
@@ -1285,7 +1287,9 @@
"temporal",
"lipsync",
"continuity",
- "palette"
+ "palette",
+ "separation",
+ "wer"
]
}
},
diff --git a/scripts/eval/cases/separation.json b/scripts/eval/cases/separation.json
new file mode 100644
index 00000000..43bc311b
--- /dev/null
+++ b/scripts/eval/cases/separation.json
@@ -0,0 +1,243 @@
+{
+ "$schema": "./case.schema.json",
+ "suite": "separation",
+ "title": "Soundtrack separation · dialogue, music and effects",
+ "description": "Generated by scripts/eval/gen-cases.mjs from the research files; edit the generator, not this file. Synthetic 12 s mixes with known stems (python3 -I scripts/eval/fixtures/make-separation.py --speech <folder> writes them into local/separation/; the speech is yours to bring with its words, the music, effects, hum and hiss are synthesized there, CC0) and your own clip for the blind review. Scores each stem against its known part (SI-SDR, SDR), whether voice + bed add back up to the input, the bed's level, peak and stereo image against the known bed, where a steady hum or hiss goes, the dialogue's word error rate (Whisper base.en, pnpm eval:setup --asr; werInput is the same ASR on the input as it is, which is \"Clean the voice first\" off) and the speed from ComfyUI-DBS's report. Licences (information): DBS-TIGER-DnR Apache-2.0 (JusperLee/DBS-TIGER-DnR@22da7d4c; trained on DnR v2 (CC BY 4.0), from scratch); DBS-BSRNN-DnR Apache-2.0 (JusperLee/DBS-BSRNN-DnR@5af343f5; trained on DnR v2 (CC BY 4.0), from scratch); ComfyUI-DBS MIT; MelBand RoFormer MIT; Demucs MIT; the test mixes' sources are recorded in each mix's meta.json. SAM Audio isn't here: it is not offered on the cloud engine.",
+ "original": [
+ "oss-dbs-separate",
+ "oss-dbs-voice-separate"
+ ],
+ "kind": "audio",
+ "decides": "Defaults change only on these numbers, in a reviewed code change: the open split's model per host (src/lib/av/split.ts) is the faster model unless the other wins dialogue SI-SDR by more than 1 dB on most mixes at a speed the host can live with (a minute of audio in under 5 minutes on a CPU); stereo stems (each channel) become the default only if the fast stereo bed loses its stereo image (bed stereo gap over 0.1) or its level (over 1 dB) on the centred mixes; the dub's voice split (src/lib/av/dub.ts DEFAULT_VOICE_SPLIT) moves to DBS when its dialogue WER is no worse than MelBand RoFormer's and its bed keeps the music and effects (background SI-SDR at least 3 dB higher).",
+ "targets": {
+ "open": {
+ "models": [
+ "oss-dbs-separate"
+ ],
+ "op": "separate-audio"
+ },
+ "cloud": {
+ "models": [
+ "demucs"
+ ],
+ "op": "separate-audio"
+ },
+ "demo": {
+ "models": [
+ "oss-dbs-separate"
+ ],
+ "op": "separate-audio"
+ }
+ },
+ "defaults": {
+ "seeds": [
+ 1001
+ ],
+ "metrics": [
+ "separation",
+ "wer"
+ ],
+ "variant": "bsrnn-mono",
+ "candidate": "bsrnn-mono",
+ "timeoutSeconds": 3600
+ },
+ "variants": {
+ "bsrnn-mono": {
+ "description": "DBS-BSRNN (fast), mono: stems from the channels' mean, the bed is the original minus the speech (the fast stereo bed)",
+ "extra": {
+ "separationModel": "DBS-BSRNN-DnR",
+ "channels": "mono"
+ },
+ "engines": [
+ "open",
+ "demo"
+ ]
+ },
+ "bsrnn-stereo": {
+ "description": "DBS-BSRNN, each channel: every channel separated on its own (twice the time for stereo)",
+ "extra": {
+ "separationModel": "DBS-BSRNN-DnR",
+ "channels": "each channel"
+ },
+ "engines": [
+ "open"
+ ]
+ },
+ "tiger-mono": {
+ "description": "DBS-TIGER (best), mono",
+ "extra": {
+ "separationModel": "DBS-TIGER-DnR",
+ "channels": "mono"
+ },
+ "engines": [
+ "open"
+ ]
+ },
+ "tiger-stereo": {
+ "description": "DBS-TIGER, each channel",
+ "extra": {
+ "separationModel": "DBS-TIGER-DnR",
+ "channels": "each channel"
+ },
+ "engines": [
+ "open"
+ ]
+ },
+ "dbs-dub": {
+ "description": "The dub's first step with DBS (graph B: DBS-BSRNN voice and bed, then Qwen3-ASR 0.6B on the voice)",
+ "models": {
+ "open": [
+ "oss-dbs-voice-separate"
+ ]
+ },
+ "extra": {
+ "separationModel": "DBS-BSRNN-DnR",
+ "asrModel": "Qwen/Qwen3-ASR-0.6B-hf"
+ },
+ "engines": [
+ "open"
+ ]
+ },
+ "melband": {
+ "description": "The dub's first step with MelBand RoFormer (a vocals model; voice and background only, then Qwen3-ASR 0.6B)",
+ "models": {
+ "open": [
+ "oss-voice-separate"
+ ]
+ },
+ "extra": {
+ "asrModel": "Qwen/Qwen3-ASR-0.6B-hf"
+ },
+ "engines": [
+ "open"
+ ]
+ },
+ "demucs": {
+ "description": "Demucs (htdemucs on fal, as today's cloud dub uses it): vocals against drums, bass and other, summed into the bed",
+ "models": {
+ "cloud": [
+ "demucs"
+ ]
+ },
+ "engines": [
+ "cloud"
+ ]
+ }
+ },
+ "cases": [
+ {
+ "id": "separation/centre",
+ "title": "Dialogue in the centre over music and effects",
+ "inputs": {
+ "audio": "local/separation/centre/mix.flac"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "references": "local/separation/centre",
+ "tags": [
+ "synthetic",
+ "audio-only"
+ ],
+ "note": "the reference mix: every stem against its known part"
+ },
+ {
+ "id": "separation/off-centre",
+ "title": "Dialogue panned left over the same music and effects",
+ "inputs": {
+ "audio": "local/separation/off-centre/mix.flac"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "references": "local/separation/off-centre",
+ "tags": [
+ "synthetic",
+ "audio-only"
+ ],
+ "note": "the fast stereo bed (mono speech subtracted from each channel) leaves part of off-centre speech in the bed"
+ },
+ {
+ "id": "separation/hum",
+ "title": "Dialogue with a steady 50 Hz mains hum",
+ "inputs": {
+ "audio": "local/separation/hum/mix.flac"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "references": "local/separation/hum",
+ "tags": [
+ "synthetic",
+ "audio-only"
+ ],
+ "note": "where steady hum goes (noiseInVoice: the share left in the dialogue)"
+ },
+ {
+ "id": "separation/hiss",
+ "title": "Dialogue with steady tape hiss",
+ "inputs": {
+ "audio": "local/separation/hiss/mix.flac"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "references": "local/separation/hiss",
+ "tags": [
+ "synthetic",
+ "audio-only"
+ ],
+ "note": "where steady hiss goes"
+ },
+ {
+ "id": "separation/loud",
+ "title": "A loud master that peaks at −0.1 dBFS",
+ "inputs": {
+ "audio": "local/separation/loud/mix.flac"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "references": "local/separation/loud",
+ "tags": [
+ "synthetic",
+ "audio-only"
+ ],
+ "note": "AudioMerge scales a bed that peaks over full scale down as a whole (bedLevel, bedPeak)"
+ },
+ {
+ "id": "separation/video",
+ "title": "The centre mix inside a video (H.264 + AAC)",
+ "inputs": {
+ "video": "local/separation/video/clip.mp4"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "references": "local/separation/video",
+ "tags": [
+ "synthetic",
+ "video"
+ ],
+ "note": "a video source: the soundtrack read straight from the clip"
+ },
+ {
+ "id": "separation/real",
+ "title": "Your own clip (a film scene, a vlog, a podcast with music): for the blind A/B page",
+ "inputs": {
+ "video": "local/separation/real/clip.mp4"
+ },
+ "demoInputs": {
+ "audio": "fixtures/voice.wav"
+ },
+ "metrics": [
+ "separation"
+ ],
+ "tags": [
+ "real",
+ "video"
+ ],
+ "note": "No known stems: the scores are speed and whether the stems add up; listen on pnpm eval:review. Use a clip you own or may use."
+ }
+ ]
+}
diff --git a/scripts/eval/fixtures/make-separation.py b/scripts/eval/fixtures/make-separation.py
new file mode 100644
index 00000000..9d7288f8
--- /dev/null
+++ b/scripts/eval/fixtures/make-separation.py
@@ -0,0 +1,262 @@
+"""Writes the separation suite's test mixes with known stems (scripts/eval/cases/separation.json) into
+scripts/eval/local/separation/<mix>/ (git-ignored): mix.flac (the input), voice.flac, music.flac, effects.flac,
+background.flac (everything but the voice), noise.flac (the hum or hiss, when the mix has one), a video for the video
+case, and meta.json (the words spoken, the levels, the pan and every source's licence).
+
+ python3 -I scripts/eval/fixtures/make-separation.py --speech <folder> [--seconds 12] (needs numpy and ffmpeg)
+
+The speech is yours to bring, with its words: a folder of <name>.flac|.wav files next to <name>.txt (or an
+index.json [{"id", "text"}]), mono, any rate. Fuobe's own TTS lines (open Chatterbox) are the intended source; the
+suite's first measured run used LibriSpeech dev-clean utterances (CC BY 4.0, see --speech-licence). The music, the
+effects, the hum and the hiss are synthesized here from fixed seeds (Fuobe's own, CC0), so every stem is known
+exactly and the mixes are the same on every machine.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import pathlib
+import subprocess
+
+import numpy as np
+
+HERE = pathlib.Path(__file__).resolve().parent
+OUT = HERE.parent / "local" / "separation"
+SR = 44100
+SYNTH_LICENCE = "Synthesized by scripts/eval/fixtures/make-separation.py from fixed seeds (Fuobe's own, CC0)"
+
+
+def db(x: float) -> float:
+ return 10 ** (x / 20)
+
+
+def rms(x: np.ndarray) -> float:
+ return float(np.sqrt(np.mean(x**2)) + 1e-12)
+
+
+def at_level(x: np.ndarray, dbfs: float) -> np.ndarray:
+ return x * (db(dbfs) / rms(x))
+
+
+def read_audio(path: pathlib.Path) -> np.ndarray:
+ r = subprocess.run(["ffmpeg", "-v", "error", "-i", str(path), "-ac", "1", "-ar", str(SR), "-f", "f32le", "-"], capture_output=True, check=True)
+ return np.frombuffer(r.stdout, dtype="<f4").astype(np.float64)
+
+
+def write_flac(path: pathlib.Path, x: np.ndarray) -> None:
+ """Channels × samples, float, written as 24-bit FLAC (the stems stay exact to about −140 dB)."""
+ x = np.atleast_2d(x)
+ pcm = np.clip(x.T, -1, 1).astype("<f4").tobytes()
+ subprocess.run(["ffmpeg", "-v", "error", "-y", "-f", "f32le", "-ar", str(SR), "-ac", str(x.shape[0]), "-i", "-", "-c:a", "flac", "-sample_fmt", "s32", "-bits_per_raw_sample", "24", str(path)], input=pcm, check=True)
+
+
+def speech_lines(folder: pathlib.Path) -> list[tuple[str, np.ndarray, str]]:
+ index = folder / "index.json"
+ items = []
+ if index.exists():
+ for row in json.loads(index.read_text(encoding="utf8")):
+ f = next((folder / f"{row['id']}{ext}" for ext in (".flac", ".wav") if (folder / f"{row['id']}{ext}").exists()), None)
+ if f:
+ items.append((row["id"], f, row["text"]))
+ else:
+ for f in sorted(folder.iterdir()):
+ if f.suffix.lower() in (".flac", ".wav") and f.with_suffix(".txt").exists():
+ items.append((f.stem, f, f.with_suffix(".txt").read_text(encoding="utf8").strip()))
+ return [(i, read_audio(f), t) for i, f, t in items]
+
+
+def speech_track(lines, ids: list[str], seconds: float) -> tuple[np.ndarray, str, list[str]]:
+ """The named utterances one after the other from 0.5 s, 0.4 s apart, cut to the clip; only whole ones count."""
+ n = int(seconds * SR)
+ out = np.zeros(n)
+ t = int(0.5 * SR)
+ said, used = [], []
+ by_id = {i: (a, txt) for i, a, txt in lines}
+ for i in ids:
+ a, txt = by_id[i]
+ if t + len(a) > n:
+ break
+ out[t : t + len(a)] += a
+ t += len(a) + int(0.4 * SR)
+ said.append(txt)
+ used.append(i)
+ return out, " ".join(said).lower(), used
+
+
+def music(seconds: float, seed: int) -> np.ndarray:
+ """A stereo chord bed with a bass line and soft plucks: different voicings left and right, so it is wide."""
+ rng = np.random.default_rng(seed)
+ n = int(seconds * SR)
+ t = np.arange(n) / SR
+ chords = [[220.0, 277.18, 329.63], [196.0, 246.94, 293.66], [174.61, 220.0, 261.63], [196.0, 246.94, 329.63]]
+ bar = 2.0
+ left, right = np.zeros(n), np.zeros(n)
+ for k in range(int(np.ceil(seconds / bar))):
+ a, b = int(k * bar * SR), min(n, int((k + 1) * bar * SR))
+ seg = t[a:b] - t[a]
+ env = np.minimum(1, seg / 0.05) * np.exp(-seg * 0.6)
+ ch = chords[k % len(chords)]
+ for j, f in enumerate(ch):
+ tone = np.sin(2 * np.pi * f * seg) + 0.3 * np.sin(4 * np.pi * f * seg) + 0.12 * np.sin(6 * np.pi * f * seg)
+ (left if j % 2 == 0 else right)[a:b] += 0.6 * env * tone
+ (right if j % 2 == 0 else left)[a:b] += 0.25 * env * tone
+ bass = np.sin(2 * np.pi * ch[0] / 2 * seg) * np.exp(-seg * 1.2)
+ left[a:b] += 0.5 * bass
+ right[a:b] += 0.5 * bass
+ for p in range(4): # plucks on the beat, alternating sides
+ s = a + int(p * bar / 4 * SR)
+ e = min(b, s + int(0.3 * SR))
+ ps = t[s:e] - t[s]
+ f = ch[rng.integers(0, 3)] * 2
+ pl = np.sin(2 * np.pi * f * ps) * np.exp(-ps * 12)
+ (left if p % 2 == 0 else right)[s:e] += 0.35 * pl
+ return np.stack([left, right])
+
+
+def effects(seconds: float, seed: int) -> np.ndarray:
+ """Door knocks, a whoosh, footsteps and a glass clink, placed at fixed times and panned."""
+ rng = np.random.default_rng(seed)
+ n = int(seconds * SR)
+ out = np.zeros((2, n))
+
+ def put(sig, at, pan):
+ s = int(at * SR)
+ e = min(n, s + len(sig))
+ if s >= n:
+ return
+ out[0, s:e] += sig[: e - s] * np.cos(pan * np.pi / 2)
+ out[1, s:e] += sig[: e - s] * np.sin(pan * np.pi / 2)
+
+ def knock():
+ m = int(0.12 * SR)
+ tt = np.arange(m) / SR
+ noise = rng.standard_normal(m)
+ low = np.convolve(noise, np.ones(30) / 30, mode="same")
+ return (0.8 * low + 0.6 * np.sin(2 * np.pi * 140 * tt)) * np.exp(-tt * 45)
+
+ def whoosh():
+ m = int(1.2 * SR)
+ tt = np.arange(m) / SR
+ noise = rng.standard_normal(m)
+ k = 1 + (np.sin(np.pi * tt / tt[-1]) * 60).astype(int)
+ sm = np.array([noise[max(0, i - k[i]) : i + 1].mean() for i in range(m)])
+ return 2.5 * sm * np.sin(np.pi * tt / tt[-1]) ** 2
+
+ def step():
+ m = int(0.08 * SR)
+ tt = np.arange(m) / SR
+ return np.convolve(rng.standard_normal(m), np.ones(12) / 12, mode="same") * np.exp(-tt * 70) * 1.2
+
+ def clink():
+ m = int(0.6 * SR)
+ tt = np.arange(m) / SR
+ return (np.sin(2 * np.pi * 2637 * tt) + 0.6 * np.sin(2 * np.pi * 3951 * tt)) * np.exp(-tt * 9) * 0.5
+
+ for i, at in enumerate([1.1, 1.35, 1.6]):
+ put(knock(), at, 0.15)
+ put(whoosh(), 3.2, 0.8)
+ for i in range(8):
+ put(step(), 5.0 + i * 0.45, 0.3 + 0.05 * i)
+ put(clink(), 9.4, 0.65)
+ if seconds > 11:
+ put(whoosh(), seconds - 1.6, 0.25)
+ return out
+
+
+def hum(seconds: float) -> np.ndarray:
+ t = np.arange(int(seconds * SR)) / SR
+ h = sum(a * np.sin(2 * np.pi * f * t) for f, a in [(50, 1.0), (100, 0.5), (150, 0.35), (200, 0.2), (250, 0.1)])
+ return np.stack([h, h])
+
+
+def hiss(seconds: float, seed: int) -> np.ndarray:
+ """Pink-ish hiss (white noise through a gentle 1/f filter), uncorrelated left and right."""
+ rng = np.random.default_rng(seed)
+ n = int(seconds * SR)
+ out = []
+ for _ in range(2):
+ w = rng.standard_normal(n)
+ spec = np.fft.rfft(w)
+ f = np.fft.rfftfreq(n, 1 / SR)
+ spec /= np.sqrt(np.maximum(f, 20))
+ out.append(np.fft.irfft(spec, n))
+ return np.stack(out)
+
+
+MIXES = {
+ "centre": {"title": "Dialogue in the centre over music and effects", "speech": ["1272-141231-0003", "1272-141231-0004", "1272-141231-0019"], "pan": 0.5},
+ "off-centre": {"title": "Dialogue panned left over the same music and effects", "speech": ["1272-141231-0003", "1272-141231-0004", "1272-141231-0019"], "pan": 0.2},
+ "hum": {"title": "Dialogue with a steady 50 Hz mains hum", "speech": ["1272-135031-0003", "1272-135031-0004", "1272-135031-0007"], "pan": 0.5, "noise": "hum", "noiseDb": -34},
+ "hiss": {"title": "Dialogue with steady tape hiss", "speech": ["1272-135031-0005", "1272-135031-0006", "1272-135031-0008"], "pan": 0.5, "noise": "hiss", "noiseDb": -36},
+ "loud": {"title": "A loud master (peaks at −0.1 dBFS)", "speech": ["1272-141231-0016", "1272-141231-0017", "1272-141231-0018"], "pan": 0.5, "peak": -0.1, "musicDb": -18},
+}
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ ap.add_argument("--speech", required=True, help="folder of speech files with their words (see above)")
+ ap.add_argument("--speech-licence", default="LibriSpeech dev-clean, speaker 1272 (Panayotov et al. 2015, openslr.org/12), CC BY 4.0, read from hf-internal-testing/librispeech_asr_dummy@5be91486")
+ ap.add_argument("--seconds", type=float, default=12.0)
+ ap.add_argument("--out", default=str(OUT))
+ args = ap.parse_args()
+ lines = speech_lines(pathlib.Path(args.speech))
+ have = {i for i, _, _ in lines}
+ out = pathlib.Path(args.out)
+ sec = args.seconds
+ for name, m in MIXES.items():
+ ids = [i for i in m["speech"] if i in have] or [i for i, _, _ in lines[:3]]
+ sp, text, used = speech_track(lines, ids, sec)
+ sp = at_level(sp, -20)
+ pan = m["pan"]
+ voice = np.stack([sp * np.cos(pan * np.pi / 2), sp * np.sin(pan * np.pi / 2)]) * np.sqrt(2)
+ mus = at_level(music(sec, 11), m.get("musicDb", -26))
+ fx = at_level(effects(sec, 23), -30)
+ noise = None
+ if m.get("noise") == "hum":
+ noise = at_level(hum(sec), m["noiseDb"])
+ elif m.get("noise") == "hiss":
+ noise = at_level(hiss(sec, 37), m["noiseDb"])
+ parts = [voice, mus, fx] + ([noise] if noise is not None else [])
+ mix = sum(parts)
+ scale = db(m["peak"]) / np.max(np.abs(mix)) if "peak" in m else min(1.0, db(-1.0) / np.max(np.abs(mix)))
+ voice, mus, fx, mix = voice * scale, mus * scale, fx * scale, mix * scale
+ if noise is not None:
+ noise = noise * scale
+ bed = mix - voice
+ d = out / name
+ d.mkdir(parents=True, exist_ok=True)
+ for f, x in [("mix", mix), ("voice", voice), ("music", mus), ("effects", fx), ("background", bed)] + ([("noise", noise)] if noise is not None else []):
+ write_flac(d / f"{f}.flac", x)
+ meta = {
+ "title": m["title"],
+ "text": text,
+ "speech": used,
+ "sampleRate": SR,
+ "seconds": sec,
+ "pan": pan,
+ "levelsDbfs": {k: round(20 * np.log10(rms(x)), 2) for k, x in [("mix", mix), ("voice", voice), ("music", mus), ("effects", fx)] + ([("noise", noise)] if noise is not None else [])},
+ "peakDbfs": round(20 * np.log10(np.max(np.abs(mix))), 2),
+ "licences": {"speech": args.speech_licence, "music": SYNTH_LICENCE, "effects": SYNTH_LICENCE, **({"noise": SYNTH_LICENCE} if noise is not None else {})},
+ }
+ (d / "meta.json").write_text(json.dumps(meta, indent=2, ensure_ascii=False) + "\n", encoding="utf8")
+ print(f"{name}: {text[:60]}… mix {meta['levelsDbfs']['mix']} dBFS, peak {meta['peakDbfs']}")
+ # The video case: the centre mix as a phone-style clip (H.264 + AAC 192 kb/s) on a plain picture.
+ v = out / "video"
+ v.mkdir(parents=True, exist_ok=True)
+ c = out / "centre"
+ subprocess.run(
+ ["ffmpeg", "-v", "error", "-y", "-f", "lavfi", "-i", f"color=c=0x30343c:s=320x180:r=25:d={sec}", "-i", str(c / "mix.flac"), "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac", "-b:a", "192k", "-shortest", str(v / "clip.mp4")],
+ check=True,
+ )
+ for f in ["voice", "music", "effects", "background", "mix"]:
+ (v / f"{f}.flac").write_bytes((c / f"{f}.flac").read_bytes())
+ meta = json.loads((c / "meta.json").read_text(encoding="utf8"))
+ meta["title"] = "The centre mix inside a video (H.264 + AAC)"
+ (v / "meta.json").write_text(json.dumps(meta, indent=2, ensure_ascii=False) + "\n", encoding="utf8")
+ print(f"video: {v / 'clip.mp4'}")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/scripts/eval/gen-cases.mjs b/scripts/eval/gen-cases.mjs
index 93dd5d24..74f7ee54 100644
--- a/scripts/eval/gen-cases.mjs
+++ b/scripts/eval/gen-cases.mjs
@@ -6,6 +6,7 @@
// cases/dop.json one case per DoP motion / effect that the research gives a LoRA, a camera pose or a camera LoRA
// cases/dop-mix.json Fuobe DoP's Mix: a move and an effect on one run, against the move alone
// cases/dop-mixed-media.json DoP's Mixed Media effects in the cloud, blind: Fuobe DoP against Kling 2.5 Turbo
+// cases/separation.json soundtrack separation (DBS D4): DBS-TIGER vs DBS-BSRNN, mono vs each channel, DBS vs MelBand for the dub, Demucs
// cases/case.schema.json the suite format as JSON Schema (for editors)
// The prompts are Fuobe's own (never Higgsfield's). Run: node scripts/eval/gen-cases.mjs [--check]
import fs from "node:fs";
@@ -451,6 +452,81 @@ function dopMixedMediaSuite() {
};
}
+/**
+ * The separation suite's test mixes (scripts/eval/fixtures/make-separation.py writes them, with their known stems, into
+ * local/separation/<id>/): what each one checks. "real" is your own clip, for the blind A/B page only.
+ */
+const SEPARATION_MIXES = [
+ { id: "centre", title: "Dialogue in the centre over music and effects", checks: "the reference mix: every stem against its known part" },
+ { id: "off-centre", title: "Dialogue panned left over the same music and effects", checks: "the fast stereo bed (mono speech subtracted from each channel) leaves part of off-centre speech in the bed" },
+ { id: "hum", title: "Dialogue with a steady 50 Hz mains hum", checks: "where steady hum goes (noiseInVoice: the share left in the dialogue)" },
+ { id: "hiss", title: "Dialogue with steady tape hiss", checks: "where steady hiss goes" },
+ { id: "loud", title: "A loud master that peaks at −0.1 dBFS", checks: "AudioMerge scales a bed that peaks over full scale down as a whole (bedLevel, bedPeak)" },
+ { id: "video", title: "The centre mix inside a video (H.264 + AAC)", checks: "a video source: the soundtrack read straight from the clip", video: true },
+];
+
+/** The DBS weights' licence from the research (information, recorded with the suite). */
+function dbsLicences() {
+ const doc = JSON.parse(fs.readFileSync(path.join(REPO_DIR, "docs/research/dbs-separation-7.json"), "utf8"));
+ return doc.models.map((m) => `${m.name} ${m.licence} (${m.repo}@${m.revision.slice(0, 8)}; trained on ${m.trainedOn})`).join("; ");
+}
+
+export const SEPARATION_RULE =
+ "Defaults change only on these numbers, in a reviewed code change: the open split's model per host (src/lib/av/split.ts) is the faster model unless the other wins dialogue SI-SDR by more than 1 dB on most mixes at a speed the host can live with (a minute of audio in under 5 minutes on a CPU); stereo stems (each channel) become the default only if the fast stereo bed loses its stereo image (bed stereo gap over 0.1) or its level (over 1 dB) on the centred mixes; the dub's voice split (src/lib/av/dub.ts DEFAULT_VOICE_SPLIT) moves to DBS when its dialogue WER is no worse than MelBand RoFormer's and its bed keeps the music and effects (background SI-SDR at least 3 dB higher).";
+
+function separationSuite() {
+ const asr = { asrModel: "Qwen/Qwen3-ASR-0.6B-hf" };
+ const cases = SEPARATION_MIXES.map((m) => ({
+ id: `separation/${m.id}`,
+ title: m.title,
+ inputs: m.video ? { video: `local/separation/${m.id}/clip.mp4` } : { audio: `local/separation/${m.id}/mix.flac` },
+ demoInputs: { audio: "fixtures/voice.wav" },
+ references: `local/separation/${m.id}`,
+ tags: ["synthetic", ...(m.video ? ["video"] : ["audio-only"])],
+ note: m.checks,
+ }));
+ cases.push({
+ id: "separation/real",
+ title: "Your own clip (a film scene, a vlog, a podcast with music): for the blind A/B page",
+ inputs: { video: "local/separation/real/clip.mp4" },
+ demoInputs: { audio: "fixtures/voice.wav" },
+ metrics: ["separation"],
+ tags: ["real", "video"],
+ note: "No known stems: the scores are speed and whether the stems add up; listen on pnpm eval:review. Use a clip you own or may use.",
+ });
+ return {
+ $schema: "./case.schema.json",
+ suite: "separation",
+ title: "Soundtrack separation · dialogue, music and effects",
+ description: `${HEADER} Synthetic 12 s mixes with known stems (python3 -I scripts/eval/fixtures/make-separation.py --speech <folder> writes them into local/separation/; the speech is yours to bring with its words, the music, effects, hum and hiss are synthesized there, CC0) and your own clip for the blind review. Scores each stem against its known part (SI-SDR, SDR), whether voice + bed add back up to the input, the bed's level, peak and stereo image against the known bed, where a steady hum or hiss goes, the dialogue's word error rate (Whisper base.en, pnpm eval:setup --asr; werInput is the same ASR on the input as it is, which is "Clean the voice first" off) and the speed from ComfyUI-DBS's report. Licences (information): ${dbsLicences()}; ComfyUI-DBS MIT; MelBand RoFormer MIT; Demucs MIT; the test mixes' sources are recorded in each mix's meta.json. SAM Audio isn't here: it is not offered on the cloud engine.`,
+ original: ["oss-dbs-separate", "oss-dbs-voice-separate"],
+ kind: "audio",
+ decides: SEPARATION_RULE,
+ targets: {
+ open: { models: ["oss-dbs-separate"], op: "separate-audio" },
+ cloud: { models: ["demucs"], op: "separate-audio" },
+ demo: { models: ["oss-dbs-separate"], op: "separate-audio" },
+ },
+ defaults: {
+ seeds: [1001],
+ metrics: ["separation", "wer"],
+ variant: "bsrnn-mono",
+ candidate: "bsrnn-mono",
+ timeoutSeconds: 3600,
+ },
+ variants: {
+ "bsrnn-mono": { description: "DBS-BSRNN (fast), mono: stems from the channels' mean, the bed is the original minus the speech (the fast stereo bed)", extra: { separationModel: "DBS-BSRNN-DnR", channels: "mono" }, engines: ["open", "demo"] },
+ "bsrnn-stereo": { description: "DBS-BSRNN, each channel: every channel separated on its own (twice the time for stereo)", extra: { separationModel: "DBS-BSRNN-DnR", channels: "each channel" }, engines: ["open"] },
+ "tiger-mono": { description: "DBS-TIGER (best), mono", extra: { separationModel: "DBS-TIGER-DnR", channels: "mono" }, engines: ["open"] },
+ "tiger-stereo": { description: "DBS-TIGER, each channel", extra: { separationModel: "DBS-TIGER-DnR", channels: "each channel" }, engines: ["open"] },
+ "dbs-dub": { description: "The dub's first step with DBS (graph B: DBS-BSRNN voice and bed, then Qwen3-ASR 0.6B on the voice)", models: { open: ["oss-dbs-voice-separate"] }, extra: { separationModel: "DBS-BSRNN-DnR", ...asr }, engines: ["open"] },
+ melband: { description: "The dub's first step with MelBand RoFormer (a vocals model; voice and background only, then Qwen3-ASR 0.6B)", models: { open: ["oss-voice-separate"] }, extra: asr, engines: ["open"] },
+ demucs: { description: "Demucs (htdemucs on fal, as today's cloud dub uses it): vocals against drums, bass and other, summed into the bed", models: { cloud: ["demucs"] }, engines: ["cloud"] },
+ },
+ cases,
+ };
+}
+
const write = (name, data, check) => {
const file = path.join(CASES_DIR, name);
const text = `${JSON.stringify(data, null, 2)}\n`;
@@ -473,6 +549,7 @@ export function generated() {
"dop.json": dop.suite,
"dop-mix.json": dopMixSuite(),
"dop-mixed-media.json": dopMixedMediaSuite(),
+ "separation.json": separationSuite(),
"case.schema.json": schemaJson(),
later: dop.later,
};
@@ -481,6 +558,6 @@ export function generated() {
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
const check = process.argv.includes("--check");
const out = generated();
- for (const name of ["soul.json", "soul-cinema.json", "soul-hex.json", "dop.json", "dop-mix.json", "dop-mixed-media.json", "case.schema.json"]) write(name, out[name], check);
- console.log(`soul: ${out["soul.json"].cases.length} looks · dop: ${out["dop.json"].cases.length} presets · dop-mix: ${out["dop-mix.json"].cases.length} pairs · dop-mixed-media: ${out["dop-mixed-media.json"].cases.length} effects${out.later.length ? ` (${out.later.length} research names not in the catalog yet)` : ""}`);
+ for (const name of ["soul.json", "soul-cinema.json", "soul-hex.json", "dop.json", "dop-mix.json", "dop-mixed-media.json", "separation.json", "case.schema.json"]) write(name, out[name], check);
+ console.log(`soul: ${out["soul.json"].cases.length} looks · dop: ${out["dop.json"].cases.length} presets · dop-mix: ${out["dop-mix.json"].cases.length} pairs · dop-mixed-media: ${out["dop-mixed-media.json"].cases.length} effects · separation: ${out["separation.json"].cases.length} mixes${out.later.length ? ` (${out.later.length} research names not in the catalog yet)` : ""}`);
}
diff --git a/scripts/eval/lib/html.mjs b/scripts/eval/lib/html.mjs
index b994fe2e..0e78010e 100644
--- a/scripts/eval/lib/html.mjs
+++ b/scripts/eval/lib/html.mjs
@@ -45,6 +45,9 @@ a { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.media { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--chip); border-radius: 8px; display: block; }
+.stems { display: grid; gap: 6px; }
+.stem { display: grid; gap: 2px; font-size: 12px; }
+.stem audio, .side audio { width: 100%; min-width: 0; display: block; }
.facts { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin: 12px 0; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts div { min-width: 0; } .facts b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
diff --git a/scripts/eval/lib/report.mjs b/scripts/eval/lib/report.mjs
index 2a8c5f31..ee23b35d 100644
--- a/scripts/eval/lib/report.mjs
+++ b/scripts/eval/lib/report.mjs
@@ -125,7 +125,7 @@ export function summarize(loaded) {
seed: x.row.seed,
status: x.row.status,
error: x.row.error ?? x.row.skip ?? null,
- outputs: (x.row.outputs ?? []).filter((o) => o.kind === "image" || o.kind === "video").map((o) => ({ file: o.file, kind: o.kind })),
+ outputs: (x.row.outputs ?? []).filter((o) => o.kind === "image" || o.kind === "video" || o.kind === "audio").map((o) => ({ file: o.file, kind: o.kind, ...(o.stem && { stem: o.stem }) })),
scores: x.scores,
notes: [...(x.row.notes ?? []), ...(metrics?.jobs?.[x.row.id]?._notes ?? [])],
})),
@@ -227,7 +227,11 @@ export function reportHtml(summary) {
.map(([v, s]) => {
const tiles = s.items
.map((it) => {
- const media = it.outputs[0]
+ // Audio results (a separation's stems): one player per stem, named.
+ const sounds = it.outputs.filter((o) => o.kind === "audio");
+ const media = sounds.length
+ ? `<div class="stems">${sounds.map((o, i) => `<label class="stem"><span class="muted">${esc(o.stem ?? `audio ${i + 1}`)}</span><audio src="${href(o.file)}" preload="none" controls></audio></label>`).join("")}</div>`
+ : it.outputs[0]
? it.outputs[0].kind === "video"
? `<video class="media" src="${href(it.outputs[0].file)}" muted loop playsinline preload="metadata" controls></video>`
: `<img class="media" src="${href(it.outputs[0].file)}" alt="${esc(`${c.title}, ${v}, ${it.promptId}`)}" loading="lazy">`
@@ -235,7 +239,7 @@ export function reportHtml(summary) {
return `<figure style="margin:0">${media}<figcaption class="muted" style="font-size:12px;margin-top:4px">${esc(it.promptId)} · seed ${esc(it.seed)}${it.error ? ` · ${esc(it.error)}` : ""}</figcaption><div class="row" style="margin-top:4px">${chips(it.scores, keys)}</div></figure>`;
})
.join("");
- return `<div class="card"><h3>${esc(v)}${s.recipeComplete ? "" : ' <span class="chip bad" title="Some of the recipe\'s LoRAs were left out on this engine">recipe incomplete</span>'}</h3>${s.recipe ? `<p class="muted" style="font-size:12px">${esc(s.recipe)}</p>` : ""}<div class="grid" style="grid-template-columns:repeat(auto-fill,minmax(min(100%,140px),1fr))">${tiles}</div></div>`;
+ return `<div class="card"><h3>${esc(v)}${s.recipeComplete ? "" : ' <span class="chip bad" title="Some of the recipe\'s LoRAs were left out on this engine">recipe incomplete</span>'}</h3>${s.recipe ? `<p class="muted" style="font-size:12px">${esc(s.recipe)}</p>` : ""}<div class="grid" style="grid-template-columns:repeat(auto-fill,minmax(min(100%,${s.items.some((it) => it.outputs.some((o) => o.kind === "audio")) ? 240 : 140}px),1fr))">${tiles}</div></div>`;
})
.join("");
return `<section><h2 id="${esc(c.caseId)}">${esc(c.title)} <span class="muted" style="font-weight:400">${esc(c.caseId)}</span></h2><div class="grid">${cols}</div></section>`;
diff --git a/scripts/eval/lib/review.mjs b/scripts/eval/lib/review.mjs
index 3c1e1fc9..7ef91ce3 100644
--- a/scripts/eval/lib/review.mjs
+++ b/scripts/eval/lib/review.mjs
@@ -13,10 +13,31 @@ import { candidateOf, latestJobs, readJson, writeJson } from "./store.mjs";
const IMAGE = /\.(png|jpe?g|webp|gif|svg)$/i;
const VIDEO = /\.(mp4|mov|m4v|webm)$/i;
+const AUDIO = /\.(flac|wav|mp3|m4a|ogg)$/i;
const hash = (s) => crypto.createHash("sha256").update(s).digest("hex");
-/** The first picture or clip of a succeeded row (helpers like masks left out). */
-const mainOutput = (row) => (row.outputs ?? []).find((o) => (o.kind === "image" || o.kind === "video") && !["mask", "first-frame", "depth"].includes(o.role));
+/** The first picture or clip of a succeeded row (helpers like masks left out); a separation's first stem. */
+const mainOutput = (row) => (row.outputs ?? []).find((o) => (o.kind === "image" || o.kind === "video") && !["mask", "first-frame", "depth"].includes(o.role)) ?? (row.outputs ?? []).find((o) => o.kind === "audio");
+
+/** What a separation's two stems are judged on, blind (the words above each pair). */
+const STEM_ASKS = {
+ voice: "Dialogue: which is clearer, with the least music, effects or noise left in it?",
+ background: "Music & effects: which keeps the music and effects fuller, with no speech left in it?",
+};
+
+/** The results to pair for a row: a separation's dialogue and its music & effects (each judged on its own), else the main output. */
+function sidesOf(row) {
+ const audio = (row.outputs ?? []).filter((o) => o.kind === "audio");
+ if (audio.length) {
+ const pick = Object.keys(STEM_ASKS).flatMap((stem) => {
+ const o = audio.find((x) => x.stem === stem);
+ return o ? [{ out: o, stem, ask: STEM_ASKS[stem] }] : [];
+ });
+ if (pick.length) return pick;
+ }
+ const o = mainOutput(row);
+ return o ? [{ out: o, stem: null, ask: null }] : [];
+}
/**
* The pairs to rate.
@@ -37,7 +58,12 @@ export function buildPairs(run, opts = {}) {
for (const r of ok.filter((x) => x.variant === base)) {
for (const v of variants.filter((x) => x !== base)) {
const o = byKey.get(`${r.key}|${v}`);
- if (o) pairs.push({ a: side(base, path.join(run.dir, mainOutput(r).file), { job: r.id }), b: side(v, path.join(run.dir, mainOutput(o).file), { job: o.id }), prompt: r.prompt, caseTitle: r.caseTitle, caseId: r.caseId });
+ if (!o) continue;
+ const theirs = sidesOf(o);
+ for (const mine of sidesOf(r)) {
+ const other = theirs.find((t) => t.stem === mine.stem);
+ if (other) pairs.push({ a: side(base, path.join(run.dir, mine.out.file), { job: r.id, ...(mine.stem && { stem: mine.stem }) }), b: side(v, path.join(run.dir, other.out.file), { job: o.id, ...(mine.stem && { stem: mine.stem }) }), prompt: mine.ask ?? r.prompt, caseTitle: r.caseTitle, caseId: r.caseId });
+ }
}
}
} else if (against === "references") {
@@ -86,7 +112,7 @@ export function writeReview(run, opts = {}) {
};
const items = pairs.map((p) => {
const [left, right] = p.aLeft ? [p.a, p.b] : [p.b, p.a];
- return { id: p.id, prompt: p.prompt ?? "", title: p.caseTitle ?? "", left: place(left.file), right: place(right.file), video: [left.file, right.file].some((f) => VIDEO.test(f)) };
+ return { id: p.id, prompt: p.prompt ?? "", title: p.caseTitle ?? "", left: place(left.file), right: place(right.file), video: [left.file, right.file].some((f) => VIDEO.test(f)), audio: [left.file, right.file].every((f) => AUDIO.test(f)) };
});
writeJson(path.join(out, "key.json"), {
runId: run.runId,
@@ -105,6 +131,7 @@ export function reviewHtml(runId, items) {
.side { position: relative; border: 2px solid var(--border); border-radius: 12px; padding: 8px; background: var(--card); min-width: 0; }
.side.picked { border-color: var(--accent); }
.side .tag { position: absolute; top: 12px; left: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-weight: 600; }
+.side .sound { padding: 40px 0 8px; }
.side img, .side video { width: 100%; max-height: 62vh; object-fit: contain; display: block; border-radius: 8px; background: var(--chip); }
.bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border); padding: 12px 0; margin-top: 16px; }
.bar .row { justify-content: center; }
@@ -147,7 +174,8 @@ let shownAt = performance.now();
const $ = (id) => document.getElementById(id);
const doneIds = () => new Set(ratings.map((r) => r.pair));
const next = () => PAIRS.find((p) => !doneIds().has(p.id));
-function media(src, video, label) {
+function media(src, video, label, audio) {
+ if (audio) return '<div class="sound"><audio src="' + src + '" controls preload="auto" aria-label="' + label + '"></audio></div>';
return video ? '<video src="' + src + '" muted loop playsinline autoplay controls aria-label="' + label + '"></video>' : '<img src="' + src + '" alt="' + label + '">';
}
function render() {
@@ -159,8 +187,8 @@ function render() {
if (!p) { $("stage").innerHTML = "<h2>All done</h2><p>Thanks — " + rated + " ratings. " + (served ? "They are saved in the run folder." : "Download them and put ratings.json in the run's review folder.") + "</p>"; return; }
const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]);
$("stage").innerHTML = '<p><b>' + esc(p.title) + '</b></p><p class="muted">' + esc(p.prompt) + '</p><div class="pair">' +
- '<div class="side" id="L"><span class="tag">Left</span>' + media(p.left, p.video, "Left result") + '</div>' +
- '<div class="side" id="R"><span class="tag">Right</span>' + media(p.right, p.video, "Right result") + '</div></div>';
+ '<div class="side" id="L"><span class="tag">Left</span>' + media(p.left, p.video, "Left result", p.audio) + '</div>' +
+ '<div class="side" id="R"><span class="tag">Right</span>' + media(p.right, p.video, "Right result", p.audio) + '</div></div>';
shownAt = performance.now();
}
async function persist() {
@@ -192,9 +220,9 @@ document.addEventListener("keydown", (e) => {
const k = e.key;
// Space and Enter on a focused button press that button (a keyboard user's "Left is better"), and a focused
// clip keeps its own keys: only the page's shortcuts are taken here.
- const control = e.target instanceof Element ? e.target.closest("button, a, input, select, textarea, summary, video, [contenteditable]") : null;
+ const control = e.target instanceof Element ? e.target.closest("button, a, input, select, textarea, summary, video, audio, [contenteditable]") : null;
if (control && (k === " " || k === "Enter")) return;
- if (control && control.tagName === "VIDEO" && k.startsWith("Arrow")) return;
+ if (control && (control.tagName === "VIDEO" || control.tagName === "AUDIO") && k.startsWith("Arrow")) return;
const choice = k === "ArrowLeft" || k === "1" ? "left" : k === "ArrowRight" || k === "2" ? "right" : k === "ArrowDown" || k === "0" || k === " " ? "same" : k === "s" || k === "S" ? "skip" : null;
if (choice) { e.preventDefault(); rate(choice); }
else if (k === "u" || k === "U" || k === "Backspace") { e.preventDefault(); undo(); }
@@ -245,7 +273,7 @@ export function aggregateRatings(loaded, opts = {}) {
return { total, pairs: [...groups.values()].map((g) => ({ ...g, preferA: g.aWins + g.bWins ? g.aWins / (g.aWins + g.bWins) : null })), ...(opts.caseId && { available }) };
}
-const TYPES = { ".html": "text/html; charset=utf-8", ".json": "application/json", ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp", ".gif": "image/gif", ".svg": "image/svg+xml", ".mp4": "video/mp4", ".webm": "video/webm", ".mov": "video/quicktime", ".m4v": "video/mp4" };
+const TYPES = { ".html": "text/html; charset=utf-8", ".json": "application/json", ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp", ".gif": "image/gif", ".svg": "image/svg+xml", ".mp4": "video/mp4", ".webm": "video/webm", ".mov": "video/quicktime", ".m4v": "video/mp4", ".flac": "audio/flac", ".wav": "audio/wav", ".mp3": "audio/mpeg", ".m4a": "audio/mp4", ".ogg": "audio/ogg" };
/**
* Serve a run's review folder on 127.0.0.1 and save ratings it POSTs. Only files inside review/
diff --git a/scripts/eval/metrics/fuobe_metrics/models.py b/scripts/eval/metrics/fuobe_metrics/models.py
index e65c0614..3fd40dda 100644
--- a/scripts/eval/metrics/fuobe_metrics/models.py
+++ b/scripts/eval/metrics/fuobe_metrics/models.py
@@ -234,6 +234,6 @@ class Asr:
continue
feats = self.processor(chunk, sampling_rate=sr, return_tensors="pt").input_features.to(self.device)
with self.torch.no_grad():
- ids = self.model.generate(feats, max_new_tokens=220)
+ ids = self.model.generate(feats)
out.append(self.processor.batch_decode(ids, skip_special_tokens=True)[0].strip())
return " ".join(t for t in out if t)
diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.ts
index 07d810fb..491b58d5 100644
--- a/tests/eval-harness.test.ts
+++ b/tests/eval-harness.test.ts
@@ -410,6 +410,41 @@ describe("the runner on the demo provider", () => {
}
});
+ it("runs the separation suite: stems keep their names, and each variant asks for its DBS model and channels", async () => {
+ const r = await cli(["run", "--suite", "separation", "--engine", "demo", "--cases", "separation/centre", "--no-metrics"]);
+ expect(r.code, r.stderr).toBe(0);
+ const rows = store.latestJobs(path.join(results, runIdFrom(r.stderr)));
+ expect(rows.map((x) => [x.caseId, x.status])).toEqual([["separation/centre", "succeeded"]]);
+ const outs = (rows[0].outputs ?? []) as { kind: string; stem?: string }[];
+ // The demo split answers a voice and a background stem, recorded by name for the scorer.
+ expect(outs.filter((o) => o.kind === "audio").map((o) => o.stem)).toEqual(expect.arrayContaining(["voice", "background"]));
+ const suite = cases.loadSuite("separation") as unknown as { file: string; kind: string; decides: string; description: string };
+ expect(suite).toMatchObject({ kind: "audio", defaults: { candidate: "bsrnn-mono", metrics: ["separation", "wer"] } });
+ expect(suite.description).toMatch(/DBS-TIGER-DnR Apache-2\.0.*MelBand RoFormer MIT/);
+ expect(suite.decides).toMatch(/reviewed code change/);
+ const jobs = plan.expandJobs(suite, { engine: "open", variants: ["bsrnn-mono", "bsrnn-stereo", "tiger-mono", "tiger-stereo", "dbs-dub", "melband", "demucs"], cases: ["separation/centre"], exists: () => true }) as unknown as {
+ variant: string;
+ skip?: string;
+ request: { modelId: string; op?: string; params: { extra?: Record<string, unknown> } };
+ }[];
+ expect(jobs.map((j) => [j.variant, j.request.modelId, j.request.params.extra?.separationModel ?? null, j.request.params.extra?.channels ?? null, j.skip ?? null])).toEqual([
+ ["bsrnn-mono", "oss-dbs-separate", "DBS-BSRNN-DnR", "mono", null],
+ ["bsrnn-stereo", "oss-dbs-separate", "DBS-BSRNN-DnR", "each channel", null],
+ ["tiger-mono", "oss-dbs-separate", "DBS-TIGER-DnR", "mono", null],
+ ["tiger-stereo", "oss-dbs-separate", "DBS-TIGER-DnR", "each channel", null],
+ ["dbs-dub", "oss-dbs-voice-separate", "DBS-BSRNN-DnR", null, null],
+ ["melband", "oss-voice-separate", null, null, null],
+ ["demucs", "oss-dbs-separate", null, null, "the demucs variant runs on cloud only"],
+ ]);
+ expect(jobs.every((j) => j.request.op === "separate-audio")).toBe(true);
+ // The cloud runs Demucs as today's cloud dub does; DBS isn't hosted, so its variants say they run on the open engine.
+ const cloud = plan.expandJobs(suite, { engine: "cloud", variants: ["demucs", "bsrnn-mono"], cases: ["separation/centre"], exists: () => true }) as unknown as { variant: string; skip?: string; request: { modelId: string } }[];
+ expect(cloud.map((j) => [j.variant, j.request.modelId, j.skip ?? null])).toEqual([
+ ["demucs", "demucs", null],
+ ["bsrnn-mono", "demucs", "the bsrnn-mono variant runs on open / demo only"],
+ ]);
+ });
+
it("runs Fuobe Cinema's Director and camera-move cases, and plans its cloud variants", async () => {
const r = await cli(["run", "--suite", "cinema", "--engine", "demo", "--cases", "cinema/director-noir,cinema/move-dolly-in", "--no-metrics"]);
expect(r.code, r.stderr).toBe(0);