[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mozilla--TTS":3,"tool-mozilla--TTS":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":10,"env_os":100,"env_gpu":101,"env_ram":102,"env_deps":103,"category_tags":117,"github_topics":119,"view_count":136,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":137,"updated_at":138,"faqs":139,"releases":177},876,"mozilla\u002FTTS","TTS",":robot: :speech_balloon: Deep learning for Text to Speech  (Discussion forum: https:\u002F\u002Fdiscourse.mozilla.org\u002Fc\u002Ftts)","TTS 是一个基于深度学习的开源文本转语音（Text-to-Speech）工具库，由 Mozilla 团队维护。它能够将文字内容转化为自然流畅的语音，致力于在训练便捷性、合成速度与语音质量之间取得最佳平衡。\n\nTTS 主要解决了传统语音合成技术中声音生硬、不自然，以及多语言支持不足的问题。它内置了多种先进的深度学习模型，包括 Tacotron2、Glow-TTS 等文本转频谱模型，以及 MelGAN、WaveRNN 等声码器，能够生成高质量、富有表现力的语音。目前，TTS 已提供 20 多种语言的预训练模型，并包含用于评估数据集质量的工具，方便用户快速上手和应用。\n\n这个工具非常适合人工智能领域的研究人员、开发者以及产品团队使用。研究人员可以利用其模块化设计进行语音合成领域的实验与模型探索；开发者可以轻松集成其预训练模型，为应用程序、智能设备或无障碍服务添加语音功能；对于有一定技术背景的普通用户，也可以通过其提供的教程和演示，体验定制化语音合成的乐趣。\n\nTTS 的技术亮点在于其模型集的先进性与完整性，它集成了从文本前端处理、声学模型到神经声码器的完整流水线。同时，项目社区活跃，提供了","TTS 是一个基于深度学习的开源文本转语音（Text-to-Speech）工具库，由 Mozilla 团队维护。它能够将文字内容转化为自然流畅的语音，致力于在训练便捷性、合成速度与语音质量之间取得最佳平衡。\n\nTTS 主要解决了传统语音合成技术中声音生硬、不自然，以及多语言支持不足的问题。它内置了多种先进的深度学习模型，包括 Tacotron2、Glow-TTS 等文本转频谱模型，以及 MelGAN、WaveRNN 等声码器，能够生成高质量、富有表现力的语音。目前，TTS 已提供 20 多种语言的预训练模型，并包含用于评估数据集质量的工具，方便用户快速上手和应用。\n\n这个工具非常适合人工智能领域的研究人员、开发者以及产品团队使用。研究人员可以利用其模块化设计进行语音合成领域的实验与模型探索；开发者可以轻松集成其预训练模型，为应用程序、智能设备或无障碍服务添加语音功能；对于有一定技术背景的普通用户，也可以通过其提供的教程和演示，体验定制化语音合成的乐趣。\n\nTTS 的技术亮点在于其模型集的先进性与完整性，它集成了从文本前端处理、声学模型到神经声码器的完整流水线。同时，项目社区活跃，提供了详细的文档、训练案例和性能评测（如平均意见得分），方便用户比较和选择最适合的模型。无论是用于学术研究、产品开发还是个人项目，TTS 都是一个强大而可靠的语音合成解决方案。","\u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F1402048\u002F104139991-3fd15e00-53af-11eb-8640-3a78a64641dd.png\" data-canonical-src=\"![TTS banner](https:\u002F\u002Fuser-images.githubusercontent.com\u002F1402048\u002F104139991-3fd15e00-53af-11eb-8640-3a78a64641dd.png =250x250)\n\" width=\"256\" height=\"256\" align=\"right\" \u002F>\n\n# TTS: Text-to-Speech for all.\n\nTTS is a library for advanced Text-to-Speech generation. It's built on the latest research, was designed to achieve the best trade-off among ease-of-training, speed and quality.\nTTS comes with [pretrained models](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FReleased-Models), tools for measuring dataset quality and already used in **20+ languages** for products and research projects.\n\n[![CircleCI](\u003Chttps:\u002F\u002Fcircleci.com\u002Fgh\u002Fmozilla\u002FTTS\u002Ftree\u002Fdev.svg?style=svg>)]()\n[![License](\u003Chttps:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MPL%202.0-brightgreen.svg>)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMPL-2.0)\n[![PyPI version](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FTTS.svg)](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FTTS)\n\n:loudspeaker: [English Voice Samples](https:\u002F\u002Ferogol.github.io\u002Fddc-samples\u002F) and [SoundCloud playlist](https:\u002F\u002Fsoundcloud.com\u002Fuser-565970875\u002Fpocket-article-wavernn-and-tacotron2)\n\n:man_cook:  [TTS training recipes](https:\u002F\u002Fgithub.com\u002Ferogol\u002FTTS_recipes)\n\n:page_facing_up: [Text-to-Speech paper collection](https:\u002F\u002Fgithub.com\u002Ferogol\u002FTTS-papers)\n\n## 💬 Where to ask questions\nPlease use our dedicated channels for questions and discussion. Help is much more valuable if it's shared publicly, so that more people can benefit from it.\n\n| Type                            | Platforms                               |\n| ------------------------------- | --------------------------------------- |\n| 🚨 **Bug Reports**              | [GitHub Issue Tracker]                  |\n| ❔ **FAQ**                       | [TTS\u002FWiki](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FFAQ)                              |\n| 🎁 **Feature Requests & Ideas** | [GitHub Issue Tracker]                  |\n| 👩‍💻 **Usage Questions**          | [Discourse Forum]                       |\n| 🗯 **General Discussion**        | [Discourse Forum] and [Matrix Channel]  |\n\n[github issue tracker]: https:\u002F\u002Fgithub.com\u002Fmozilla\u002Ftts\u002Fissues\n[discourse forum]: https:\u002F\u002Fdiscourse.mozilla.org\u002Fc\u002Ftts\u002F\n[matrix channel]: https:\u002F\u002Fmatrix.to\u002F#\u002F!KTePhNahjgiVumkqca:matrix.org?via=matrix.org\n[Tutorials and Examples]: https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FTTS-Notebooks-and-Tutorials\n\n\n## 🔗 Links and Resources\n| Type                            | Links                               |\n| ------------------------------- | --------------------------------------- |\n| 💾 **Installation** | [TTS\u002FREADME.md](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002Fdev#install-tts)|\n| 👩🏾‍🏫 **Tutorials and Examples**  | [TTS\u002FWiki](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FTTS-Notebooks-and-Tutorials) |\n| 🚀 **Released Models**         | [TTS\u002FWiki](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FReleased-Models)|\n| 💻 **Docker Image**            | [Repository by @synesthesiam](https:\u002F\u002Fgithub.com\u002Fsynesthesiam\u002Fdocker-mozillatts)|\n| 🖥️ **Demo Server**             | [TTS\u002Fserver](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002Fmaster\u002FTTS\u002Fserver)|\n| 🤖 **Running TTS on Terminal** | [TTS\u002FREADME.md](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS#example-synthesizing-speech-on-terminal-using-the-released-models)|\n| ✨ **How to contribute**       |[TTS\u002FREADME.md](#contribution-guidelines)|\n\n## 🥇 TTS Performance\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fdiscourse-prod-uploads-81679984178418.s3.dualstack.us-west-2.amazonaws.com\u002Foptimized\u002F3X\u002F6\u002F4\u002F6428f980e9ec751c248e591460895f7881aec0c6_2_1035x591.png\" width=\"800\" \u002F>\u003C\u002Fp>\n\n\"Mozilla*\" and \"Judy*\" are our models.\n[Details...](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FMean-Opinion-Score-Results)\n\n## Features\n- High performance Deep Learning models for Text2Speech tasks.\n    - Text2Spec models (Tacotron, Tacotron2, Glow-TTS, SpeedySpeech).\n    - Speaker Encoder to compute speaker embeddings efficiently.\n    - Vocoder models (MelGAN, Multiband-MelGAN, GAN-TTS, ParallelWaveGAN, WaveGrad, WaveRNN)\n- Fast and efficient model training.\n- Detailed training logs on console and Tensorboard.\n- Support for multi-speaker TTS.\n- Efficient Multi-GPUs training.\n- Ability to convert PyTorch models to Tensorflow 2.0 and TFLite for inference.\n- Released models in PyTorch, Tensorflow and TFLite.\n- Tools to curate Text2Speech datasets under```dataset_analysis```.\n- Demo server for model testing.\n- Notebooks for extensive model benchmarking.\n- Modular (but not too much) code base enabling easy testing for new ideas.\n\n## Implemented Models\n### Text-to-Spectrogram\n- Tacotron: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.10135)\n- Tacotron2: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1712.05884)\n- Glow-TTS: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.11129)\n- Speedy-Speech: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2008.03802)\n\n### Attention Methods\n- Guided Attention: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.08969)\n- Forward Backward Decoding: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.09006)\n- Graves Attention: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.09006)\n- Double Decoder Consistency: [blog](https:\u002F\u002Ferogol.com\u002Fsolving-attention-problems-of-tts-models-with-double-decoder-consistency\u002F)\n\n### Speaker Encoder\n- GE2E: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.10467)\n- Angular Loss: [paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2003.11982.pdf)\n\n### Vocoders\n- MelGAN: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06711)\n- MultiBandMelGAN: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.05106)\n- ParallelWaveGAN: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.11480)\n- GAN-TTS discriminators: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1909.11646)\n- WaveRNN: [origin](https:\u002F\u002Fgithub.com\u002Ffatchord\u002FWaveRNN\u002F)\n- WaveGrad: [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2009.00713)\n\nYou can also help us implement more models. Some TTS related work can be found [here](https:\u002F\u002Fgithub.com\u002Ferogol\u002FTTS-papers).\n\n## Install TTS\nTTS supports **python >= 3.6, \u003C3.9**.\n\nIf you are only interested in [synthesizing speech](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002Fdev#example-synthesizing-speech-on-terminal-using-the-released-models) with the released TTS models, installing from PyPI is the easiest option.\n\n```bash\npip install TTS\n```\n\nIf you plan to code or train models, clone TTS and install it locally.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\npip install -e .\n```\n\n## Directory Structure\n```\n|- notebooks\u002F       (Jupyter Notebooks for model evaluation, parameter selection and data analysis.)\n|- utils\u002F           (common utilities.)\n|- TTS\n    |- bin\u002F             (folder for all the executables.)\n      |- train*.py                  (train your target model.)\n      |- distribute.py              (train your TTS model using Multiple GPUs.)\n      |- compute_statistics.py      (compute dataset statistics for normalization.)\n      |- convert*.py                (convert target torch model to TF.)\n    |- tts\u002F             (text to speech models)\n        |- layers\u002F          (model layer definitions)\n        |- models\u002F          (model definitions)\n        |- tf\u002F              (Tensorflow 2 utilities and model implementations)\n        |- utils\u002F           (model specific utilities.)\n    |- speaker_encoder\u002F (Speaker Encoder models.)\n        |- (same)\n    |- vocoder\u002F         (Vocoder models.)\n        |- (same)\n```\n\n## Sample Model Output\nBelow you see Tacotron model state after 16K iterations with batch-size 32 with LJSpeech dataset.\n\n> \"Recent research at Harvard has shown meditating for as little as 8 weeks can actually increase the grey matter in the parts of the brain responsible for emotional regulation and learning.\"\n\nAudio examples: [soundcloud](https:\u002F\u002Fsoundcloud.com\u002Fuser-565970875\u002Fpocket-article-wavernn-and-tacotron2)\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmozilla_TTS_readme_2bc712c47745.png\" alt=\"example_output\" width=\"400\"\u002F>\n\n## Datasets and Data-Loading\nTTS provides a generic dataloader easy to use for your custom dataset.\nYou just need to write a simple function to format the dataset. Check ```datasets\u002Fpreprocess.py``` to see some examples.\nAfter that, you need to set ```dataset``` fields in ```config.json```.\n\nSome of the public datasets that we successfully applied TTS:\n\n- [LJ Speech](https:\u002F\u002Fkeithito.com\u002FLJ-Speech-Dataset\u002F)\n- [Nancy](http:\u002F\u002Fwww.cstr.ed.ac.uk\u002Fprojects\u002Fblizzard\u002F2011\u002Flessac_blizzard2011\u002F)\n- [TWEB](https:\u002F\u002Fwww.kaggle.com\u002Fbryanpark\u002Fthe-world-english-bible-speech-dataset)\n- [M-AI-Labs](http:\u002F\u002Fwww.caito.de\u002F2019\u002F01\u002Fthe-m-ailabs-speech-dataset\u002F)\n- [LibriTTS](https:\u002F\u002Fopenslr.org\u002F60\u002F)\n- [Spanish](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Sm_zyBo67XHkiFhcRSQ4YaHPYM0slO_e\u002Fview?usp=sharing) - thx! @carlfm01\n\n## Example: Synthesizing Speech on Terminal Using the Released Models.\n\nAfter the installation, TTS provides a CLI interface for synthesizing speech using pre-trained models. You can either use your own model or the release models under the TTS project.\n\nListing released TTS models.\n```bash\ntts --list_models\n```\n\nRun a tts and a vocoder model from the released model list. (Simply copy and paste the full model names from the list as arguments for the command below.)\n```bash\ntts --text \"Text for TTS\" \\\n    --model_name \"\u003Ctype>\u002F\u003Clanguage>\u002F\u003Cdataset>\u002F\u003Cmodel_name>\" \\\n    --vocoder_name \"\u003Ctype>\u002F\u003Clanguage>\u002F\u003Cdataset>\u002F\u003Cmodel_name>\" \\\n    --out_path folder\u002Fto\u002Fsave\u002Foutput\u002F\n```\n\nRun your own TTS model (Using Griffin-Lim Vocoder)\n```bash\ntts --text \"Text for TTS\" \\\n    --model_path path\u002Fto\u002Fmodel.pth.tar \\\n    --config_path path\u002Fto\u002Fconfig.json \\\n    --out_path output\u002Fpath\u002Fspeech.wav\n```\n\nRun your own TTS and Vocoder models\n```bash\ntts --text \"Text for TTS\" \\\n    --model_path path\u002Fto\u002Fconfig.json \\\n    --config_path path\u002Fto\u002Fmodel.pth.tar \\\n    --out_path output\u002Fpath\u002Fspeech.wav \\\n    --vocoder_path path\u002Fto\u002Fvocoder.pth.tar \\\n    --vocoder_config_path path\u002Fto\u002Fvocoder_config.json\n```\n\n**Note:** You can use ```.\u002FTTS\u002Fbin\u002Fsynthesize.py``` if you prefer running ```tts``` from the TTS project folder.\n\n## Example: Training and Fine-tuning LJ-Speech Dataset\nHere you can find a [CoLab](https:\u002F\u002Fgist.github.com\u002Ferogol\u002F97516ad65b44dbddb8cd694953187c5b) notebook for a hands-on example, training LJSpeech. Or you can manually follow the guideline below.\n\nTo start with, split ```metadata.csv``` into train and validation subsets respectively ```metadata_train.csv``` and ```metadata_val.csv```. Note that for text-to-speech, validation performance might be misleading since the loss value does not directly measure the voice quality to the human ear and it also does not measure the attention module performance. Therefore, running the model with new sentences and listening to the results is the best way to go.\n\n```\nshuf metadata.csv > metadata_shuf.csv\nhead -n 12000 metadata_shuf.csv > metadata_train.csv\ntail -n 1100 metadata_shuf.csv > metadata_val.csv\n```\n\nTo train a new model, you need to define your own ```config.json``` to define model details, trainin configuration and more (check the examples). Then call the corressponding train script.\n\nFor instance, in order to train a tacotron or tacotron2 model on LJSpeech dataset, follow these steps.\n\n```bash\npython TTS\u002Fbin\u002Ftrain_tacotron.py --config_path TTS\u002Ftts\u002Fconfigs\u002Fconfig.json\n```\n\nTo fine-tune a model, use ```--restore_path```.\n\n```bash\npython TTS\u002Fbin\u002Ftrain_tacotron.py --config_path TTS\u002Ftts\u002Fconfigs\u002Fconfig.json --restore_path \u002Fpath\u002Fto\u002Fyour\u002Fmodel.pth.tar\n```\n\nTo continue an old training run, use ```--continue_path```.\n\n```bash\npython TTS\u002Fbin\u002Ftrain_tacotron.py --continue_path \u002Fpath\u002Fto\u002Fyour\u002Frun_folder\u002F\n```\n\nFor multi-GPU training, call ```distribute.py```. It runs any provided train script in multi-GPU setting.\n\n```bash\nCUDA_VISIBLE_DEVICES=\"0,1,4\" python TTS\u002Fbin\u002Fdistribute.py --script train_tacotron.py --config_path TTS\u002Ftts\u002Fconfigs\u002Fconfig.json\n```\n\nEach run creates a new output folder accomodating used ```config.json```, model checkpoints and tensorboard logs.\n\nIn case of any error or intercepted execution, if there is no checkpoint yet under the output folder, the whole folder is going to be removed.\n\nYou can also enjoy Tensorboard,  if you point Tensorboard argument```--logdir``` to the experiment folder.\n\n## Contribution Guidelines\nThis repository is governed by Mozilla's code of conduct and etiquette guidelines. For more details, please read the [Mozilla Community Participation Guidelines.](https:\u002F\u002Fwww.mozilla.org\u002Fabout\u002Fgovernance\u002Fpolicies\u002Fparticipation\u002F)\n\n1. Create a new branch.\n2. Implement your changes.\n3. (if applicable) Add [Google Style](https:\u002F\u002Fgoogle.github.io\u002Fstyleguide\u002Fpyguide.html#381-docstrings) docstrings.\n4. (if applicable) Implement a test case under ```tests``` folder.\n5. (Optional but Prefered) Run tests. \n```bash\n.\u002Frun_tests.sh\n```\n6. Run the linter.\n```bash\npip install pylint cardboardlint\ncardboardlinter --refspec master\n```\n7. Send a PR to ```dev``` branch, explain what the change is about.\n8. Let us discuss until we make it perfect :). \n9. We merge it to the ```dev``` branch once things look good. \n\nFeel free to ping us at any step you need help using our communication channels.\n\n## Collaborative Experimentation Guide\nIf you like to use TTS to try a new idea and like to share your experiments with the community, we urge you to use the following guideline for a better collaboration.\n(If you have an idea for better collaboration, let us know)\n- Create a new branch.\n- Open an issue pointing your branch.\n- Explain your idea and experiment.\n- Share your results regularly. (Tensorboard log files, audio results, visuals etc.)\n\n## Major TODOs\n- [x] Implement the model.\n- [x] Generate human-like speech on LJSpeech dataset.\n- [x] Generate human-like speech on a different dataset (Nancy) (TWEB).\n- [x] Train TTS with r=1 successfully.\n- [x] Enable process based distributed training. Similar to (https:\u002F\u002Fgithub.com\u002Ffastai\u002Fimagenet-fast\u002F).\n- [x] Adapting Neural Vocoder. TTS works with WaveRNN and ParallelWaveGAN (https:\u002F\u002Fgithub.com\u002Ferogol\u002FWaveRNN and https:\u002F\u002Fgithub.com\u002Ferogol\u002FParallelWaveGAN)\n- [x] Multi-speaker embedding.\n- [x] Model optimization (model export, model pruning etc.)\n\n### Acknowledgement\n- https:\u002F\u002Fgithub.com\u002Fkeithito\u002Ftacotron (Dataset pre-processing)\n- https:\u002F\u002Fgithub.com\u002Fr9y9\u002Ftacotron_pytorch (Initial Tacotron architecture)\n- https:\u002F\u002Fgithub.com\u002Fkan-bayashi\u002FParallelWaveGAN (vocoder library)\n- https:\u002F\u002Fgithub.com\u002Fjaywalnut310\u002Fglow-tts (Original Glow-TTS implementation)\n- https:\u002F\u002Fgithub.com\u002Ffatchord\u002FWaveRNN\u002F (Original WaveRNN implementation)\n","\u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F1402048\u002F104139991-3fd15e00-53af-11eb-8640-3a78a64641dd.png\" data-canonical-src=\"![TTS banner](https:\u002F\u002Fuser-images.githubusercontent.com\u002F1402048\u002F104139991-3fd15e00-53af-11eb-8640-3a78a64641dd.png =250x250)\n\" width=\"256\" height=\"256\" align=\"right\" \u002F>\n\n# TTS: 面向所有人的文本转语音（Text-to-Speech）\n\nTTS 是一个用于高级文本转语音生成的库。它基于最新研究成果构建，旨在实现训练便捷性、速度和音质之间的最佳平衡。TTS 提供[预训练模型](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FReleased-Models)、用于评估数据集质量的工具，并已在 **20 多种语言**的产品和研究项目中得到应用。\n\n[![CircleCI](\u003Chttps:\u002F\u002Fcircleci.com\u002Fgh\u002Fmozilla\u002FTTS\u002Ftree\u002Fdev.svg?style=svg>)]()\n[![License](\u003Chttps:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MPL%202.0-brightgreen.svg>)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMPL-2.0)\n[![PyPI version](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FTTS.svg)](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002FTTS)\n\n:loudspeaker: [英语语音样本](https:\u002F\u002Ferogol.github.io\u002Fddc-samples\u002F) 和 [SoundCloud 播放列表](https:\u002F\u002Fsoundcloud.com\u002Fuser-565970875\u002Fpocket-article-wavernn-and-tacotron2)\n\n:man_cook:  [TTS 训练配方](https:\u002F\u002Fgithub.com\u002Ferogol\u002FTTS_recipes)\n\n:page_facing_up: [文本转语音论文合集](https:\u002F\u002Fgithub.com\u002Ferogol\u002FTTS-papers)\n\n## 💬 问题咨询渠道\n请使用我们的专用渠道进行提问和讨论。如果帮助能够公开分享，让更多人受益，那么它将更有价值。\n\n| 类型                            | 平台                               |\n| ------------------------------- | --------------------------------------- |\n| 🚨 **Bug 报告**              | [GitHub Issue Tracker]                  |\n| ❔ **常见问题**                       | [TTS\u002FWiki](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FFAQ)                              |\n| 🎁 **功能请求与想法** | [GitHub Issue Tracker]                  |\n| 👩‍💻 **使用问题**          | [Discourse Forum]                       |\n| 🗯 **一般讨论**        | [Discourse Forum] 和 [Matrix Channel]  |\n\n[github issue tracker]: https:\u002F\u002Fgithub.com\u002Fmozilla\u002Ftts\u002Fissues\n[discourse forum]: https:\u002F\u002Fdiscourse.mozilla.org\u002Fc\u002Ftts\u002F\n[matrix channel]: https:\u002F\u002Fmatrix.to\u002F#\u002F!KTePhNahjgiVumkqca:matrix.org?via=matrix.org\n[Tutorials and Examples]: https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FTTS-Notebooks-and-Tutorials\n\n\n## 🔗 链接与资源\n| 类型                            | 链接                               |\n| ------------------------------- | --------------------------------------- |\n| 💾 **安装** | [TTS\u002FREADME.md](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002Fdev#install-tts)|\n| 👩🏾‍🏫 **教程与示例**  | [TTS\u002FWiki](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FTTS-Notebooks-and-Tutorials) |\n| 🚀 **已发布模型**         | [TTS\u002FWiki](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FReleased-Models)|\n| 💻 **Docker 镜像**            | [Repository by @synesthesiam](https:\u002F\u002Fgithub.com\u002Fsynesthesiam\u002Fdocker-mozillatts)|\n| 🖥️ **演示服务器**             | [TTS\u002Fserver](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002Fmaster\u002FTTS\u002Fserver)|\n| 🤖 **在终端运行 TTS** | [TTS\u002FREADME.md](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS#example-synthesizing-speech-on-terminal-using-the-released-models)|\n| ✨ **如何贡献**       |[TTS\u002FREADME.md](#contribution-guidelines)|\n\n## 🥇 TTS 性能表现\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fdiscourse-prod-uploads-81679984178418.s3.dualstack.us-west-2.amazonaws.com\u002Foptimized\u002F3X\u002F6\u002F4\u002F6428f980e9ec751c248e591460895f7881aec0c6_2_1035x591.png\" width=\"800\" \u002F>\u003C\u002Fp>\n\n\"Mozilla*\" 和 \"Judy*\" 是我们的模型。\n[详情...](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FMean-Opinion-Score-Results)\n\n## 功能特性\n- 用于文本转语音（Text2Speech）任务的高性能深度学习模型。\n    - Text2Spec 模型（Tacotron、Tacotron2、Glow-TTS、SpeedySpeech）。\n    - 用于高效计算说话人嵌入（speaker embeddings）的说话人编码器（Speaker Encoder）。\n    - 声码器（Vocoder）模型（MelGAN、Multiband-MelGAN、GAN-TTS、ParallelWaveGAN、WaveGrad、WaveRNN）\n- 快速高效的模型训练。\n- 在控制台和 Tensorboard 上提供详细的训练日志。\n- 支持多说话人文本转语音（multi-speaker TTS）。\n- 高效的多 GPU 训练。\n- 能够将 PyTorch 模型转换为 Tensorflow 2.0 和 TFLite 以进行推理。\n- 发布 PyTorch、Tensorflow 和 TFLite 格式的模型。\n- 在 ```dataset_analysis``` 下提供整理文本转语音数据集的工具。\n- 用于模型测试的演示服务器。\n- 用于广泛模型基准测试的 Notebook。\n- 模块化（但不过度）的代码库，便于测试新想法。\n\n## 已实现模型\n### 文本转频谱图（Text-to-Spectrogram）\n- Tacotron：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.10135)\n- Tacotron2：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1712.05884)\n- Glow-TTS：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.11129)\n- Speedy-Speech：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2008.03802)\n\n### 注意力机制（Attention Methods）\n- 引导注意力（Guided Attention）：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.08969)\n- 前向后向解码（Forward Backward Decoding）：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.09006)\n- Graves 注意力（Graves Attention）：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.09006)\n- 双解码器一致性（Double Decoder Consistency）：[博客](https:\u002F\u002Ferogol.com\u002Fsolving-attention-problems-of-tts-models-with-double-decoder-consistency\u002F)\n\n### 说话人编码器（Speaker Encoder）\n- GE2E：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1710.10467)\n- 角损失（Angular Loss）：[论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2003.11982.pdf)\n\n### 声码器（Vocoders）\n- MelGAN：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.06711)\n- MultiBandMelGAN：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.05106)\n- ParallelWaveGAN：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.11480)\n- GAN-TTS 判别器：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1909.11646)\n- WaveRNN：[来源](https:\u002F\u002Fgithub.com\u002Ffatchord\u002FWaveRNN\u002F)\n- WaveGrad：[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2009.00713)\n\n您也可以帮助我们实现更多模型。一些与 TTS 相关的工作可以在[这里](https:\u002F\u002Fgithub.com\u002Ferogol\u002FTTS-papers)找到。\n\n## 安装 TTS\nTTS 支持 **python >= 3.6, \u003C3.9**。\n\n如果您只想使用已发布的 TTS 模型[合成语音](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002Fdev#example-synthesizing-speech-on-terminal-using-the-released-models)，从 PyPI 安装是最简单的选择。\n\n```bash\npip install TTS\n```\n\n如果您计划编写代码或训练模型，请克隆 TTS 并在本地安装。\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\npip install -e .\n```\n\n## 目录结构\n```\n|- notebooks\u002F       (用于模型评估、参数选择和数据分析的 Jupyter Notebooks)\n|- utils\u002F           (通用工具函数)\n|- TTS\n    |- bin\u002F             (所有可执行文件的文件夹)\n      |- train*.py                  (训练目标模型)\n      |- distribute.py              (使用多 GPU 训练 TTS 模型)\n      |- compute_statistics.py      (计算数据集统计信息用于归一化)\n      |- convert*.py                (将目标 torch 模型转换为 TF)\n    |- tts\u002F             (文本转语音模型)\n        |- layers\u002F          (模型层定义)\n        |- models\u002F          (模型定义)\n        |- tf\u002F              (Tensorflow 2 工具和模型实现)\n        |- utils\u002F           (模型专用工具函数)\n    |- speaker_encoder\u002F (说话人编码器 Speaker Encoder 模型)\n        |- (同上)\n    |- vocoder\u002F         (声码器 Vocoder 模型)\n        |- (同上)\n```\n\n## 模型输出示例\n下图展示了使用 LJSpeech 数据集、批量大小 batch-size 为 32 训练 16K 迭代后的 Tacotron 模型状态。\n\n> \"Recent research at Harvard has shown meditating for as little as 8 weeks can actually increase the grey matter in the parts of the brain responsible for emotional regulation and learning.\"\n\n音频示例：[soundcloud](https:\u002F\u002Fsoundcloud.com\u002Fuser-565970875\u002Fpocket-article-wavernn-and-tacotron2)\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmozilla_TTS_readme_2bc712c47745.png\" alt=\"example_output\" width=\"400\"\u002F>\n\n## 数据集和数据加载\nTTS 提供了一个通用的数据加载器 dataloader，可轻松用于您的自定义数据集。\n您只需编写一个简单的函数来格式化数据集。查看 ```datasets\u002Fpreprocess.py``` 了解一些示例。\n之后，您需要在 ```config.json``` 中设置 ```dataset``` 字段。\n\n我们成功应用 TTS 的一些公开数据集：\n\n- [LJ Speech](https:\u002F\u002Fkeithito.com\u002FLJ-Speech-Dataset\u002F)\n- [Nancy](http:\u002F\u002Fwww.cstr.ed.ac.uk\u002Fprojects\u002Fblizzard\u002F2011\u002Flessac_blizzard2011\u002F)\n- [TWEB](https:\u002F\u002Fwww.kaggle.com\u002Fbryanpark\u002Fthe-world-english-bible-speech-dataset)\n- [M-AI-Labs](http:\u002F\u002Fwww.caito.de\u002F2019\u002F01\u002Fthe-m-ailabs-speech-dataset\u002F)\n- [LibriTTS](https:\u002F\u002Fopenslr.org\u002F60\u002F)\n- [Spanish](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Sm_zyBo67XHkiFhcRSQ4YaHPYM0slO_e\u002Fview?usp=sharing) - 感谢 @carlfm01\n\n## 示例：在终端使用发布模型合成语音\n\n安装完成后，TTS 提供了一个命令行界面 CLI，用于使用预训练模型合成语音。您可以使用自己的模型或 TTS 项目下的发布模型。\n\n列出已发布的 TTS 模型：\n```bash\ntts --list_models\n```\n\n从发布模型列表中运行 TTS 和声码器 vocoder 模型。（只需从列表中复制完整的模型名称作为以下命令的参数）\n```bash\ntts --text \"Text for TTS\" \\\n    --model_name \"\u003Ctype>\u002F\u003Clanguage>\u002F\u003Cdataset>\u002F\u003Cmodel_name>\" \\\n    --vocoder_name \"\u003Ctype>\u002F\u003Clanguage>\u002F\u003Cdataset>\u002F\u003Cmodel_name>\" \\\n    --out_path folder\u002Fto\u002Fsave\u002Foutput\u002F\n```\n\n运行您自己的 TTS 模型（使用 Griffin-Lim 声码器）\n```bash\ntts --text \"Text for TTS\" \\\n    --model_path path\u002Fto\u002Fmodel.pth.tar \\\n    --config_path path\u002Fto\u002Fconfig.json \\\n    --out_path output\u002Fpath\u002Fspeech.wav\n```\n\n运行您自己的 TTS 和声码器模型\n```bash\ntts --text \"Text for TTS\" \\\n    --model_path path\u002Fto\u002Fconfig.json \\\n    --config_path path\u002Fto\u002Fmodel.pth.tar \\\n    --out_path output\u002Fpath\u002Fspeech.wav \\\n    --vocoder_path path\u002Fto\u002Fvocoder.pth.tar \\\n    --vocoder_config_path path\u002Fto\u002Fvocoder_config.json\n```\n\n**注意：** 如果您更喜欢从 TTS 项目文件夹运行 ```tts```，可以使用 ```.\u002FTTS\u002Fbin\u002Fsynthesize.py```。\n\n## 示例：训练和微调 LJ-Speech 数据集\n您可以在这里找到一个用于实际训练 LJSpeech 的 [CoLab](https:\u002F\u002Fgist.github.com\u002Ferogol\u002F97516ad65b44dbddb8cd694953187c5b) 笔记本。或者您可以手动按照以下指南操作。\n\n首先，将 ```metadata.csv``` 分割为训练集和验证集，分别命名为 ```metadata_train.csv``` 和 ```metadata_val.csv```。请注意，对于文本转语音任务，验证性能可能会产生误导，因为损失值 loss 并不能直接衡量人耳感知的语音质量，也无法衡量注意力模块 attention module 的性能。因此，使用新句子运行模型并聆听结果是最佳方法。\n\n```\nshuf metadata.csv > metadata_shuf.csv\nhead -n 12000 metadata_shuf.csv > metadata_train.csv\ntail -n 1100 metadata_shuf.csv > metadata_val.csv\n```\n\n要训练新模型，您需要定义自己的 ```config.json``` 来定义模型细节、训练配置等（查看示例）。然后调用相应的训练脚本。\n\n例如，要在 LJSpeech 数据集上训练 tacotron 或 tacotron2 模型，请按照以下步骤操作：\n\n```bash\npython TTS\u002Fbin\u002Ftrain_tacotron.py --config_path TTS\u002Ftts\u002Fconfigs\u002Fconfig.json\n```\n\n要微调模型，使用 ```--restore_path```。\n\n```bash\npython TTS\u002Fbin\u002Ftrain_tacotron.py --config_path TTS\u002Ftts\u002Fconfigs\u002Fconfig.json --restore_path \u002Fpath\u002Fto\u002Fyour\u002Fmodel.pth.tar\n```\n\n要继续之前的训练运行，使用 ```--continue_path```。\n\n```bash\npython TTS\u002Fbin\u002Ftrain_tacotron.py --continue_path \u002Fpath\u002Fto\u002Fyour\u002Frun_folder\u002F\n```\n\n对于多 GPU 训练，调用 ```distribute.py```。它会在多 GPU 设置下运行任何提供的训练脚本。\n\n```bash\nCUDA_VISIBLE_DEVICES=\"0,1,4\" python TTS\u002Fbin\u002Fdistribute.py --script train_tacotron.py --config_path TTS\u002Ftts\u002Fconfigs\u002Fconfig.json\n```\n\n每次运行都会创建一个新的输出文件夹，包含使用的 ```config.json```、模型检查点 checkpoint 和 tensorboard 日志。\n\n如果出现任何错误或执行被中断，如果输出文件夹下还没有检查点，整个文件夹将被删除。\n\n您也可以使用 Tensorboard，只需将 Tensorboard 参数 ```--logdir``` 指向实验文件夹即可。\n\n## 贡献指南\n本仓库受 Mozilla 行为准则和礼仪指南的约束。更多详情，请阅读 [Mozilla 社区参与指南](https:\u002F\u002Fwww.mozilla.org\u002Fabout\u002Fgovernance\u002Fpolicies\u002Fparticipation\u002F)。\n\n1. 创建一个新分支。\n2. 实现您的更改。\n3. （如适用）添加 [Google 风格](https:\u002F\u002Fgoogle.github.io\u002Fstyleguide\u002Fpyguide.html#381-docstrings) 文档字符串 docstrings。\n4. （如适用）在 ```tests``` 文件夹下实现测试用例。\n5. （可选但推荐）运行测试。\n```bash\n.\u002Frun_tests.sh\n```\n6. 运行代码检查工具 linter。\n```bash\npip install pylint cardboardlint\ncardboardlinter --refspec master\n```\n7. 向 ```dev``` 分支发送 PR，解释更改内容。\n8. 让我们讨论直到完美 :)。\n9. 一切看起来不错后，我们将其合并到 ```dev``` 分支。\n\n在任何需要帮助步骤，请随时通过我们的沟通渠道联系我们。\n\n## 协作实验指南\n如果你喜欢使用 TTS（Text-to-Speech，文本转语音）来尝试新想法，并希望与社区分享你的实验，我们建议你遵循以下指南以实现更好的协作。\n（如果你有更好的协作建议，请告诉我们）\n- 创建一个新分支（branch）。\n- 提交一个 issue（问题）并指向你的分支。\n- 解释你的想法和实验。\n- 定期分享你的结果。（Tensorboard 日志文件、音频结果、可视化内容等）\n\n## 主要待办事项\n- [x] 实现模型。\n- [x] 在 LJSpeech 数据集上生成类人语音。\n- [x] 在不同数据集（Nancy）（TWEB）上生成类人语音。\n- [x] 成功使用 r=1 训练 TTS。\n- [x] 启用基于进程的分布式训练。类似于 (https:\u002F\u002Fgithub.com\u002Ffastai\u002Fimagenet-fast\u002F)。\n- [x] 适配神经声码器（Neural Vocoder）。TTS 可与 WaveRNN 和 ParallelWaveGAN 配合使用 (https:\u002F\u002Fgithub.com\u002Ferogol\u002FWaveRNN 和 https:\u002F\u002Fgithub.com\u002Ferogol\u002FParallelWaveGAN)\n- [x] 多说话人嵌入（Multi-speaker embedding）。\n- [x] 模型优化（模型导出、模型剪枝等）。\n\n### 致谢\n- https:\u002F\u002Fgithub.com\u002Fkeithito\u002Ftacotron （数据集预处理）\n- https:\u002F\u002Fgithub.com\u002Fr9y9\u002Ftacotron_pytorch （初始 Tacotron 架构）\n- https:\u002F\u002Fgithub.com\u002Fkan-bayashi\u002FParallelWaveGAN （声码器库）\n- https:\u002F\u002Fgithub.com\u002Fjaywalnut310\u002Fglow-tts （原始 Glow-TTS 实现）\n- https:\u002F\u002Fgithub.com\u002Ffatchord\u002FWaveRNN\u002F （原始 WaveRNN 实现）","# TTS 快速上手指南\n\n## 环境准备\n\n| 项目 | 要求 |\n|:---|:---|\n| Python 版本 | 3.6 - 3.8（推荐 3.7） |\n| 操作系统 | Linux \u002F macOS \u002F Windows |\n| GPU（可选） | CUDA 10.2+（用于训练加速） |\n\n**前置依赖：**\n- PyTorch（根据 CUDA 版本选择）\n- espeak \u002F espeak-ng（用于文本处理，Linux 建议安装）\n\n```bash\n# Ubuntu\u002FDebian 安装 espeak\nsudo apt-get install espeak\n\n# macOS\nbrew install espeak\n```\n\n## 安装步骤\n\n### 方式一：仅使用预训练模型（推荐快速体验）\n\n```bash\n# 使用 PyPI 直接安装\npip install TTS -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 方式二：本地开发\u002F训练模型\n\n```bash\n# 克隆仓库（国内可用 gitee 镜像加速）\ngit clone https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS.git\ncd TTS\n\n# 或使用镜像\ngit clone https:\u002F\u002Fgitee.com\u002Fmirrors\u002Fmozilla-TTS.git\n\n# 本地安装\npip install -e .\n```\n\n## 基本使用\n\n### 1. 查看可用模型\n\n```bash\ntts --list_models\n```\n\n### 2. 使用官方预训练模型合成语音\n\n```bash\ntts --text \"你好，这是 TTS 语音合成测试。\" \\\n    --model_name \"tts_models\u002Fzh-CN\u002Fbaker\u002Ftacotron2-DDC-GST\" \\\n    --vocoder_name \"vocoder_models\u002Fzh-CN\u002Fbaker\u002Fhifigan\" \\\n    --out_path output.wav\n```\n\n> 提示：中文模型路径可能为 `tts_models\u002Fzh-CN\u002F...`，具体以 `list_models` 输出为准。\n\n### 3. 使用自定义模型\n\n```bash\ntts --text \"你好，世界\" \\\n    --model_path \u002Fpath\u002Fto\u002Fmodel.pth.tar \\\n    --config_path \u002Fpath\u002Fto\u002Fconfig.json \\\n    --out_path output.wav\n```\n\n### 4. Python API 调用\n\n```python\nfrom TTS.api import TTS\n\n# 初始化模型\ntts = TTS(\"tts_models\u002Fzh-CN\u002Fbaker\u002Ftacotron2-DDC-GST\")\n\n# 合成语音\ntts.tts_to_file(text=\"你好，这是 TTS 语音合成。\", file_path=\"output.wav\")\n```\n\n---\n\n**更多资源：**\n- [官方模型列表](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FReleased-Models)\n- [训练教程 Notebook](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fwiki\u002FTTS-Notebooks-and-Tutorials)","**场景：独立开发者小王为视障用户开发无障碍阅读 App**\n\n小王是一名独立开发者，正在开发一款帮助视障用户阅读网页文章的移动应用，需要将文字内容转换为自然语音。\n\n### 没有 TTS 时\n\n- **语音质量差**：使用系统自带的免费 TTS 引擎，发音机械生硬，用户反馈\"像机器人念经\"，长时间听容易疲劳\n- **多语言支持难**：用户需要阅读英文技术文档，但免费方案的中文和英文切换时音色突变，体验割裂\n- **定制成本高**：想为 App 打造专属品牌声音，但商业 TTS API 按字符收费，预估月成本超过 3000 元，个人开发者难以承受\n- **离线需求无法满足**：视障用户常在网络不稳定环境使用，在线 API 频繁断线，且隐私数据上传存在顾虑\n\n### 使用 TTS 后\n\n- **音质接近真人**：部署 Tacotron2 + WaveRNN 模型，生成韵律自然的语音，用户满意度从 62% 提升至 89%\n- **20+ 语言统一音色**：利用预训练的多语言模型，中英文混合朗读时保持同一说话人特征，切换流畅无感知\n- **成本趋近于零**：本地化部署开源模型，一次性配置后零调用费用，项目预算从每月 3000 元降至服务器电费约 50 元\n- **完全离线运行**：模型运行在用户设备端，无网络依赖、无数据上传，既保障隐私又提升响应速度\n\nTTS 让小王以极低成本获得了媲美商业方案的语音合成能力，使他的无障碍应用真正具备了产品级竞争力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmozilla_TTS_2bc712c4.png","mozilla","Mozilla","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmozilla_4f54b559.png","This technology could fall into the right hands.",null,"https:\u002F\u002Fwiki.mozilla.org\u002FGithub","https:\u002F\u002Fgithub.com\u002Fmozilla",[81,85,89,93],{"name":82,"color":83,"percentage":84},"Jupyter Notebook","#DA5B0B",87.2,{"name":86,"color":87,"percentage":88},"Python","#3572A5",12.6,{"name":90,"color":91,"percentage":92},"HTML","#e34c26",0.1,{"name":94,"color":95,"percentage":92},"Shell","#89e051",10132,1324,"2026-04-10T17:59:36","MPL-2.0","Linux, macOS, Windows","未明确说明，但支持多GPU训练（CUDA_VISIBLE_DEVICES），建议NVIDIA GPU用于训练","未说明",{"notes":104,"python":105,"dependencies":106},"支持从PyPI快速安装（仅推理）或本地克隆安装（开发\u002F训练）；提供Docker镜像；支持模型转换为TensorFlow 2.0和TFLite格式；包含Jupyter Notebook用于模型评估和数据分析；支持20+语言的预训练模型","3.6 - 3.8（>=3.6, \u003C3.9）",[107,108,109,110,111,112,113,114,115,116],"torch","tensorflow>=2.0","numpy","scipy","librosa","soundfile","tensorboard","matplotlib","tqdm","unidecode",[15,14,16,118],"音频",[120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135],"deep-learning","text-to-speech","python","pytorch","tacotron","tts","speaker-encoder","dataset-analysis","tacotron2","tensorflow2","vocoder","melgan","gantts","multiband-melgan","glow-tts","speech",11,"2026-03-27T02:49:30.150509","2026-04-11T18:30:16.425324",[140,145,150,154,159,164,169,173],{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},3777,"训练时 CPU 成为瓶颈，GPU 利用率低，如何优化数据加载性能？","在命令前添加环境变量 `OMP_NUM_THREADS=1` 可以显著改善 CPU 瓶颈问题。同时建议将 `num_workers` 设置为 2-4，而不是过高。例如：\n```bash\nOMP_NUM_THREADS=1 python train.py --config_path config.json\n```\n在 `config.json` 中设置 `\"num_workers\": 2` 或 `\"num_workers\": 4`。","https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fissues\u002F501",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},3778,"Tacotron2 和 WaveRNN 应该使用哪个分支进行训练？","需要使用特定的分支组合：\n- Tacotron2: 使用分支 `https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Ftree\u002FTacotron2-iter-260K-824c091`\n- WaveRNN: 使用 Master 分支\n\n注意：切换到该分支后需要重新训练模型，效果可能略差，但这是使其正常工作的唯一方式。","https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fissues\u002F26",{"id":151,"question_zh":152,"answer_zh":153,"source_url":149},3779,"如何改进注意力对齐（attention alignment）的学习效果？","添加熵损失（entropy loss）可以强制网络学习更稀疏、更干净的注意力权重，改善难以学习对齐的情况：\n```python\nentropy = torch.distributions.Categorical(probs=alignments).entropy()\nentropy_loss = (entropy \u002F np.log(alignments.shape[1])).mean()\nloss += 1e-4 * entropy_loss\n```\n注意：损失权重过高会降低模型对新词的泛化能力，建议保持 `1e-4` 左右的权重。",{"id":155,"question_zh":156,"answer_zh":157,"source_url":158},3780,"Speaker Encoder 训练时内存不足怎么办？","可以使用交换空间（swap space）作为临时解决方案。如果在 SSD 上创建交换空间，速度应该足够快。\n\n创建交换空间的命令示例：\n```bash\nsudo fallocate -l 32G \u002Fswapfile\nsudo chmod 600 \u002Fswapfile\nsudo mkswap \u002Fswapfile\nsudo swapon \u002Fswapfile\n```","https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fissues\u002F512",{"id":160,"question_zh":161,"answer_zh":162,"source_url":163},3781,"WaveGrad 是否可以用 Griffin-Lim 输出作为初始噪声进行训练？","可以，但建议重新训练。具体做法是将 `compute_y_n` 方法中的随机噪声替换为 Griffin-Lim 波形：\n```python\n# 原代码\nnoise = torch.randn_like(y_0)\n# 替换为\nnoise = griffin_lim_waveform  # Griffin-Lim 输出的波形\n```\n推理时，`z = torch.randn_like(y_n)` 也应使用 Griffin-Lim 波形作为初始噪声，而不是随机噪声。","https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fissues\u002F518",{"id":165,"question_zh":166,"answer_zh":167,"source_url":168},3782,"Griffin-Lim 算法重建的频谱图过于平滑，如何改善重建质量？","可以对 Mel 频谱图进行平滑处理后再用 Griffin-Lim 重建。使用 2D 卷积平滑的示例代码：\n```python\nimport numpy as np\nfrom scipy import signal\n\ndef smooth_2d(y, n):\n    box = np.ones((n,n)) \u002F (n*n)\n    y_smooth = signal.convolve2d(y, box, boundary='symm', mode='same')\n    return y_smooth\n\n# 应用平滑\nmel_smooth = smooth_2d(mel_spectrogram, kernel_size=5)\n```\n注意：即使 `kernel_size=5` 的平滑也可能导致 Griffin-Lim 产生较差的结果，需要谨慎选择平滑强度。","https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Fissues\u002F9",{"id":170,"question_zh":171,"answer_zh":172,"source_url":158},3783,"如何对 Speaker Encoder 的嵌入向量进行聚类分析？","可以使用 HDBSCAN 对提取的说话人嵌入进行聚类。示例代码：\n```python\nimport numpy as np\nimport glob\nimport pandas as pd\nimport hdbscan\n\nembeddings = []\nfor file in glob.glob(\"embeddings_o\u002F*\u002F*.npy\"):\n    embeddings.append(np.load(file))\n\ndataframe = pd.DataFrame.from_records(np.vstack(embeddings))\n\nclusterer = hdbscan.HDBSCAN(\n    min_cluster_size=5,\n    metric='euclidean'\n).fit(dataframe)\n\nprint(clusterer.labels_)  # -1 表示噪声点\n```\n如果结果中大部分是 -1（噪声），可以尝试调整 `min_cluster_size` 参数或检查嵌入质量。",{"id":174,"question_zh":175,"answer_zh":176,"source_url":149},3784,"Prenet 使用 BatchNorm 替代 Dropout 有什么效果？","将 Prenet 中的 Dropout 替换为 BatchNorm 可以显著提升性能。但需要注意：\n- 使用 BatchNorm Prenet 的网络更难学习注意力对齐\n- 网络需要在自回归连接上有一定噪声，才能将编码器输出与网络输出关联起来\n- 在 Teacher Forcing 模式下，如果没有噪声，网络可能只依赖前一帧的预测而不需要编码器输出\n\n建议：如果注意力学习困难，可以保留部分 Dropout 或调整噪声强度。",[178],{"id":179,"version":180,"summary_zh":181,"released_at":182},201934,"v0.0.9","This is the first and v0.0.9 release of TTS, an open text-to-speech engine. TTS is still an evolving project and any upcoming release might be significantly different and not backward compatible. \r\n\r\nIn this release, we provide the following models.\r\n\r\n| Language        |Dataset | Model Name| Model Type| Download|\r\n| ------------- |:------:|:-----------------:|-----------------:|----|\r\n|English | LJSpeech | TacotronDCA| tts|[💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Ftts_models--en--ljspeech--tacotron2-DCA.zip)|\r\n|English         | LJSpeech | Glow-TTS| tts|[💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Ftts_models--en--ljspeech--glow-tts.zip)|\r\n|Spanish        | M-AILabs| TacotronDDC | tts|[💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Ftts_models--es--mai--tacotron2-DDC.zip)|\r\n|French          |M_AILabs| TacotronDDC| tts|[💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Ftts_models--fr--mai--tacotron2-DDC.zip)|\r\n|English         | LJSpeech|  MB-MelGAN| vocoder|[💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Fvocoder_models--en--ljspeech--mulitband-melgan.zip)|\r\n|Multi-Lang  | LibriTTS| FullBand-MelGAN|  vocoder|[💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Fvocoder_models--universal--libri-tts--fullband-melgan.zip)|\r\n|Multi-Lang  | LibriTTS| WaveGrad| vocoder| [💾](https:\u002F\u002Fgithub.com\u002Fmozilla\u002FTTS\u002Freleases\u002Fdownload\u002Fv0.0.9\u002Fvocoder_models--universal--libri-tts--wavegrad.zip)|\r\n\r\n\r\n## Notes\r\n- Multi-Lang vocoder models are intended for non-English models. \r\n- Vocoder models are independently trained from the tts models with possibly different sampling rates. Therefore, the performance is not optimal.\r\n- All models are trained with phonemes generated by **espeak** back-end (**not espeak-ng**).\r\n\r\nThis release has been tested under Python 3.6, 3.7, and 3.8.  It is strongly suggested to use conda to install the dependencies and set-up the runtime environment. \r\n\r\n","2021-01-29T00:03:56"]