# WaveRNNTTS **Repository Path**: yanlang0123/WaveRNNTTS ## Basic Information - **Project Name**: WaveRNNTTS - **Description**: WaveRNN Vocoder + TTS - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-12-03 - **Last Updated**: 2022-05-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # WaveRNN ##### (Update: Vanilla Tacotron One TTS system just implemented - more coming soon!) ![Tacotron with WaveRNN diagrams](assets/tacotron_wavernn.png) Pytorch implementation of Deepmind's WaveRNN model from [Efficient Neural Audio Synthesis](https://arxiv.org/abs/1802.08435v1) # Installation Ensure you have: * Python >= 3.6 * [Pytorch 1 with CUDA](https://pytorch.org/) Then install the rest with pip: > pip install -r requirements.txt # How to Use ### Quick Start If you want to use TTS functionality immediately you can simply use: > python quick_start.py This will generate everything in the default sentences.txt file and output to a new 'quick_start' folder where you can playback the wav files and take a look at the attention plots You can also use that script to generate custom tts sentences and/or use '-u' to generate unbatched (better audio quality): > python quick_start.py -u --input_text "What will happen if I run this command?" ### Training your own Models ![Attenion and Mel Training GIF](assets/training_viz.gif) Download the [LJSpeech](https://keithito.com/LJ-Speech-Dataset/) Dataset. Edit **hparams.py**, point **wav_path** to your dataset and run: > python preprocess.py or use preprocess.py --path to point directly to the dataset ___ Here's my recommendation on what order to run things: 1 - Train Tacotron with: > python train_tacotron.py 2 - You can leave that finish training or at any point you can use: > python train_tacotron.py --force_gta this will force tactron to create a GTA dataset even if it hasn't finish training. 3 - Train WaveRNN with: > python train_wavernn.py --gta NB: You can always just run train_wavernn.py without --gta if you're not interested in TTS. 4 - Generate Sentences with both models using: > python gen_tacotron.py wavernn this will generate default sentences. If you want generate custom sentences you can use > python gen_tacotron.py --input_text "this is whatever you want it to be" wavernn And finally, you can always use --help on any of those scripts to see what options are available :) # Samples [Can be found here.](https://fatchord.github.io/model_outputs/) # Pretrained Models Currently there are two pretrained models available in the /pretrained/ folder': Both are trained on LJSpeech * WaveRNN (Mixture of Logistics output) trained to 800k steps * Tacotron trained to 180k steps ____ ### References * [Efficient Neural Audio Synthesis](https://arxiv.org/abs/1802.08435v1) * [Tacotron: Towards End-to-End Speech Synthesis](https://arxiv.org/abs/1703.10135) * [Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions](https://arxiv.org/abs/1712.05884) ### Acknowlegements * [https://github.com/keithito/tacotron](https://github.com/keithito/tacotron) * [https://github.com/r9y9/wavenet_vocoder](https://github.com/r9y9/wavenet_vocoder) * Special thanks to github users [G-Wang](https://github.com/G-Wang), [geneing](https://github.com/geneing) & [erogol](https://github.com/erogol) 如何使用 快速开始 如果您想立即使用 TTS 功能,您可以简单地使用: python quick_start.py 这将在默认的 sentence.txt 文件中生成所有内容并输出到一个新的“quick_start”文件夹,您可以在其中播放 wav 文件并查看注意力图 您还可以使用该脚本生成自定义 tts 句子和/或使用“-u”生成未批处理(更好的音频质量): python quick_start.py -u --input_text "如果我运行这个命令会发生什么?" 训练你自己的模型 注意和梅尔训练 GIF 下载LJSpeech数据集。 编辑hparams.py,将wav_path指向您的数据集并运行: 蟒蛇预处理.py 或使用 preprocess.py --path 直接指向数据集 这是我对运行顺序的建议: 1 - 训练 Tacotron: python train_tacotron.py 2 - 您可以离开完成培训或在任何时候使用: python train_tacotron.py --force_gta 这将迫使 tactron 创建一个 GTA 数据集,即使它还没有完成训练。 3 - 训练 WaveRNN: python train_wavernn.py --gta 注意:如果你对 TTS 不感兴趣,你可以在没有 --gta 的情况下运行 train_wavernn.py。 4 - 使用两种模型生成句子: python gen_tacotron.py wavernn 这将生成默认句子。如果你想生成自定义句子,你可以使用 python gen_tacotron.py --input_text "这就是你想要的" wavernn 最后,您始终可以在任何这些脚本上使用 --help 来查看可用的选项:)