Mirco commited on
Commit
2e2f780
1 Parent(s): c3468f8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +77 -45
README.md CHANGED
@@ -1,46 +1,78 @@
1
- ---
2
- language: "en"
3
- thumbnail:
4
- pipeline_tag: automatic-speech-recognition
5
- tags:
6
- - CTC
7
- - Attention
8
- - pytorch
9
- - speechbrain
10
- - Transformer
11
- license: "apache-2.0"
12
- datasets:
13
- - commonvoice
14
- metrics:
15
- - wer
16
- - cer
17
- ---
18
-
19
- <iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
20
- <br/><br/>
21
-
22
- # Work in Progress
23
-
24
- ### Limitations
25
- The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
26
-
27
- # **About SpeechBrain**
28
- - Website: https://speechbrain.github.io/
29
- - Code: https://github.com/speechbrain/speechbrain/
30
- - HuggingFace: https://huggingface.co/speechbrain/
31
-
32
-
33
- # **Citing SpeechBrain**
34
- Please, cite SpeechBrain if you use it for your research or business.
35
-
36
- ```bibtex
37
- @misc{speechbrain,
38
- title={{SpeechBrain}: A General-Purpose Speech Toolkit},
39
- author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
40
- year={2021},
41
- eprint={2106.04624},
42
- archivePrefix={arXiv},
43
- primaryClass={eess.AS},
44
- note={arXiv:2106.04624}
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ```
 
 
1
+ # Vocoder with HiFIGAN trained on LJSpeech
2
+
3
+ This repository provides all the necessary tools for using a [HiFIGAN](https://arxiv.org/abs/2010.05646) vocoder trained with [LJSpeech](https://keithito.com/LJ-Speech-Dataset/).
4
+
5
+ The pre-trained model takes in input a spectrogram and produces a waveform in output. Typically, a vocoder is used after a TTS model that converts an input text into a spectrogram.
6
+
7
+
8
+ ## Install SpeechBrain
9
+
10
+ First of all, currently, you need to install SpeechBrain from the source:
11
+
12
+ 1. Clone SpeechBrain:
13
+
14
+ ```bash
15
+ git clone https://github.com/speechbrain/speechbrain/
16
+ ```
17
+
18
+ 2. Install it:
19
+
20
+ ```
21
+ cd speechbrain
22
+ pip install -r requirements.txt
23
+ pip install -e .
24
+ ```
25
+
26
+ Please notice that we encourage you to read our tutorials and learn more about
27
+ [SpeechBrain](https://speechbrain.github.io).
28
+
29
+ ### Using the Vocoder
30
+
31
+ ```
32
+ from speechbrain.pretrained import HIFIGAN
33
+ hifi_gan = HIFIGAN.from_hparams(source="speechbrain/Vocoder_HiFIGAN", savedir="tmpdir")
34
+ mel_specs = torch.rand(2, 80,298)
35
+ waveforms = hifi_gan.decode_batch(mel_specs)
36
+ ```
37
+ ### Using the Vocoder with the TTS
38
+ ```
39
+ import torchaudio
40
+ from speechbrain.pretrained import Tacotron2
41
+ from speechbrain.pretrained import HIFIGAN
42
+
43
+ # Intialize TTS (tacotron2) and Vocoder (HiFIGAN)
44
+ tacotron2 = Tacotron2.from_hparams(source="speechbrain/TTS_Tacotron2", savedir="tmpdir_tts")
45
+ hifi_gan = HIFIGAN.from_hparams(source="speechbrain/Vocoder_HiFIGAN", savedir="tmpdir_vocoder")
46
+
47
+ # Running the TTS
48
+ mel_output, mel_length, alignment = tacotron2.encode_text("Mary had a little lamb")
49
+
50
+ # Running Vocoder (spectrogram-to-waveform)
51
+ waveforms = hifi_gan.decode_batch(mel_output)
52
+
53
+ # Save the waverform
54
+ torchaudio.save('example_TTS.wav',waveforms.squeeze(1), 22050)
55
+ ```
56
+
57
+ ### Inference on GPU
58
+ To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
59
+
60
+ ### Training
61
+ The model was trained with SpeechBrain.
62
+ To train it from scratch follow these steps:
63
+ 1. Clone SpeechBrain:
64
+ ```bash
65
+ git clone https://github.com/speechbrain/speechbrain/
66
+ ```
67
+ 2. Install it:
68
+ ```bash
69
+ cd speechbrain
70
+ pip install -r requirements.txt
71
+ pip install -e .
72
+ ```
73
+ 3. Run Training:
74
+ ```bash
75
+ cd recipes/LJSpeech/TTS/vocoder/hifi_gan/
76
+ python train.py hparams/train.yaml --data_folder /path/to/LJspeech
77
  ```
78
+ You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/19sLwV7nAsnUuLkoTu5vafURA9Fo2WZgG?usp=sharing).