Skip to content

Commit 0c6fee5

Browse files
author
Michal Warda
committed
Add M2D dialogue background validation
1 parent b40497c commit 0c6fee5

6 files changed

Lines changed: 685 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ uv run sam-pipeline-youtube-random \
106106
--total 1000 --seed 20260714
107107
```
108108

109+
Search metadata is only a candidate generator. Use the M2D validation command
110+
described in `docs/pipeline/OPERATIONS.md` before treating a clip as spoken
111+
dialogue over an active background. The gate explicitly rejects singing,
112+
rapping, choir, and other vocal music.
113+
109114
Generation, prompt, batching, and TF32 policy are configured with the
110115
`SAM_AUDIO_*` environment variables demonstrated in
111116
[`deploy/start-sam-audio-api.sh`](deploy/start-sam-audio-api.sh). A supplied

docs/pipeline/OPERATIONS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,49 @@ uv run sam-pipeline-youtube-random \
205205
--total 1000 --verify-only
206206
```
207207

208+
### M2D dialogue/background validation
209+
210+
The technical YouTube gate does not prove that spoken dialogue and background
211+
activity occur in the selected ten seconds. Validate candidates with the
212+
official M2D AudioSet-fine-tuned tagger before using them. The validator scores
213+
overlapping two-second windows and requires speech, a non-human background
214+
class, and at least three windows in which both are active. Singing, choir,
215+
chant, rapping, humming, opera, a capella, vocal music, and song evidence may
216+
appear in at most one window, preventing sung vocals from satisfying the speech
217+
requirement. It separately records music-led, effects/ambience-led, and mixed
218+
instrumental backgrounds.
219+
220+
The model repository, checkpoint, AudioSet label CSV, and ontology are runtime
221+
inputs rather than files baked into this repository or its Docker image:
222+
223+
```bash
224+
uv run sam-pipeline-m2d-validate score \
225+
--input-dir /data/youtube-random-1000/audio \
226+
--output /data/youtube-random-1000/m2d-validation.jsonl \
227+
--m2d-repo /models/m2d \
228+
--checkpoint /models/m2d/weights_ep69it3124-0.47929.pth \
229+
--class-labels /models/audioset/class_labels_indices.csv \
230+
--ontology /models/audioset/ontology.json \
231+
--m2d-commit 3d0c4de9447c404a8d3f9f37e04f53bc902e09b3
232+
```
233+
234+
Create a separate listening-test folder containing only accepted audio. The
235+
command hard-links files when possible and never removes the source dataset:
236+
237+
```bash
238+
uv run sam-pipeline-m2d-validate materialize \
239+
--input-dir ~/Downloads/youtube-random-1000-20260714/audio \
240+
--results ~/Downloads/m2d-validation.jsonl \
241+
--source-manifest ~/Downloads/youtube-random-1000-20260714/manifest.json \
242+
--output-dir ~/Downloads/youtube-dialogue-background-m2d-ok-20260714
243+
```
244+
245+
The output includes `manifest.json`, `audit.json`, the complete M2D JSONL, and
246+
the accepted WAVs under `audio/`. `balanced-audio/` is a deterministic listening
247+
subset with equal music-led and non-music-led counts. Every record keeps the
248+
per-window scores, ranks, top labels, temporal coverage, rejection reasons,
249+
exact M2D checkpoint hash, and validator policy version.
250+
208251
## AudioSet validation batches
209252

210253
Acquire a reproducible random sample from the official AudioSet segment CSVs.

docs/pipeline/PROGRESS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ was an example batch size, not a workflow limit.
122122
true-stereo, clipping, duration, uniqueness, existence, and SHA-256 gate
123123
passes. The audio payload is 1,920,078,000 bytes; no AudioSet record metadata
124124
or AudioSet candidate source was used.
125+
- M2D fragment validation scored all 1,000 local general-YouTube clips with the
126+
official AudioSet-fine-tuned checkpoint. Policy
127+
`spoken_dialogue_instrumental_background_m2d_v2` accepts 429 clips with
128+
temporally overlapping spoken dialogue and active background, while rejecting
129+
343 for singing, rapping, choir, or other vocal music. The listening output
130+
preserves all 429 accepted clips and includes a 272-clip balanced subset with
131+
136 music-led and 136 effects/ambience-or-mixed clips.
125132
- Live mono-filter job `5ec26b1bb28b420a9245e21d475d26be` completed with
126133
`non_stereo_input`, one input channel, zero chunks, zero stems, and zero model
127134
tasks. A live `targets=voice` API canary produced only voice and residual

pipeline/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ sam-pipeline-stereo-backfill = "sam_audio_pipeline.stereo:main"
2222
sam-pipeline-reconstruction-backfill = "sam_audio_pipeline.reconstruction:main"
2323
sam-pipeline-audio-profile-backfill = "sam_audio_pipeline.audio_profile:main"
2424
sam-pipeline-youtube-random = "sam_audio_pipeline.youtube_random:main"
25+
sam-pipeline-m2d-validate = "sam_audio_pipeline.m2d_validator:main"
2526
sam-audio-flamingo-api = "sam_audio_pipeline.flamingo_api:main"
2627

2728
[dependency-groups]

0 commit comments

Comments
 (0)