Coder Social home page Coder Social logo

templeblock / transformertts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from as-ideas/transformertts

0.0 2.0 0.0 2.44 MB

๐Ÿค–๐Ÿ’ฌ Implementation of a Transformer based neural network for text to speech.

Home Page: https://as-ideas.github.io/TransformerTTS/

License: Other

Python 100.00%

transformertts's Introduction



A Text-to-Speech Transformer in TensorFlow 2

Implementation of an autoregressive Transformer based neural network for Text-to-Speech (TTS).
This repo is based on the following paper:

Spectrograms produced with LJSpeech and standard data configuration from this repo are compatible with WaveRNN.

๐Ÿ”ˆ Samples

Can be found here.

These samples' spectrograms are converted using the pre-trained WaveRNN vocoder.

The TTS weights used for these samples can be found here.

Check out the notebooks folder for predictions with TransformerTTS and WaveRNN or just try out our Colab notebook:

Open In Colab

๐Ÿ“– Contents

Installation

Make sure you have:

  • Python >= 3.6

Install espeak as phonemizer backend (for macOS use brew):

sudo apt-get install espeak

Then install the rest with pip:

pip install -r requirements.txt

Read the individual scripts for more command line arguments.

Dataset

You can directly use LJSpeech to create the training dataset.

Configuration

  • If training LJSpeech, or if unsure, simply use config/standard
  • EDIT PATHS: in data_config.yaml edit the paths to point at your dataset and log folders

Custom dataset

Prepare a dataset in the following format:

|- dataset_folder/
|   |- metadata.csv
|   |- wav/
|       |- file1.wav
|       |- ...

where metadata.csv has the following format: wav_file_name|transcription

Create training dataset

python create_dataset.py --config config/standard

Training

python train.py --config config/standard

Training & Model configuration

  • Training and model settings can be configured in model_config.yaml

Resume or restart training

  • To resume training simply use the same configuration files AND --session_name flag, if any
  • To restart training, delete the weights and/or the logs from the logs folder with the training flag --reset_dir (both) or --reset_logs, --reset_weights

Monitor training

We log some information that can be visualized with TensorBoard:

tensorboard --logdir /logs/directory/

Prediction

from utils.config_manager import ConfigManager
from utils.audio import reconstruct_waveform

config_loader = ConfigManager('config/standard')
model = config_loader.load_model()
out = model.predict('Please, say something.')

# Convert spectrogram to wav (with griffin lim)
wav = reconstruct_waveform(out['mel'].numpy().T, config=config_loader.config)

Maintainers

Special thanks

WaveRNN: we took the data processing from here and use their vocoder to produce the samples.
Erogol: for the lively exchange on TTS topics.

Copyright

See LICENSE for details.

transformertts's People

Contributors

cfrancesco avatar cschaefer26 avatar datitran avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.