No project description provided
Project description
TTSDS - Text-to-Speech Distribution Score
TTSDS is a comprehensive benchmark for evaluating the quality of synthetic speech in Text-to-Speech (TTS) systems. It assesses multiple aspects of speech quality including prosody, speaker identity, and intelligibility by comparing synthetic speech with both real speech and noise datasets.
Version 2.1.3
We are excited to release TTSDS 2.1.3 - this release restores compatibility with transformers>=5.0, torchaudio>=2.10, and huggingface_hub>=1.4.
TTSDS2 is multilingual and updated quarterly, with a new dataset every time: you can view the results at https://ttsdsbenchmark.com#leaderboard.
Features
-
Multi-dimensional Evaluation: Assess speech quality across different categories:
- Prosody (e.g., pitch, speaking rate)
- Speaker Identity (e.g., speaker verification)
- Intelligibility (e.g., speech recognition)
- Generic Features (e.g., embeddings)
- Environment (e.g., noise robustness)
-
Weighted Scoring: Customizable weights for different evaluation categories
-
Progress Tracking: Real-time progress display with detailed statistics
-
Caching: Efficient caching of intermediate results
-
Error Handling: Robust error handling with optional skipping of failed benchmarks
Installation
System Requirements
# Required system packages
sudo apt-get install ffmpeg automake autoconf unzip sox gfortran subversion libtool
ttsds has been tested with python 3.10, 3.11, and 3.12. Versions <3.10 and >3.12 are not supported (for now).
A note on numpy 2.0
TTSDS has some dependencies which require numpy<2.0.0. Use the following command if the ttsds installation does not automatically install numpy<2.0.0:
pip install "numpy<2"
Python Installation
# Basic installation
pip install ttsds
Optional: Fairseq Installation
If you encounter dependency conflicts with fairseq, use this fork:
pip install git+https://github.com/MiniXC/fairseq-noconf
Development Installation
For development, install with the dev extras:
# Clone the repository
git clone https://github.com/ttsds/ttsds.git
cd ttsds
# Install with development dependencies
pip install -e ".[dev]"
Usage
Basic Example
from ttsds import BenchmarkSuite
from ttsds.util.dataset import DirectoryDataset
# Initialize datasets
datasets = [
DirectoryDataset("path/to/your/dataset", name="your_dataset")
]
reference_datasets = [
DirectoryDataset("path/to/reference/dataset", name="reference")
]
# Create benchmark suite
suite = BenchmarkSuite(
datasets=datasets,
reference_datasets=reference_datasets,
write_to_file="results.csv", # Optional: save results to CSV
skip_errors=True, # Optional: skip failed benchmarks
include_environment=False, # Optional: exclude environment benchmarks
)
# Run benchmarks
results = suite.run()
# Get aggregated results with weighted scores
aggregated = suite.get_aggregated_results()
print(aggregated)
The datasets should be directories containing wav files. Since this is a distributional score, the wav files do not need to include the same content, and the number of files can vary between datasets. However, results are best when the speaker identities are the same.
Custom Category Weights
from ttsds.benchmarks.benchmark import BenchmarkCategory
suite = BenchmarkSuite(
datasets=datasets,
reference_datasets=reference_datasets,
category_weights={
BenchmarkCategory.SPEAKER: 0.25,
BenchmarkCategory.INTELLIGIBILITY: 0.25,
BenchmarkCategory.PROSODY: 0.25,
BenchmarkCategory.GENERIC: 0.25,
BenchmarkCategory.ENVIRONMENT: 0.0,
},
)
Multilingual
suite = BenchmarkSuite(
datasets=datasets,
reference_datasets=reference_datasets,
multilingual=True,
)
Progress Display
The benchmark suite provides a real-time progress display showing:
- Overall progress
- Per-benchmark completion status
- Estimated time remaining
- Error messages (if any)
Configuration
Environment Variables
# Set cache directory (default: ~/.cache/ttsds)
export TTSDS_CACHE_DIR=/path/to/cache
Benchmark Categories
- Speaker: Evaluates speaker identity preservation
- Intelligibility: Measures speech recognition performance
- Prosody: Assesses speech rhythm and intonation
- Generic: General speech quality metrics
- Environment: Noise robustness evaluation - this is excluded by default, set
include_environment=Trueto include it.
Results
The benchmark results include:
- Individual benchmark scores
- Category-wise aggregated scores
- Overall weighted score
- Time taken for each benchmark
- Reference and noise dataset information
Results can be saved to a CSV file for further analysis.
Development
Running Tests
TTSDS includes a comprehensive test suite covering its functionality:
# Run all tests
cd ttsds
./tests/run_tests.py
# Run specific test modules or classes
./tests/run_tests.py tests/unit/benchmarks/test_benchmark.py
./tests/run_tests.py tests/unit/test_ttsds.py::test_benchmark_suite_init
# Run with coverage report
./tests/run_tests.py --cov-report=html
The test suite uses pytest and includes:
- Unit tests for individual components
- Integration tests for the full system
- Test coverage reporting
Documentation
The API documentation is automatically generated from docstrings using mkdocstrings:
# Build the documentation
pip install -e ".[dev]"
mkdocs build
# Serve the documentation locally
mkdocs serve
Citation
@inproceedings{minixhofer2024ttsds,
title={TTSDS-Text-to-Speech Distribution Score},
author={Minixhofer, Christoph and Klejch, Ond{\v{r}}ej and Bell, Peter},
booktitle={SLT},
year={2024},
}
License
ttsds is distributed under the terms of the MIT license.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ttsds-2.1.3.tar.gz.
File metadata
- Download URL: ttsds-2.1.3.tar.gz
- Upload date:
- Size: 5.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8414b375c984d33aa49535dc48c929659da6a9c0b35c635828db105c628398c1
|
|
| MD5 |
f289effcdba50049ad29f259c21c4664
|
|
| BLAKE2b-256 |
5f57610880c18246e7c4d6f6a808bb6a4874b7bbd1ccd49604574c4519a6c156
|
File details
Details for the file ttsds-2.1.3-py3-none-any.whl.
File metadata
- Download URL: ttsds-2.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1e662ab3c05ac7a70c839c10e3b39f2a6b1afc3df604c29435af508be7cd230
|
|
| MD5 |
851dba7c2563c79b70c6aaf4ad058872
|
|
| BLAKE2b-256 |
3e56c76ba59ec1d52f87b22c583f50f0ea6480db05b16001963bbb67ff4aea8a
|