TTS MultiLingual
1.0.0
pip install TTSSe você planeja codificar ou treinar modelos, clone TTS e instale -os localmente.
git clone https://github.com/saba99/TTS-MultiLingual
pip install -e .[all,dev,notebooks] # Select the relevant extrasSe você estiver no Ubuntu (Debian), também pode executar os seguintes comandos para instalação.
$ make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
$ make install from TTS . api import TTS
# Running a multi-speaker and multi-lingual model
# List available TTS models and choose the first one
model_name = TTS . list_models ()[ 0 ]
# Init TTS
tts = TTS ( model_name )
# Run TTS
# Since this model is multi-speaker and multi-lingual, we must set the target speaker and the language
# Text to speech with a numpy output
wav = tts . tts ( "This is a test! This is also a test!!" , speaker = tts . speakers [ 0 ], language = tts . languages [ 0 ])
# Text to speech to a file
tts . tts_to_file ( text = "Hello world!" , speaker = tts . speakers [ 0 ], language = tts . languages [ 0 ], file_path = "output.wav" )
# Running a single speaker model
# Init TTS with the target model name
tts = TTS ( model_name = "tts_models/de/thorsten/tacotron2-DDC" , progress_bar = False , gpu = False )
# Run TTS
tts . tts_to_file ( text = "Ich bin eine Testnachricht." , file_path = OUTPUT_PATH )
# Example voice cloning with YourTTS in English, French and Portuguese:
tts = TTS ( model_name = "tts_models/multilingual/multi-dataset/your_tts" , progress_bar = False , gpu = True )
tts . tts_to_file ( "This is voice cloning." , speaker_wav = "my/cloning/audio.wav" , language = "en" , file_path = "output.wav" )
tts . tts_to_file ( "C'est le clonage de la voix." , speaker_wav = "my/cloning/audio.wav" , language = "fr-fr" , file_path = "output.wav" )
tts . tts_to_file ( "Isso é clonagem de voz." , speaker_wav = "my/cloning/audio.wav" , language = "pt-br" , file_path = "output.wav" )
# Example voice conversion converting speaker of the `source_wav` to the speaker of the `target_wav`
tts = TTS ( model_name = "voice_conversion_models/multilingual/vctk/freevc24" , progress_bar = False , gpu = True )
tts . voice_conversion_to_file ( source_wav = "my/source.wav" , target_wav = "my/target.wav" , file_path = "output.wav" )
# Example voice cloning by a single speaker TTS model combining with the voice conversion model. This way, you can
# clone voices by using any model in TTS.
tts = TTS ( "tts_models/de/thorsten/tacotron2-DDC" )
tts . tts_with_vc_to_file (
"Wie sage ich auf Italienisch, dass ich dich liebe?" ,
speaker_wav = "target/speaker.wav" ,
file_path = "ouptut.wav"
)
# Example text to speech using [Coqui Studio](https://coqui.ai) models. You can use all of your available speakers in the studio.
# [Coqui Studio](https://coqui.ai) API token is required. You can get it from the [account page](https://coqui.ai/account).
# You should set the `COQUI_STUDIO_TOKEN` environment variable to use the API token.
# If you have a valid API token set you will see the studio speakers as separate models in the list.
# The name format is coqui_studio/en/<studio_speaker_name>/coqui_studio
models = TTS (). list_models ()
# Init TTS with the target studio speaker
tts = TTS ( model_name = "coqui_studio/en/Torcull Diarmuid/coqui_studio" , progress_bar = False , gpu = False )
# Run TTS
tts . tts_to_file ( text = "This is a test." , file_path = OUTPUT_PATH )
# Run TTS with emotion and speed control
tts . tts_to_file ( text = "This is a test." , file_path = OUTPUT_PATH , emotion = "Happy" , speed = 1.5 )| Exemplo curto | Exemplo curto | Exemplo curto |
Rainbow.mp4 | windy.mp4 | Windy-2.mp4 |
| Rainbow é um fenômeno meteorológico que é causado por reflexão, refração e dispersão da luz | O motorista aprendeu sua lição. Ele nunca vai dirigir ao vento novamente | As pessoas do lado de fora estão se curvando. O vento torna difícil andar |
| Longo exemplo | Longo exemplo | Longo exemplo |
An.apple.pie.mp4 | Cat.and.a.dog.mp4 | O.Farmer.MP4 |
| A árvore estava cheia de maçãs vermelhas. O fazendeiro estava montando seu cavalo marrom. Ele parou debaixo da árvore. Ele estendeu a mão e pegou uma maçã de um ramo. Ele mordeu a maçã crua. Ele gostou da maçã. Seu cavalo virou a cabeça para olhá -lo. O fazendeiro pegou outra maçã da árvore. Ele deu ao cavalo. O cavalo comeu a maçã crua. O cavalo gostou da maçã. O fazendeiro colocou uma dúzia de maçãs em uma bolsa. Ele andou de cavalo de volta para casa. Ele colocou o cavalo no celeiro. Ele entrou em sua casa. O gato esfregou contra a perna. Ele deu ao gato uma tigela de leite quente. /td> | O gato preto pulou na cadeira. Ele olhou para o cachorro branco. O cachorro estava mastigando um osso. O gato pulou no cachorro. O cachorro continuava mastigando o osso. O gato brincou com a cauda do cachorro. O cachorro continuava mastigando o osso. O gato pulou de volta para a cadeira. Começou a lamber suas patas. O cachorro se levantou. Olhou para o gato. Lambeu o pêlo do gato. O gato lambeu o nariz do cachorro. O cachorro voltou ao seu osso. Um menino correu pela sala. Ele estava usando uma camisa amarela. Ele quase correu para a cadeira. O gato pulou da cadeira. O gato pulou no sofá. | O agricultor dirige um trator. O trator cava o chão. Ele planta milho amarelo no chão. Ele planta o milho amarelo na primavera. O milho cresce no verão. A chuva ajuda o milho a crescer. Se não houver chuva, o milho morre. Se houver muita chuva, há muito milho. Ele colhe o milho amarelo no final do verão. Ele vende o milho em seu suporte de vegetais. Ele vende um ouvido por 25 centavos. Ele vende quatro orelhas por US $ 1. Ele vende todo o seu milho em apenas um mês. Os vizinhos amam seu milho. O milho é fresco. É amarelo brilhante. É saboroso. É delicioso. Os pássaros também amam seu milho. Eles não pagam por isso. Eles comem enquanto está no campo |
| Suporte multilíngue: inglês | Suporte multilíngue: francês | Suporte multilíngue: holandês |
Chuva.and.hail.mp4 | fr-Rain.and.hail.mp4 | nl-rain.and.hail.mp4 |
| Nuvens escuras estavam no céu. O sol se pôs. O tempo ficou frio. O vento começou a soprar. As folhas explodiram das árvores. O papel voou pelo ar. As pessoas abotoavam suas jaquetas. A chuva começou a cair. No começo, estava quieto. Então ficou mais alto | On Arcoíris O Arco Iris es Un Fenómeno ptico y meteorológico que consiste em la aparición en el cielo de un arco de luz multicolor | EEN REGENBOOG É EEN GEKLEURDE Cirkelboog Die aan de Hemel Waargenomen Kan Worden Als de, Laagstande |
tts Modelos fornecidos na lista:
$ tts --list_models
Obtenha informações do modelo (para TTS_Models e vocoder_models):
```
$ tts --model_info_by_name tts_models/tr/common-voice/glow-tts
```
```
$ tts --model_info_by_name vocoder_models/en/ljspeech/hifigan_v2
```
Execute TTS com modelos padrão:
Por exemplo:
$ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --out_path output/path/speech.wav
Execute seu próprio modelo TTS de vários alto-falantes:
$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/model.pth --config_path path/to/config.json --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>
|- notebooks/ (Jupyter Notebooks for model evaluation, parameter selection and data analysis.)
|- utils/ (common utilities.)
|- TTS
|- bin/ (folder for all the executables.)
|- train*.py (train your target model.)
|- ...
|- tts/ (text to speech models)
|- layers/ (model layer definitions)
|- models/ (model definitions)
|- utils/ (model specific utilities.)
|- speaker_encoder/ (Speaker Encoder models.)
|- (same)
|- vocoder/ (Vocoder models.)
|- (same)