Skip to content

Commit d43bdca

Browse files
author
Michal Warda
committed
Add general YouTube dataset sampler
1 parent 3ad758d commit d43bdca

6 files changed

Lines changed: 885 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ data** dashboard. Each original also reports mono/stereo layout, codec/container
9393
sample rate, bit depth, bitrate, and a lossless/lossy quality tier. The direct
9494
model ZIP API remains unchanged.
9595

96+
A separate resumable sampler can build private, mix-biased datasets directly
97+
from general YouTube search (not AudioSet). It downloads only a short source
98+
section, produces an exact ten-second PCM16/48 kHz stereo WAV, and rejects low
99+
source bitrate/sample rate, duplicated mono, quiet or silent audio, clipping,
100+
and duration errors:
101+
102+
```bash
103+
cd pipeline
104+
uv run sam-pipeline-youtube-random \
105+
--output ~/Downloads/youtube-random-1000-20260714 \
106+
--total 1000 --seed 20260714
107+
```
108+
96109
Generation, prompt, batching, and TF32 policy are configured with the
97110
`SAM_AUDIO_*` environment variables demonstrated in
98111
[`deploy/start-sam-audio-api.sh`](deploy/start-sam-audio-api.sh). A supplied

docs/pipeline/OPERATIONS.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,45 @@ Dashboard state is encoded in clean paths and is safe to refresh or share:
166166
Selecting a tab, job, dataset, or sound updates browser history. Back and
167167
forward navigation restore the corresponding view and selected record.
168168

169+
## General YouTube random datasets
170+
171+
This sampler searches YouTube directly and does not read AudioSet manifests or
172+
timestamps. Randomized, reproducible queries favor program audio containing
173+
voices, music, and environmental effects while excluding obvious music-only,
174+
sleep, ambience, and playlist results. Each video ID contributes at most one
175+
clip.
176+
177+
```bash
178+
cd pipeline
179+
uv run sam-pipeline-youtube-random \
180+
--output ~/Downloads/youtube-random-1000-20260714 \
181+
--total 1000 \
182+
--seed 20260714 \
183+
--query-count 400 \
184+
--results-per-query 15 \
185+
--search-workers 8 \
186+
--download-workers 8 \
187+
--candidate-multiplier 2 \
188+
--max-attempts 2500
189+
```
190+
191+
Acquisition is resumable. `attempts.jsonl` records every accepted, rejected, or
192+
unavailable candidate; `metadata/candidates.json` and `metadata/search.json`
193+
preserve search provenance; `manifest.json` contains only accepted records and
194+
hashes. `audit.json` is written only after reopening and verifying the complete
195+
dataset. The gate requires source audio at 44.1 kHz or better and at least 120
196+
kbps, then verifies exact ten-second PCM16/48 kHz stereo output, real left/right
197+
difference, loudness, silent-frame/run limits, clipping, uniqueness, and SHA-256.
198+
199+
Re-run the same command to continue an interrupted build. Audit an existing set
200+
without downloading:
201+
202+
```bash
203+
uv run sam-pipeline-youtube-random \
204+
--output ~/Downloads/youtube-random-1000-20260714 \
205+
--total 1000 --verify-only
206+
```
207+
169208
## AudioSet validation batches
170209

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

docs/pipeline/PROGRESS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ was an example batch size, not a workflow limit.
3838
facts, with an idempotent historical backfill.
3939
- [x] Give pipeline, review, dataset, job, and source dashboard states durable
4040
URLs with refresh and browser-history restoration.
41+
- [x] Add a resumable general-YouTube (non-AudioSet) sampler with deterministic
42+
discovery, exact ten-second cuts, stereo/source-quality/silence gates,
43+
per-attempt provenance, hashes, and a full-dataset verifier.
4144
- [x] Require stereo input, gate SAM targets with source-scene presence, support
4245
single-stage inference, and use identity pass-through for pure SFX sources.
4346
- [x] Add persistent datasets, successive upload jobs, and reconciliation of

pipeline/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ sam-pipeline-submit = "sam_audio_pipeline.submit:main"
2121
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"
24+
sam-pipeline-youtube-random = "sam_audio_pipeline.youtube_random:main"
2425
sam-audio-flamingo-api = "sam_audio_pipeline.flamingo_api:main"
2526

2627
[dependency-groups]

0 commit comments

Comments
 (0)