Skip to content

Commit 65958ea

Browse files
committed
Add preliminary sphinx documentation
1 parent 6b265ae commit 65958ea

27 files changed

+1200
-198
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ events.out*
140140
old_configs/*
141141
model_importers/*
142142
model_profiling/*
143-
docs/*
143+
docs/source/TODO/*
144144
.noseids
145145
.dccache
146146
log.txt

Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ help:
66

77
target_dirs := tests TTS notebooks
88

9-
system-deps: ## install linux system deps
10-
sudo apt-get install -y libsndfile1-dev
11-
12-
dev-deps: ## install development deps
13-
pip install -r requirements.dev.txt
14-
pip install -r requirements.tf.txt
15-
16-
deps: ## install 🐸 requirements.
17-
pip install -r requirements.txt
18-
199
test_all: ## run tests and don't stop on an error.
2010
nosetests --with-cov -cov --cover-erase --cover-package TTS tests --nologcapture --with-id
2111
./run_bash_tests.sh
@@ -34,5 +24,21 @@ style: ## update code style.
3424
lint: ## run pylint linter.
3525
pylint ${target_dirs}
3626

27+
system-deps: ## install linux system deps
28+
sudo apt-get install -y libsndfile1-dev
29+
30+
dev-deps: ## install development deps
31+
pip install -r requirements.dev.txt
32+
pip install -r requirements.tf.txt
33+
34+
doc-deps: ## install docs dependencies
35+
pip install -r docs/requirements.txt
36+
37+
hub-deps: ## install deps for torch hub use
38+
pip install -r requirements.hub.txt
39+
40+
deps: ## install 🐸 requirements.
41+
pip install -r requirements.txt
42+
3743
install: ## install 🐸 TTS for development.
3844
pip install -e .[all]

README.md

Lines changed: 16 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
[![CircleCI](https://github.com/coqui-ai/TTS/actions/workflows/main.yml/badge.svg)]()
77
[![License](<https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg>)](https://opensource.org/licenses/MPL-2.0)
8+
[![Docs](<https://readthedocs.org/projects/tts/badge/?version=latest&style=plastic>)](https://tts.readthedocs.io/en/latest/)
89
[![PyPI version](https://badge.fury.io/py/TTS.svg)](https://badge.fury.io/py/TTS)
910
[![Covenant](https://camo.githubusercontent.com/7d620efaa3eac1c5b060ece5d6aacfcc8b81a74a04d05cd0398689c01c4463bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e7472696275746f72253230436f76656e616e742d76322e3025323061646f707465642d6666363962342e737667)](https://github.com/coqui-ai/TTS/blob/master/CODE_OF_CONDUCT.md)
1011
[![Downloads](https://pepy.tech/badge/tts)](https://pepy.tech/project/tts)
@@ -16,12 +17,10 @@
1617

1718
📢 [English Voice Samples](https://erogol.github.io/ddc-samples/) and [SoundCloud playlist](https://soundcloud.com/user-565970875/pocket-article-wavernn-and-tacotron2)
1819

19-
👩🏽‍🍳 [TTS training recipes](https://github.com/erogol/TTS_recipes)
20-
2120
📄 [Text-to-Speech paper collection](https://github.com/erogol/TTS-papers)
2221

2322
## 💬 Where to ask questions
24-
Please use our dedicated channels for questions and discussion. Help is much more valuable if it's shared publicly, so that more people can benefit from it.
23+
Please use our dedicated channels for questions and discussion. Help is much more valuable if it's shared publicly so that more people can benefit from it.
2524

2625
| Type | Platforms |
2726
| ------------------------------- | --------------------------------------- |
@@ -40,14 +39,11 @@ Please use our dedicated channels for questions and discussion. Help is much mor
4039
## 🔗 Links and Resources
4140
| Type | Links |
4241
| ------------------------------- | --------------------------------------- |
42+
| 💼 **Documentation** | [ReadTheDocs](https://tts.readthedocs.io/en/latest/)
4343
| 💾 **Installation** | [TTS/README.md](https://github.com/coqui-ai/TTS/tree/dev#install-tts)|
4444
| 👩‍💻 **Contributing** | [CONTRIBUTING.md](https://github.com/coqui-ai/TTS/blob/main/CONTRIBUTING.md)|
4545
| 📌 **Road Map** | [Main Development Plans](https://github.com/coqui-ai/TTS/issues/378)
46-
| 👩🏾‍🏫 **Tutorials and Examples** | [TTS/Wiki](https://github.com/coqui-ai/TTS/wiki/%F0%9F%90%B8-TTS-Notebooks,-Examples-and-Tutorials) |
4746
| 🚀 **Released Models** | [TTS Releases](https://github.com/coqui-ai/TTS/releases) and [Experimental Models](https://github.com/coqui-ai/TTS/wiki/Experimental-Released-Models)|
48-
| 🖥️ **Demo Server** | [TTS/server](https://github.com/coqui-ai/TTS/tree/master/TTS/server)|
49-
| 🤖 **Synthesize speech** | [TTS/README.md](https://github.com/coqui-ai/TTS#example-synthesizing-speech-on-terminal-using-the-released-models)|
50-
| 🛠️ **Implementing a New Model** | [TTS/Wiki](https://github.com/coqui-ai/TTS/wiki/Implementing-a-New-Model-in-%F0%9F%90%B8TTS)|
5147

5248
## 🥇 TTS Performance
5349
<p align="center"><img src="https://raw.githubusercontent.com/coqui-ai/TTS/main/images/TTS-performance.png" width="800" /></p>
@@ -56,20 +52,19 @@ Underlined "TTS*" and "Judy*" are 🐸TTS models
5652
<!-- [Details...](https://github.com/coqui-ai/TTS/wiki/Mean-Opinion-Score-Results) -->
5753

5854
## Features
59-
- High performance Deep Learning models for Text2Speech tasks.
55+
- High-performance Deep Learning models for Text2Speech tasks.
6056
- Text2Spec models (Tacotron, Tacotron2, Glow-TTS, SpeedySpeech).
6157
- Speaker Encoder to compute speaker embeddings efficiently.
6258
- Vocoder models (MelGAN, Multiband-MelGAN, GAN-TTS, ParallelWaveGAN, WaveGrad, WaveRNN)
6359
- Fast and efficient model training.
64-
- Detailed training logs on console and Tensorboard.
65-
- Support for multi-speaker TTS.
66-
- Efficient Multi-GPUs training.
60+
- Detailed training logs on the terminal and Tensorboard.
61+
- Support for Multi-speaker TTS.
62+
- Efficient, flexible, lightweight but feature complete `Trainer API`.
6763
- Ability to convert PyTorch models to Tensorflow 2.0 and TFLite for inference.
68-
- Released models in PyTorch, Tensorflow and TFLite.
64+
- Released and read-to-use models.
6965
- Tools to curate Text2Speech datasets under```dataset_analysis```.
70-
- Demo server for model testing.
71-
- Notebooks for extensive model benchmarking.
72-
- Modular (but not too much) code base enabling easy testing for new ideas.
66+
- Utilities to use and test your models.
67+
- Modular (but not too much) code base enabling easy implementation of new ideas.
7368

7469
## Implemented Models
7570
### Text-to-Spectrogram
@@ -98,8 +93,9 @@ Underlined "TTS*" and "Judy*" are 🐸TTS models
9893
- WaveRNN: [origin](https://github.com/fatchord/WaveRNN/)
9994
- WaveGrad: [paper](https://arxiv.org/abs/2009.00713)
10095
- HiFiGAN: [paper](https://arxiv.org/abs/2010.05646)
96+
- UnivNet: [paper](https://arxiv.org/abs/2106.07889)
10197

102-
You can also help us implement more models. Some 🐸TTS related work can be found [here](https://github.com/erogol/TTS-papers).
98+
You can also help us implement more models.
10399

104100
## Install TTS
105101
🐸TTS is tested on Ubuntu 18.04 with **python >= 3.6, < 3.9**.
@@ -110,7 +106,7 @@ If you are only interested in [synthesizing speech](https://github.com/coqui-ai/
110106
pip install TTS
111107
```
112108

113-
By default this only installs the requirements for PyTorch. To install the tensorflow dependencies as well, use the `tf` extra.
109+
By default, this only installs the requirements for PyTorch. To install the tensorflow dependencies as well, use the `tf` extra.
114110

115111
```bash
116112
pip install TTS[tf]
@@ -123,12 +119,6 @@ git clone https://github.com/coqui-ai/TTS
123119
pip install -e .[all,dev,notebooks,tf] # Select the relevant extras
124120
```
125121

126-
We use ```espeak-ng``` to convert graphemes to phonemes. You might need to install separately.
127-
128-
```bash
129-
sudo apt-get install espeak-ng
130-
```
131-
132122
If you are on Ubuntu (Debian), you can also run following commands for installation.
133123

134124
```bash
@@ -137,6 +127,7 @@ $ make install
137127
```
138128

139129
If you are on Windows, 👑@GuyPaddock wrote installation instructions [here](https://stackoverflow.com/questions/66726331/how-can-i-run-mozilla-tts-coqui-tts-training-with-cuda-on-a-windows-system).
130+
140131
## Directory Structure
141132
```
142133
|- notebooks/ (Jupyter Notebooks for model evaluation, parameter selection and data analysis.)
@@ -147,6 +138,7 @@ If you are on Windows, 👑@GuyPaddock wrote installation instructions [here](ht
147138
|- distribute.py (train your TTS model using Multiple GPUs.)
148139
|- compute_statistics.py (compute dataset statistics for normalization.)
149140
|- convert*.py (convert target torch model to TF.)
141+
|- ...
150142
|- tts/ (text to speech models)
151143
|- layers/ (model layer definitions)
152144
|- models/ (model definitions)
@@ -156,167 +148,4 @@ If you are on Windows, 👑@GuyPaddock wrote installation instructions [here](ht
156148
|- (same)
157149
|- vocoder/ (Vocoder models.)
158150
|- (same)
159-
```
160-
161-
## Sample Model Output
162-
Below you see Tacotron model state after 16K iterations with batch-size 32 with LJSpeech dataset.
163-
164-
> "Recent research at Harvard has shown meditating for as little as 8 weeks can actually increase the grey matter in the parts of the brain responsible for emotional regulation and learning."
165-
166-
Audio examples: [soundcloud](https://soundcloud.com/user-565970875/pocket-article-wavernn-and-tacotron2)
167-
168-
<img src="images/example_model_output.png?raw=true" alt="example_output" width="400"/>
169-
170-
## Datasets and Data-Loading
171-
🐸TTS provides a generic dataloader easy to use for your custom dataset.
172-
You just need to write a simple function to format the dataset. Check ```datasets/preprocess.py``` to see some examples.
173-
After that, you need to set ```dataset``` fields in ```config.json```.
174-
175-
Some of the public datasets that we successfully applied 🐸TTS:
176-
177-
- [LJ Speech](https://keithito.com/LJ-Speech-Dataset/)
178-
- [Nancy](http://www.cstr.ed.ac.uk/projects/blizzard/2011/lessac_blizzard2011/)
179-
- [TWEB](https://www.kaggle.com/bryanpark/the-world-english-bible-speech-dataset)
180-
- [M-AI-Labs](http://www.caito.de/2019/01/the-m-ailabs-speech-dataset/)
181-
- [LibriTTS](https://openslr.org/60/)
182-
- [Spanish](https://drive.google.com/file/d/1Sm_zyBo67XHkiFhcRSQ4YaHPYM0slO_e/view?usp=sharing) - thx! @carlfm01
183-
184-
## Example: Synthesizing Speech on Terminal Using the Released Models.
185-
<img src="images/tts_cli.gif"/>
186-
187-
After the installation, 🐸TTS provides a CLI interface for synthesizing speech using pre-trained models. You can either use your own model or the release models under 🐸TTS.
188-
189-
Listing released 🐸TTS models.
190-
191-
```bash
192-
tts --list_models
193-
```
194-
195-
Run a TTS model, from the release models list, with its default vocoder. (Simply copy and paste the full model names from the list as arguments for the command below.)
196-
197-
```bash
198-
tts --text "Text for TTS" \
199-
--model_name "<type>/<language>/<dataset>/<model_name>" \
200-
--out_path folder/to/save/output.wav
201-
```
202-
203-
Run a tts and a vocoder model from the released model list. Note that not every vocoder is compatible with every TTS model.
204-
205-
```bash
206-
tts --text "Text for TTS" \
207-
--model_name "<type>/<language>/<dataset>/<model_name>" \
208-
--vocoder_name "<type>/<language>/<dataset>/<model_name>" \
209-
--out_path folder/to/save/output.wav
210-
```
211-
212-
Run your own TTS model (Using Griffin-Lim Vocoder)
213-
214-
```bash
215-
tts --text "Text for TTS" \
216-
--model_path path/to/model.pth.tar \
217-
--config_path path/to/config.json \
218-
--out_path folder/to/save/output.wav
219-
```
220-
221-
Run your own TTS and Vocoder models
222-
223-
```bash
224-
tts --text "Text for TTS" \
225-
--config_path path/to/config.json \
226-
--model_path path/to/model.pth.tar \
227-
--out_path folder/to/save/output.wav \
228-
--vocoder_path path/to/vocoder.pth.tar \
229-
--vocoder_config_path path/to/vocoder_config.json
230-
```
231-
232-
Run a multi-speaker TTS model from the released models list.
233-
234-
```bash
235-
tts --model_name "<type>/<language>/<dataset>/<model_name>" --list_speaker_idxs # list the possible speaker IDs.
236-
tts --text "Text for TTS." --out_path output/path/speech.wav --model_name "<language>/<dataset>/<model_name>" --speaker_idx "<speaker_id>"
237-
```
238-
239-
**Note:** You can use ```./TTS/bin/synthesize.py``` if you prefer running ```tts``` from the TTS project folder.
240-
241-
## Example: Using the Demo Server for Synthesizing Speech
242-
243-
<!-- <img src="https://raw.githubusercontent.com/coqui-ai/TTS/main/images/demo_server.gif" height="56"/> -->
244-
<img src="images/demo_server.gif"/>
245-
246-
You can boot up a demo 🐸TTS server to run inference with your models. Note that the server is not optimized for performance
247-
but gives you an easy way to interact with the models.
248-
249-
The demo server provides pretty much the same interface as the CLI command.
250-
251-
```bash
252-
tts-server -h # see the help
253-
tts-server --list_models # list the available models.
254-
```
255-
256-
Run a TTS model, from the release models list, with its default vocoder.
257-
If the model you choose is a multi-speaker TTS model, you can select different speakers on the Web interface and synthesize
258-
speech.
259-
260-
```bash
261-
tts-server --model_name "<type>/<language>/<dataset>/<model_name>"
262-
```
263-
264-
Run a TTS and a vocoder model from the released model list. Note that not every vocoder is compatible with every TTS model.
265-
266-
```bash
267-
tts-server --model_name "<type>/<language>/<dataset>/<model_name>" \
268-
--vocoder_name "<type>/<language>/<dataset>/<model_name>"
269-
```
270-
271-
272-
## Example: Training and Fine-tuning LJ-Speech Dataset
273-
Here you can find a [CoLab](https://gist.github.com/erogol/97516ad65b44dbddb8cd694953187c5b) notebook for a hands-on example, training LJSpeech. Or you can manually follow the guideline below.
274-
275-
To start with, split ```metadata.csv``` into train and validation subsets respectively ```metadata_train.csv``` and ```metadata_val.csv```. Note that for text-to-speech, validation performance might be misleading since the loss value does not directly measure the voice quality to the human ear and it also does not measure the attention module performance. Therefore, running the model with new sentences and listening to the results is the best way to go.
276-
277-
```
278-
shuf metadata.csv > metadata_shuf.csv
279-
head -n 12000 metadata_shuf.csv > metadata_train.csv
280-
tail -n 1100 metadata_shuf.csv > metadata_val.csv
281-
```
282-
283-
To train a new model, you need to define your own ```config.json``` to define model details, trainin configuration and more (check the examples). Then call the corressponding train script.
284-
285-
For instance, in order to train a tacotron or tacotron2 model on LJSpeech dataset, follow these steps.
286-
287-
```bash
288-
python TTS/bin/train_tacotron.py --config_path TTS/tts/configs/config.json
289-
```
290-
291-
To fine-tune a model, use ```--restore_path```.
292-
293-
```bash
294-
python TTS/bin/train_tacotron.py --config_path TTS/tts/configs/config.json --restore_path /path/to/your/model.pth.tar
295-
```
296-
297-
To continue an old training run, use ```--continue_path```.
298-
299-
```bash
300-
python TTS/bin/train_tacotron.py --continue_path /path/to/your/run_folder/
301-
```
302-
303-
For multi-GPU training, call ```distribute.py```. It runs any provided train script in multi-GPU setting.
304-
305-
```bash
306-
CUDA_VISIBLE_DEVICES="0,1,4" python TTS/bin/distribute.py --script train_tacotron.py --config_path TTS/tts/configs/config.json
307-
```
308-
309-
Each run creates a new output folder accomodating used ```config.json```, model checkpoints and tensorboard logs.
310-
311-
In case of any error or intercepted execution, if there is no checkpoint yet under the output folder, the whole folder is going to be removed.
312-
313-
You can also enjoy Tensorboard, if you point Tensorboard argument```--logdir``` to the experiment folder.
314-
315-
## [Contribution guidelines](https://github.com/coqui-ai/TTS/blob/main/CONTRIBUTING.md)
316-
### Acknowledgement
317-
- https://github.com/keithito/tacotron (Dataset pre-processing)
318-
- https://github.com/r9y9/tacotron_pytorch (Initial Tacotron architecture)
319-
- https://github.com/kan-bayashi/ParallelWaveGAN (GAN based vocoder library)
320-
- https://github.com/jaywalnut310/glow-tts (Original Glow-TTS implementation)
321-
- https://github.com/fatchord/WaveRNN/ (Original WaveRNN implementation)
322-
- https://arxiv.org/abs/2010.05646 (Original HiFiGAN implementation)
151+
```

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/README.md

Whitespace-only changes.

docs/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
furo
2+
myst-parser == 0.15.1
3+
sphinx == 4.0.2
4+
sphinx_inline_tabs
5+
sphinx_copybutton

docs/source/_static/logo.png

38 KB
Loading

docs/source/audio_processor.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# AudioProcessor
2+
3+
`TTS.utils.audio.AudioProcessor` is the core class for all the audio processing routines. It provides an API for
4+
5+
- Feature extraction.
6+
- Sound normalization.
7+
- Reading and writing audio files.
8+
- Sampling audio signals.
9+
- Normalizing and denormalizing audio signals.
10+
- Griffin-Lim vocoder.
11+
12+
The `AudioProcessor` needs to be initialized with `TTS.config.shared_configs.BaseAudioConfig`. Any model config
13+
also must inherit or initiate `BaseAudioConfig`.
14+
15+
## AudioProcessor
16+
```{eval-rst}
17+
.. autoclass:: TTS.utils.audio.AudioProcessor
18+
:members:
19+
```
20+
21+
## BaseAudioConfig
22+
```{eval-rst}
23+
.. autoclass:: TTS.config.shared_configs.BaseAudioConfig
24+
:members:
25+
```

0 commit comments

Comments
 (0)