Spaces:
Sleeping
Download src/wavtts/eval/README.md from Pavanb/WavTTS_Inference: direct link, hf CLI and curl.
- Browser
- Download file 3.01 kB
-
https://huggingface.co/spaces/Pavanb/WavTTS_Inference/resolve/main/src/wavtts/eval/README.md
- Command line
-
hf download hf://spaces/Pavanb/WavTTS_Inference/src/wavtts/eval/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Pavanb/WavTTS_Inference/resolve/main/src/wavtts/eval/README.md
A newer version of the Gradio SDK is available: 6.33.0
Evaluation
1. Installation
First, install the optional evaluation dependencies from the WavTTS root directory:
pip install -e .[eval]
2. Prepare Evaluation Models
Objective evaluation requires ASR models and a speaker similarity model.
- Chinese ASR Model: Paraformer-zh
- English ASR Model: Faster-Whisper
- Speaker Similarity Model: WavLM (download
wavlm_large_finetune.pthfrom Google Drive)
⚠️ Important Checkpoint Setup:
- ASR Models: By default, the ASR models will be downloaded automatically from Hugging Face. If you are running in an offline environment with the
--localflag, download them manually and updateasr_ckpt_dirineval_librispeech_test_clean.pyandeval_seedtts_testset.py.- WavLM Model: This model MUST be downloaded manually. Pass the downloaded
wavlm_large_finetune.pthpath with--wavlm_ckpt_dirfor SIM metric scripts.
3. Prepare Test Datasets
We recommend using the following standard datasets for evaluation:
- Seed-TTS Testset (ZH/EN): Download from seed-tts-eval.
- LibriSpeech test-clean (EN): Download from OpenSLR.
Unzip the downloaded datasets and place them into your local data/ directory.
4. Running Evaluations
You can either run the full generation and evaluation pipeline automatically, or compute metrics step by step on existing audio files.
A. All-in-One Batch Inference & Evaluation
To run batch inference and evaluation, execute the following commands:
# Set up Accelerate if you have not configured it yet.
accelerate config
# Generate audio only, skipping metric calculation.
bash src/wavtts/eval/eval_infer_batch.sh --infer-only
# Generate audio and calculate objective metrics automatically.
bash src/wavtts/eval/eval_infer_batch.sh --full-eval --wavlm-ckpt-dir "<WAVLM_CKPT_PATH>"
B. Calculate Metrics Manually
If you have already generated .wav files via batch inference, you can evaluate them independently by pointing the scripts to your <GEN_WAV_DIR>.
# Evaluation [WER] for Seed-TTS test [ZH] set
python src/wavtts/eval/eval_seedtts_testset.py --eval_task wer --lang zh --gen_wav_dir "<GEN_WAV_DIR>" --gpu_nums 8
# Evaluation [SIM] for LibriSpeech-PC test-clean (cross-sentence)
python src/wavtts/eval/eval_librispeech_test_clean.py --eval_task sim --gen_wav_dir "<GEN_WAV_DIR>" --librispeech_test_clean_path "<TEST_CLEAN_PATH>" --wavlm_ckpt_dir "<WAVLM_CKPT_PATH>"
# Evaluation [UTMOS] for any directory containing audio files
python src/wavtts/eval/eval_utmos.py --audio_dir "<GEN_WAV_DIR>" --ext wav
💡 Tip: Once evaluation is completed, detailed results will be saved as
_*_results.jsonlfiles directly within your<GEN_WAV_DIR>directory.