CoolFace
Datasetpublic

k9cli/video-vec2wav2-tokenizer

video-vec2wav2-tokenizer Production-ready pipeline (Python package video_vec2wav2_tokenizer, CLI command video2dataset) that turns a folder of videos into clean AI training datasets for speech recognition (ASR) and text-to-speech (TTS). videos ──► audio (16 kHz mono PCM) ──► whisper transcript ──► clips ──► metadata.csv / dataset.jsonl / tts_metadata.csv / report.json Video processing — recursive scan of mp4 / mkv / avi / mov / webm, FFmpeg audio extraction to mono ·… See the full description on the dataset page: https://huggingface.co/datasets/k9cli/video-vec2wav2-tokenizer.

sourceHugging Faceupdated 9h agoView on Hugging Face
26likes712kdownloads
test_features.py44 linesDownload Raw Back to tests
1"""Tests for feature extraction and the binary store."""2 3from __future__ import annotations4 5import json6from pathlib import Path7 8import numpy as np9 10from video_vec2wav2_tokenizer.features.extractor import (11    FeatureExtractor,12    compute_mel_spectrogram,13    read_feature_record,14)15 16 17def test_compute_mel_shape(sine_wav: Path) -> None:18    from video_vec2wav2_tokenizer.audio.extractor import load_wav19 20    samples, sr = load_wav(sine_wav)21    mel = compute_mel_spectrogram(samples, sr, n_mels=80)22    assert mel.shape[0] == 8023    assert mel.dtype == np.float3224    assert mel.shape[1] > 025 26 27def test_feature_store_roundtrip(sine_wav: Path, tmp_path: Path) -> None:28    fx = FeatureExtractor(sample_rate=16000, n_mels=40)29    features_dir = tmp_path / "features"30    dat_path = fx.extract_dataset([sine_wav, sine_wav], features_dir)31 32    bin_path = features_dir / "train.bin"33    assert bin_path.exists()34    assert dat_path.exists()35 36    records = [json.loads(line) for line in dat_path.read_text().splitlines() if line]37    assert len(records) == 238 39    audio, mel = read_feature_record(bin_path, records[0])40    assert audio.dtype == np.float3241    assert mel.shape == tuple(records[0]["mel_shape"])42    assert records[0]["sample_rate"] == 1600043    assert records[0]["duration"] > 044 
k9cli/video-vec2wav2-tokenizer · CoolFace