https://github.com/ariedamuco/real-time-voice-cloning
Clone a voice in 5 seconds to generate arbitrary speech in real-time
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Last synced: 9 months ago
·
JSON representation
Repository
Clone a voice in 5 seconds to generate arbitrary speech in real-time
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Fork of CorentinJ/Real-Time-Voice-Cloning
Created almost 7 years ago
· Last pushed almost 7 years ago
https://github.com/ariedamuco/Real-Time-Voice-Cloning/blob/master/
# Real-Time Voice Cloning This repository is an implementation of [Transfer Learning from Speaker Verification to Multispeaker Text-To-Speech Synthesis](https://arxiv.org/pdf/1806.04558.pdf) with a vocoder that works in real-time. It is a three-stage deep learning framework that allows to create a numerical representation of a voice from a few seconds of audio, and to use it to condition a text-to-speech model trained to generalize to new voices. **Video demonstration:** [](https://www.youtube.com/watch?v=-O_hYhToKoA) ### Papers implemented | URL | Designation | Title | Implementation source | | --- | ----------- | ----- | --------------------- | |[**1806.04558**](https://arxiv.org/pdf/1806.04558.pdf) | **SV2TTS** | **Transfer Learning from Speaker Verification to Multispeaker Text-To-Speech Synthesis** | This repo | |[1802.08435](https://arxiv.org/pdf/1802.08435.pdf) | WaveRNN (vocoder) | Efficient Neural Audio Synthesis | [fatchord/WaveRNN](https://github.com/fatchord/WaveRNN) | |[1712.05884](https://arxiv.org/pdf/1712.05884.pdf) | Tacotron 2 (synthesizer) | Natural TTS Synthesis by Conditioning Wavenet on Mel Spectrogram Predictions | [Rayhane-mamah/Tacotron-2](https://github.com/Rayhane-mamah/Tacotron-2) |[1710.10467](https://arxiv.org/pdf/1710.10467.pdf) | GE2E (encoder)| Generalized End-To-End Loss for Speaker Verification | This repo | ### Requirements You will need the following whether you plan to use the toolbox only or to retrain the models. **Python 3.7**. Python 3.6 might work too, but I wouldn't go lower because I make extensive use of pathlib. Run `pip -r requirements.txt` to install the necessary packages. Additionally you will need [PyTorch](https://pytorch.org/get-started/locally/) and PyQt4 (Linux: package `python-qt4`, [Windows](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4)) A GPU is *highly* recommended (CPU-only is currently not implemented), but you don't necessarily need a high tier GPU if you only want to use the toolbox. ### Pretrained models Downloadable [here](https://drive.google.com/file/d/1n1sPXvT34yXFLT47QZA6FIRGrwMeSsZc/view?usp=sharing) (375mb). Merge the contents of the archive with the contents of the repository. Encoder: trained 1.56M steps (2 months\* with a single GPU) with a batch size of 64 Synthesizer: trained 256k steps (1 week with 4 GPUs) with a batch size of 144 Vocoder: trained 428k steps (4 days with a single GPU) with a batch size of 100 \* with recent optimizations I made, it should now be closer to 20 days. ## Datasets, toolbox, preprocessing and training ### Datasets Ideally, you want to keep all your datasets under a same directory. All prepreprocessing scripts will, by default, output the clean data to a new directory `SV2TTS` created in your datasets root directory. Inside this directory will be created a directory for each model: the encoder, synthesizer and vocoder. **For training:** you will need the following datasets: For the encoder: - **[LibriSpeech](http://www.openslr.org/12/):** train-other-500 (extract as `LibriSpeech/train-other-500`) - **[VoxCeleb1](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox1.html):** Dev A - D as well as the metadata file (extract as `VoxCeleb1/wav` and `VoxCeleb1/vox1_meta.csv`) - **[VoxCeleb2](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox2.html):** Dev A - H (extract as `VoxCeleb2/dev`) For the synthesizer and the vocoder: - **[LibriSpeech](http://www.openslr.org/12/):** train-clean-100, train-clean-360 (extract as `LibriSpeech/train-clean-100` and `LibriSpeech/train-clean-360`) - **[LibriSpeech alignments](https://github.com/CorentinJ/librispeech-alignments#download-links):** take the first link and merge the directory structure with the LibriSpeech datasets you have downloaded (do not take the alignments from the datasets you haven't downloaded else the scripts will think you have them) **For trying the toolbox alone**: I recommend downloading only `LibriSpeech/train-clean-100` as above. Feel free to adapt the code to your needs. Other interesting datasets that you could use include **[VCTK](https://homepages.inf.ed.ac.uk/jyamagis/page3/page58/page58.html)** (used in the SV2TTS paper) or **[M-AILABS](https://www.caito.de/2019/01/the-m-ailabs-speech-dataset/)**. ### Toolbox Here's the great thing about this repo: you're expected to run all python scripts in their alphabetical order. Begin with `python demo_toolbox.py` to try the toolbox yourself. `datasets_root` is the directory that contains your LibriSpeech, VoxCeleb or other datasets. You can also have your own dataset in that directory, see the help message for `demo_toolbox.py`. It is not mandatory to have datasets in your `datasets_root`. ### Preprocessing and training Pass `-h` to get argument infos for any script. If you want to train models yourself, run the remaining scripts: `python encoder_preprocess.py ` `python encoder_train.py my_run ` The encoder uses visdom. You can disable it, but it's nice to have. Here's what the environment looks like:  Then you have two separate scripts to generate the data of the synthesizer. This is convenient in case you want to retrain the encoder, you will then have to regenerate embeddings for the synthesizer. Begin with the audios and the mel spectrograms: `python synthesizer_preprocess_audio.py ` Then the embeddings: `python synthesizer_preprocess_embeds.py /synthesizer` You can then train the synthesizer: `python synthesizer_train.py my_run /synthesizer` The synthesizer will output generated audios and spectrograms to its model directory when training. Refer to https://github.com/Rayhane-mamah/Tacotron-2 if you need help. Use the synthesizer to generate training data for the vocoder: `python vocoder_preprocess.py ` And finally, train the vocoder: `python vocoder_preprocess.py ` The vocoder also outputs ground truth/generated audios to its model directory. ## TODO list and planned features ### Implementation - [ ] Let the user decide if they want to use speaker embeddings or utterance embeddings for training the synthesizer. - [ ] Multi-GPU training support for the encoder - [ ] Figure out which device is best to compute the loss on the encoder - [ ] Move on to a pytorch implementation of the synthesizer? - [ ] Post-generation cleaning routines for the vocoder? ### Toolbox - [ ] Handle multiple users in the toolbox - [ ] Allow for saving generated wavs in the toolbox - [ ] Use the top left space to draw a legend (rather than doing it inside the plot), and give the possibility to remove speakers from there - [x] Display vocoder generation ### Code style - [ ] Object-oriented inference rather than the current static style - [ ] Setup a config file to allow for default argparse values (mainly datasets_root). - [ ] Change the structure of the hparams file for each model. I think a namespace is the better solution. - [ ] Properly document all inference functions ## Contribution Feel free to open issues or PRs for any problem you may encounter, typos that you see or aspects that are confusing.
Owner
- Name: Arieda Muço
- Login: ariedamuco
- Kind: user
- Company: @Central European University
- Website: https://sites.google.com/view/ariedamuco/home
- Twitter: arieda_muco
- Repositories: 1
- Profile: https://github.com/ariedamuco
Assistant Professor of Economics at CEU. Image animated with https://github.com/bryandlee/animegan2-pytorch