Giter Club home page Giter Club logo

tts-cn's Introduction

🐸Coqui.ai 新闻

  • 📣 ⓍTTSv2 现已推出,支持 16 种语言,并且全面提升性能。
  • 📣 ⓍTTS 微调代码已发布。检查示例食谱
  • 📣 ⓍTTS 现在可以以 <200 毫秒的延迟进行流式传输。
  • 📣 ⓍTTS,我们的生产 TTS 模型,可以讲 13 种语言,已发布博客文章演示文档
  • 📣 🐶Bark现在可用于通过无约束的语音克隆进行推理。文档
  • 📣 您可以通过 🐸TTS 使用约 1100 个 Fairseq 模型
  • 📣 🐸TTS 现在支持🐢Tortoise,推理速度更快。文档

🐸TTS 是一个用于高级文本转语音生成的库。

🚀 超过 1100 种语言的预训练模型。

🛠️ 用于以任何语言训练新模型和微调现有模型的工具。

📚 用于数据集分析和管理的实用程序。


不和谐 执照 PyPI版本 盟约 下载 DOI

Github动作 Github动作 Github动作 Github动作 Github动作 Github动作 Github动作 Github动作 Github动作 Github动作 Github动作 文档


💬 哪里可以提问

请使用我们的专用渠道进行提问和讨论。如果公开分享帮助,那么帮助就会更有价值,以便更多的人可以从中受益。

类型 平台
🚨错误报告 GitHub 问题跟踪器
🎁功能请求和想法 GitHub 问题跟踪器
👩‍💻使用问题 GitHub 讨论
🗯一般讨论 GitHub 讨论Discord

🔗 链接和资源

类型 链接
💼文档 阅读文档
💾安装 TTS/自述文件.md
👩‍💻贡献 贡献.md
📌路线图 主要发展计划
🚀已发布型号 TTS 版本实验模型
📰论文 TTS 论文

🥇 TTS 性能

带下划线的“TTS*”和“Judy*”是未开源发布的内部🐸TTS 模型。他们来这里是为了展示潜力。以点为前缀的模型(.Jofish、.Abe 和 .Janice)是真实的人声。

特征

  • 用于 Text2Speech 任务的高性能深度学习模型。
    • Text2Spec 模型(Tacotron、Tacotron2、Glow-TTS、SpeedySpeech)。
    • 扬声器编码器可有效计算扬声器嵌入。
    • 声码器模型(MelGAN、Multiband-MelGAN、GAN-TTS、ParallelWaveGAN、WaveGrad、WaveRNN)
  • 快速高效的模型训练。
  • 终端和 Tensorboard 上的详细训练日志。
  • 支持多扬声器 TTS。
  • 高效、灵活、轻量但功能齐全Trainer API
  • 已发布且可供使用的模型。
  • 用于在dataset_analysis.
  • 使用和测试模型的实用程序。
  • 模块化(但不是太多)代码库可以轻松实现新想法。

模型实现

频谱图模型

端到端模型

注意方法

扬声器编码器

声码器

语音转换

您还可以帮助我们实现更多模型。

安装

🐸TTS 在 Ubuntu 18.04 上测试,Python >= 3.9, < 3.12。

如果您只对使用已发布的 🐸TTS 模型合成语音感兴趣,从 PyPI 安装是最简单的选择。

pip install TTS

如果您计划编码或训练模型,请克隆 🐸TTS 并在本地安装。

git clone https://github.com/coqui-ai/TTS
pip install -e .[all,dev,notebooks]  # Select the relevant extras

如果您使用的是 Ubuntu (Debian),您还可以运行以下命令进行安装。

$ make system-deps  # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
$ make install

如果您使用的是 Windows,👑@GuyPaddock在此编写了安装说明。

Docker 镜像

您还可以尝试 TTS,无需安装 docker 镜像。只需运行以下命令,您无需安装即可运行 TTS。

docker run --rm -it -p 5002:5002 --entrypoint /bin/bash ghcr.io/coqui-ai/tts-cpu
python3 TTS/server/server.py --list_models #To get the list of available models
python3 TTS/server/server.py --model_name tts_models/en/vctk/vits # To start a server

然后,您可以在此处享受 TTS 服务器有关 docker 映像(例如 GPU 支持)的更多详细信息可以在此处 找到

通过 🐸TTS 合成语音

🐍Python API

运行多说话人和多语言模型

import torch
from TTS.api import TTS

# Get device device = "cuda" if torch.cuda.is_available() else "cpu"

# List available 🐸TTS models print(TTS().list_models())

# Init TTS tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)

# Run TTS # ❗ Since this model is multi-lingual voice cloning model, we must set the target speaker_wav and language # Text to speech list of amplitude values as output wav = tts.tts(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en") # Text to speech to a file tts.tts_to_file(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav")

<clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 tooltipped-no-delay d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w" value="import torch from TTS.api import TTS

Get device

device = "cuda" if torch.cuda.is_available() else "cpu"

List available 🐸TTS models

print(TTS().list_models())

Init TTS

tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)

Run TTS

❗ Since this model is multi-lingual voice cloning model, we must set the target speaker_wav and language

Text to speech list of amplitude values as output

