TTS MultiLingual
1.0.0
pip install TTSSi planea codificar o entrenar modelos, clone TTS e instale localmente.
git clone https://github.com/saba99/TTS-MultiLingual
pip install -e .[all,dev,notebooks] # Select the relevant extrasSi está en Ubuntu (Debian), también puede ejecutar los siguientes comandos para la instalación.
$ 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 )| Ejemplo corto | Ejemplo corto | Ejemplo corto |
Rainbow.mp4 | windy.mp4 | Windy-2.mp4 |
| Rainbow es un fenómeno meteorológico causado por la reflexión, la refracción y la dispersión de la luz | El conductor aprendió su lección. Nunca volverá a conducir al viento | La gente exterior se está inclinando. El viento hace que sea difícil caminar |
| Ejemplo largo | Ejemplo largo | Ejemplo largo |
An.apple.pie.mp4 | Cat.and.a.dog.mp4 | the.farmer.mp4 |
| El árbol estaba lleno de manzanas rojas. El granjero montaba su caballo marrón. Se detuvo debajo del árbol. Extendió la mano y recogió una manzana de una rama. Mordió la manzana cruda. Disfrutó de la manzana. Su caballo giró la cabeza para mirarlo. El agricultor recogió otra manzana del árbol. Se lo dio al caballo. El caballo se comió la manzana cruda. El caballo disfrutaba de la manzana. El granjero puso una docena de manzanas en una bolsa. Montaba el caballo de regreso a casa. Puso el caballo en el granero. Entró en su casa. El gato se frotó contra su pierna. Le dio al gato un tazón de leche tibia. /TD> | El gato negro saltó a la silla. Miró al perro blanco. El perro estaba masticando un hueso. El gato saltó sobre el perro. El perro seguía masticando el hueso. El gato jugó con la cola del perro. El perro seguía masticando el hueso. El gato volvió a la silla. Comenzó a lamer sus patas. El perro se puso de pie. Miró al gato. Lamió el pelaje del gato. El gato lamió la nariz del perro. El perro volvió a su hueso. Un niño corrió por la habitación. Llevaba una camisa amarilla. Casi topó con la silla. El gato saltó de la silla. El gato saltó al sofá. | El agricultor conduce un tractor. El tractor profundiza en el suelo. Planta maíz amarillo en el suelo. Planta el maíz amarillo en la primavera. El maíz crece en el verano. La lluvia ayuda al maíz a crecer. Si no hay lluvia, el maíz muere. Si hay mucha lluvia, hay mucho maíz. Cosecha el maíz amarillo a fines del verano. Venta el maíz en su puesto de verduras. Vende una oreja por 25 centavos. Vende cuatro oídos por $ 1. Venta todo su maíz en solo un mes. Los vecinos aman su maíz. El maíz está fresco. Es de color amarillo brillante. Es sabroso. Es delicioso. Los pájaros también aman su maíz. No lo pagan. Lo comen mientras está en el campo |
| Soporte multilingüe: inglés | Soporte multilingüe: francés | Soporte multilingüe: holandés |
Rain.and.hail.mp4 | frrain.and.hail.mp4 | NL-Rain.and.hail.mp4 |
| Las nubes oscuras estaban en el cielo. El sol se puso. El clima se enfrió. El viento comenzó a soplar. Las hojas soplaron los árboles. El papel voló por el aire. La gente abotonó sus chaquetas. La lluvia comenzó a caer. Al principio, estaba en silencio. Entonces se puso más fuerte | Un arcoíris o arco iris es un fenómeno Ócico y meteorológico que consulte en la apariciónica en el cielo de un arco de luz multicolor | Een Regenboog es Een Gekleurde Cirkelboog Die aan de Hemel Waargenomen Kan Worden als de, Laagstaande |
tts Lista proporcionada modelos:
$ tts --list_models
Obtenga información del modelo (tanto para TTS_Models como para 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
```
Ejecute TTS con modelos predeterminados:
Por ejemplo:
$ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --out_path output/path/speech.wav
Ejecute su propio modelo TTS de múltiples altavoces:
$ 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)