video-vec2wav2-tokenizer-3
收藏资源简介:
该数据集是由video-vec2wav2-tokenizer-3处理管道生成的AI训练数据集,专门用于语音识别(ASR)和文本转语音(TTS)任务。数据来源于输入视频文件夹,通过管道转换为标准化格式。核心数据包括从视频中提取的音频片段及其对应的转录文本,音频被处理为16kHz、单声道、16位PCM格式的WAV文件,并根据语音识别的词级时间戳进行切割,生成独立的剪辑文件。数据集以多种格式输出,包括metadata.csv(音频文件名与转录文本的映射)、dataset.jsonl(每行包含音频路径、文本和时长等信息的JSON对象)、tts_metadata.csv(为TTS任务设计的元数据,包含说话人ID)、report.json(统计信息如总剪辑数、时长分布等)以及可选的特征文件(如存储音频样本和梅尔频谱图的二进制文件)。处理流程涵盖视频扫描、音频提取、语音识别(支持自动语言检测)、分割和数据集构建,支持流式处理和容错,可高效处理大规模源媒体数据,并允许通过配置参数(如最小和最大片段长度)调整音频片段长度。
This dataset is an AI training dataset generated by the video-vec2wav2-tokenizer-3 processing pipeline, specifically designed for speech recognition (ASR) and text-to-speech (TTS) tasks. The data originates from input video folders and is transformed into a standardized format via the pipeline. Core data consists of audio segments extracted from videos along with corresponding transcriptions. The audio is processed into WAV files with 16kHz, mono, 16-bit PCM format, and segmented into individual clip files based on word-level timestamps from speech recognition. The dataset is output in multiple complementary formats, including metadata.csv (a simple mapping of audio filenames to transcriptions), dataset.jsonl (each line as a JSON object containing audio file path, text, duration, etc.), tts_metadata.csv (metadata for TTS tasks with speaker IDs), report.json (statistical information such as total clips, average duration, language distribution), and optional feature files (e.g., storing raw float32 audio samples and mel-spectrograms). The processing pipeline involves video scanning, audio extraction, speech recognition (with automatic language detection), timestamp-based segmentation, and dataset construction. It supports streaming processing and fault tolerance, enabling efficient handling of large-scale (terabyte-level) source media data, and allows configuration of audio segment lengths via parameters like min_segment_length and max_segment_length.
数据集概述
数据集名称:video-vec2wav2-tokenizer-3
版本:Version 3(延续视频到AI数据集分词器项目)
用途:将视频文件夹转换为干净的AI训练数据集,用于语音识别(ASR)和文本转语音(TTS)。
数据处理流程
- 视频处理:递归扫描
mp4 / mkv / avi / mov / webm格式视频,通过FFmpeg提取音频为单声道16 kHz 16-bit PCM WAV格式。 - 语音识别:使用faster-whisper进行自动语言检测和词级时间戳生成,支持CPU和CUDA。
- 分割:根据转录时间戳切割音频为独立片段(如
dataset/audio/000001.wav)。 - 数据集生成:生成
metadata.csv、dataset.jsonl、tts_metadata.csv等文件。 - 特征提取(可选):流式生成
features/train.bin+train.dat,包含float32样本、梅尔频谱图、时长和采样率。 - 统计:生成
report.json,包含总数、时长和语言分布。 - 训练:
train_wav2vec2.py支持HuggingFace Wav2Vec2 CTC训练,可恢复训练、多GPU、混合精度和检查点保存。 - 性能优化:多进程、批处理、tqdm进度条,支持超过1 TB源媒体的内存高效流式处理。
输出格式
| 文件 | 格式示例 |
|---|---|
metadata.csv |
`000001.wav |
dataset.jsonl |
{"audio":"audio/000001.wav","text":"Hello world","duration":2.5} |
tts_metadata.csv |
`000001.wav |
report.json |
总数、总/平均时长、语言分布 |
features/train.bin |
小端float32平面数据:音频样本 + 梅尔频谱图 |
features/train.dat |
JSONL索引(偏移、形状、时长、采样率) |
配置参数(config.yaml)
model_name:facebook/wav2vec2-base-960h(训练模型)whisper_model:large-v3(ASR模型)language:null(自动检测)device:auto(可选cpu或cuda)sample_rate: 16000channels: 1min_segment_length: 1.0max_segment_length: 20.0default_speaker:speaker_001speaker_mode:fixed(可选per_video或per_file)output_dir:datasetfeatures_dir:featuresnum_workers: 4batch_size: 16
架构与设计特点
- 延迟导入:faster-whisper、torch和transformers仅在对应命令运行时导入,核心库和测试保持轻量。
- 流式处理:转录使用whisper生成器;片段和清单行按源视频生成;特征存储逐片段追加。
- 优雅降级:未安装soundfile/librosa时,WAV IO和梅尔频谱图回退至stdlib+NumPy。
- 容错机制:失败视频记录日志并跳过,整体运行继续。
许可证
MIT