wav = tts.tts(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en")

Text to speech to a file

tts.tts_to_file(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav")" tabindex="0" role="button">

运行单扬声器模型

# Init TTS with the target model name
tts = TTS(model_name="tts_models/de/thorsten/tacotron2-DDC", progress_bar=False).to(device)

# 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).to(device) 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")

<clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 tooltipped-no-delay d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w" value="# Init TTS with the target model name tts = TTS(model_name="tts_models/de/thorsten/tacotron2-DDC", progress_bar=False).to(device)

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).to(device) 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")" tabindex="0" role="button">

语音转换示例

将语音转换source_wav为语音target_wav

tts = TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24", progress_bar=False).to("cuda")
tts.voice_conversion_to_file(source_wav="my/source.wav", target_wav="my/target.wav", file_path="output.wav")

语音克隆与语音转换模型的示例。

这样,您就可以使用 🐸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="output.wav"
)

使用Fairseq 模型的约 1100 种语言的文本转语音示例。

对于 Fairseq 模型,请使用以下名称格式:tts_models/<lang-iso_code>/fairseq/vits.您可以在此处找到语言 ISO 代码,并在此处 了解 Fairseq 模型。

# TTS with on the fly voice conversion
api = TTS("tts_models/deu/fairseq/vits")
api.tts_with_vc_to_file(
    "Wie sage ich auf Italienisch, dass ich dich liebe?",
    speaker_wav="target/speaker.wav",
    file_path="output.wav"
)

命令行tts

在命令行上合成语音。

您可以使用经过训练的模型或从提供的列表中选择模型。

如果不指定任何模型,则使用基于 LJSpeech 的英语模型。

单扬声器型号

  • 列出提供的型号:

    $ tts --list_models
    
  • 获取模型信息(tts_models 和 vocoder_models):

    • 按类型/名称查询: model_info_by_name 使用 --list_models 中的名称。

      $ tts --model_info_by_name "<model_type>/<language>/<dataset>/<model_name>"
      

      例如:

      $ tts --model_info_by_name tts_models/tr/common-voice/glow-tts
      $ tts --model_info_by_name vocoder_models/en/ljspeech/hifigan_v2
      
    • 按类型/idx 查询:model_query_idx 使用--list_models 中相应的idx。

      $ tts --model_info_by_idx "<model_type>/<model_query_idx>"
      

      例如:

      $ tts --model_info_by_idx tts_models/3
      
    • 按全名查询型号信息:

      $ tts --model_info_by_name "<model_type>/<language>/<dataset>/<model_name>"
      
  • 使用默认模型运行 TTS:

    $ tts --text "Text for TTS" --out_path output/path/speech.wav
    
  • 运行 TTS 并输出生成的 TTS wav 文件数据:

    $ tts --text "Text for TTS" --pipe_out --out_path output/path/speech.wav | aplay
    
  • 使用默认声码器模型运行 TTS 模型:

    $ tts --text "Text for TTS" --model_name "<model_type>/<language>/<dataset>/<model_name>" --out_path output/path/speech.wav
    

    例如:

    $ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --out_path output/path/speech.wav
    
  • 使用列表中的特定 TTS 和声码器模型运行:

    $ tts --text "Text for TTS" --model_name "<model_type>/<language>/<dataset>/<model_name>" --vocoder_name "<model_type>/<language>/<dataset>/<model_name>" --out_path output/path/speech.wav
    

    例如:

    $ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --vocoder_name "vocoder_models/en/ljspeech/univnet" --out_path output/path/speech.wav
    
  • 运行您自己的 TTS 模型(使用 Griffin-Lim Vocoder):

    $ tts --text "Text for TTS" --model_path path/to/model.pth --config_path path/to/config.json --out_path output/path/speech.wav
    
  • 运行您自己的 TTS 和声码器模型:

    $ tts --text "Text for TTS" --model_path path/to/model.pth --config_path path/to/config.json --out_path output/path/speech.wav
        --vocoder_path path/to/vocoder.pth --vocoder_config_path path/to/vocoder_config.json
    

多扬声器型号

  • 列出可用的发言人并在其中选择一个 <speaker_id>:

    $ tts --model_name "<language>/<dataset>/<model_name>"  --list_speaker_idxs
    
  • 使用目标说话人 ID 运行多说话人 TTS 模型:

    $ tts --text "Text for TTS." --out_path output/path/speech.wav --model_name "<language>/<dataset>/<model_name>"  --speaker_idx <speaker_id>
    
  • 运行您自己的多扬声器 TTS 模型:

    $ 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>
    

语音转换模型

$ tts --out_path output/path/speech.wav --model_name "<language>/<dataset>/<model_name>" --source_wav <path/to/speaker/wav> --target_wav <path/to/reference/wav>

目录结构

|- 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)

tts-cn's People

Contributors

erogol avatar edresson avatar weberjulian avatar lexkoro avatar twerkmeister avatar reuben avatar thorstenmueller avatar kirianguiller avatar gerazov avatar thllwg avatar eginhard avatar mic92 avatar akx avatar ayushexel avatar kaiidams avatar nmstoker avatar sanjaesc avatar p0p4k avatar rishikksh20 avatar synesthesiam avatar adonispujols avatar aya-aljafari avatar freds0 avatar agrinh avatar omahs avatar mittimithai avatar manmay-nakhashi avatar bgerazov avatar gorkemgoknar avatar a-froghyar 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.