[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-MahmoudAshraf97--whisper-diarization":3,"tool-MahmoudAshraf97--whisper-diarization":66},[4,23,32,40,48,57],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":22},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,2,"2026-04-05T10:45:23",[13,14,15,16,17,18,19,20,21],"图像","数据工具","视频","插件","Agent","其他","语言模型","开发框架","音频","ready",{"id":24,"name":25,"github_repo":26,"description_zh":27,"stars":28,"difficulty_score":29,"last_commit_at":30,"category_tags":31,"status":22},2863,"TTS","coqui-ai\u002FTTS","🐸TTS 是一款功能强大的深度学习文本转语音（Text-to-Speech）开源库，旨在将文字自然流畅地转化为逼真的人声。它解决了传统语音合成技术中声音机械生硬、多语言支持不足以及定制门槛高等痛点，让高质量的语音生成变得触手可及。\n\n无论是希望快速集成语音功能的开发者，还是致力于探索前沿算法的研究人员，亦或是需要定制专属声音的数据科学家，🐸TTS 都能提供得力支持。它不仅预置了覆盖全球 1100 多种语言的训练模型，让用户能够即刻上手，还提供了完善的工具链，支持用户利用自有数据训练新模型或对现有模型进行微调，轻松实现特定风格的声音克隆。\n\n在技术亮点方面，🐸TTS 表现卓越。其最新的 ⓍTTSv2 模型支持 16 种语言，并在整体性能上大幅提升，实现了低于 200 毫秒的超低延迟流式输出，极大提升了实时交互体验。此外，它还无缝集成了 🐶Bark、🐢Tortoise 等社区热门模型，并支持调用上千个 Fairseq 模型，展现了极强的兼容性与扩展性。配合丰富的数据集分析与整理工具，🐸TTS 已成为科研与生产环境中备受信赖的语音合成解决方案。",44971,3,"2026-04-03T14:47:02",[21,20,13],{"id":33,"name":34,"github_repo":35,"description_zh":36,"stars":37,"difficulty_score":29,"last_commit_at":38,"category_tags":39,"status":22},2375,"LocalAI","mudler\u002FLocalAI","LocalAI 是一款开源的本地人工智能引擎，旨在让用户在任意硬件上轻松运行各类 AI 模型，包括大语言模型、图像生成、语音识别及视频处理等。它的核心优势在于彻底打破了高性能计算的门槛，无需昂贵的专用 GPU，仅凭普通 CPU 或常见的消费级显卡（如 NVIDIA、AMD、Intel 及 Apple Silicon）即可部署和运行复杂的 AI 任务。\n\n对于担心数据隐私的用户而言，LocalAI 提供了“隐私优先”的解决方案，确保所有数据处理均在本地基础设施内完成，无需上传至云端。同时，它完美兼容 OpenAI、Anthropic 等主流 API 接口，这意味着开发者可以无缝迁移现有应用，直接利用本地资源替代云服务，既降低了成本又提升了可控性。\n\nLocalAI 内置了超过 35 种后端支持（如 llama.cpp、vLLM、Whisper 等），并集成了自主 AI 代理、工具调用及检索增强生成（RAG）等高级功能，且具备多用户管理与权限控制能力。无论是希望保护敏感数据的企业开发者、进行算法实验的研究人员，还是想要在个人电脑上体验最新 AI 技术的极客玩家，都能通过 LocalAI 获",44782,"2026-04-02T22:14:26",[13,21,19,17,20,14,16],{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":29,"last_commit_at":46,"category_tags":47,"status":22},3108,"bark","suno-ai\u002Fbark","Bark 是由 Suno 推出的开源生成式音频模型，能够根据文本提示创造出高度逼真的多语言语音、音乐、背景噪音及简单音效。与传统仅能朗读文字的语音合成工具不同，Bark 基于 Transformer 架构，不仅能模拟说话，还能生成笑声、叹息、哭泣等非语言声音，甚至能处理带有情感色彩和语气停顿的复杂文本，极大地丰富了音频表达的可能性。\n\n它主要解决了传统语音合成声音机械、缺乏情感以及无法生成非语音类音效的痛点，让创作者能通过简单的文字描述获得生动自然的音频素材。无论是需要为视频配音的内容创作者、探索多模态生成的研究人员，还是希望快速原型设计的开发者，都能从中受益。普通用户也可通过集成的演示页面轻松体验其神奇效果。\n\n技术亮点方面，Bark 支持商业使用（MIT 许可），并在近期更新中实现了显著的推理速度提升，同时提供了适配低显存 GPU 的版本，降低了使用门槛。此外，社区还建立了丰富的提示词库，帮助用户更好地驾驭模型生成特定风格的声音。只需几行 Python 代码，即可将创意文本转化为高质量音频，是连接文字与声音世界的强大桥梁。",39067,"2026-04-04T03:33:35",[21],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":54,"last_commit_at":55,"category_tags":56,"status":22},3788,"airi","moeru-ai\u002Fairi","airi 是一款开源的本地化 AI 伴侣项目，旨在将虚拟角色（如“二次元老婆”或赛博生命）带入用户的现实世界。它的核心目标是复刻并超越知名 AI 主播 Neuro-sama 的能力，让用户能够拥有完全自主掌控、可私有化部署的智能伙伴。\n\nairi 主要解决了用户对高度定制化、具备情感交互能力且数据隐私安全的 AI 角色的需求。不同于依赖云端服务的通用助手，airi 允许用户在本地运行，不仅保护了对话隐私，还赋予了用户定义角色性格与灵魂的自由。它支持实时语音聊天，甚至能直接参与《我的世界》（Minecraft）和《异星工厂》（Factorio）等游戏，实现了从单纯对话到共同娱乐的跨越。\n\n这款工具非常适合喜爱虚拟角色的普通用户、希望搭建个性化 AI 陪伴的技术爱好者，以及研究多模态交互的开发者。其独特的技术亮点在于跨平台支持（涵盖 Web、macOS 和 Windows）以及强大的游戏交互能力，让 AI 不仅能“说”，还能“玩”。通过容器化的灵魂设计，airi 为每个人创造专属数字生命提供了可能，让虚拟陪伴变得更加真实且触手可及。",37086,1,"2026-04-05T10:54:25",[19,21,17],{"id":58,"name":59,"github_repo":60,"description_zh":61,"stars":62,"difficulty_score":63,"last_commit_at":64,"category_tags":65,"status":22},2735,"MockingBird","babysor\u002FMockingBird","MockingBird 是一款开源的实时语音克隆工具，旨在让用户仅需 5 秒的参考音频，即可快速合成任意内容的语音，并实现逼真的音色复刻。它有效解决了传统语音合成技术中数据采集成本高、训练周期长以及难以实时生成的痛点，让个性化语音生成变得触手可及。\n\n这款工具特别适合开发者、AI 研究人员以及对语音技术感兴趣的技术爱好者使用。无论是用于构建交互式语音应用、进行声学模型研究，还是制作创意内容，MockingBird 都能提供强大的支持。普通用户若具备基础的编程环境配置能力，也可通过其提供的 Web 服务或工具箱体验前沿的变声效果。\n\n在技术亮点方面，MockingBird 基于 PyTorch 框架，不仅完美支持中文普通话及多种主流数据集，还实现了跨平台运行，兼容 Windows、Linux 乃至 M1 架构的 macOS。其独特的架构设计允许复用预训练的编码器与声码器，只需微调合成器即可获得出色效果，大幅降低了部署门槛。此外，项目内置了现成的 Web 服务器功能，方便用户通过远程调用快速集成到自己的应用中。尽管原作者已转向云端优化版本，但 MockingBird 作为经典的本地部署方案",36902,4,"2026-04-02T16:15:29",[17,21,13,20],{"id":67,"github_repo":68,"name":69,"description_en":70,"description_zh":71,"ai_summary_zh":72,"readme_en":73,"readme_zh":74,"quickstart_zh":75,"use_case_zh":76,"hero_image_url":77,"owner_login":78,"owner_name":79,"owner_avatar_url":80,"owner_bio":81,"owner_company":82,"owner_location":83,"owner_email":84,"owner_twitter":83,"owner_website":83,"owner_url":85,"languages":86,"stars":95,"forks":96,"last_commit_at":97,"license":98,"difficulty_score":29,"env_os":99,"env_gpu":100,"env_ram":101,"env_deps":102,"category_tags":112,"github_topics":113,"view_count":10,"oss_zip_url":83,"oss_zip_packed_at":83,"status":22,"created_at":120,"updated_at":121,"faqs":122,"releases":152},3637,"MahmoudAshraf97\u002Fwhisper-diarization","whisper-diarization","Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper","whisper-diarization 是一款基于 OpenAI Whisper 构建的开源工具，专注于解决语音识别中的“说话人分离”难题。在多人对话场景中，传统的语音转文字工具往往只能输出纯文本，无法区分具体是谁在说话。whisper-diarization 通过整合语音活动检测（VAD）和说话人嵌入技术，能够自动识别并标记转录文本中每一句话对应的发言者，生成带有说话人标签的精准对话记录。\n\n该工具的独特之处在于其严谨的多阶段处理流程：它首先提取人声以提升特征准确性，利用 Whisper 生成初始转录，随后借助 `ctc-forced-aligner` 对时间戳进行强制对齐以消除误差。接着，它调用 MarbleNet 模型剔除静音片段，并使用 TitaNet 提取说话人特征向量，最后结合标点符号模型进行微调，确保说话人身份与时间轴的高度匹配。\n\n这款工具非常适合需要处理会议记录、访谈录音、播客或多角色影视素材的开发者、研究人员及数据分析师使用。对于希望从音频数据中挖掘更深层对话结构，或需要自动化生成带角色区分字幕的用户来说，whisper-diarization 提供了一个高效且可靠","whisper-diarization 是一款基于 OpenAI Whisper 构建的开源工具，专注于解决语音识别中的“说话人分离”难题。在多人对话场景中，传统的语音转文字工具往往只能输出纯文本，无法区分具体是谁在说话。whisper-diarization 通过整合语音活动检测（VAD）和说话人嵌入技术，能够自动识别并标记转录文本中每一句话对应的发言者，生成带有说话人标签的精准对话记录。\n\n该工具的独特之处在于其严谨的多阶段处理流程：它首先提取人声以提升特征准确性，利用 Whisper 生成初始转录，随后借助 `ctc-forced-aligner` 对时间戳进行强制对齐以消除误差。接着，它调用 MarbleNet 模型剔除静音片段，并使用 TitaNet 提取说话人特征向量，最后结合标点符号模型进行微调，确保说话人身份与时间轴的高度匹配。\n\n这款工具非常适合需要处理会议记录、访谈录音、播客或多角色影视素材的开发者、研究人员及数据分析师使用。对于希望从音频数据中挖掘更深层对话结构，或需要自动化生成带角色区分字幕的用户来说，whisper-diarization 提供了一个高效且可靠的解决方案。只需简单的 Python 环境配置，即可将复杂的音频流转化为结构清晰的对话文本。","\u003Ch1 align=\"center\">Speaker Diarization Using OpenAI Whisper\u003C\u002Fh1>\n\n[![FreePalestine.Dev](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_readme_eaee9b1f935d.png)](https:\u002F\u002Ffreepalestine.dev)\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Factions\u002Fworkflows\u002Ftest_run.yml\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Factions\u002Fworkflows\u002Ftest_run.yml\u002Fbadge.svg\"\n         alt=\"Build Status\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fstargazers\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg?colorA=orange&colorB=orange&logo=github\"\n         alt=\"GitHub stars\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg\"\n             alt=\"GitHub issues\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fblob\u002Fmaster\u002FLICENSE\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg\"\n             alt=\"GitHub license\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fintent\u002Ftweet?text=&url=https%3A%2F%2Fgithub.com%2FMahmoudAshraf97%2Fwhisper-diarization\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl\u002Fhttps\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg?style=social\" alt=\"Twitter\">\n  \u003C\u002Fa> \n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fblob\u002Fmain\u002FWhisper_Transcription_%2B_NeMo_Diarization.ipynb\">\n    \u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open in Colab\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F11413\" target=\"_blank\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_readme_0dcd13139b79.png\" alt=\"MahmoudAshraf97%2Fwhisper-diarization | #9 Repository of the day\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\n# \nSpeaker Diarization pipeline based on OpenAI Whisper\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_readme_c8d5d5f7c398.png\" alt=\"drawing\" width=\"25\"\u002F> **Please, star the project on github (see top-right corner) if you appreciate my contribution to the community!**\n\n## What is it\nThis repository combines Whisper ASR capabilities with Voice Activity Detection (VAD) and Speaker Embedding to identify the speaker for each sentence in the transcription generated by Whisper. First, the vocals are extracted from the audio to increase the speaker embedding accuracy, then the transcription is generated using Whisper, then the timestamps are corrected and aligned using `ctc-forced-aligner` to help minimize diarization error due to time shift. The audio is then passed into MarbleNet for VAD and segmentation to exclude silences, TitaNet is then used to extract speaker embeddings to identify the speaker for each segment, the result is then associated with the timestamps generated by `ctc-forced-aligner` to detect the speaker for each word based on timestamps and then realigned using punctuation models to compensate for minor time shifts.\n\n\nWhisper and NeMo parameters are coded into diarize.py and helpers.py, I will add the CLI arguments to change them later\n## Installation\nPython >= `3.10` is needed, `3.9` will work but you'll need to manually install the requirements one by one.\n\n`FFMPEG` and `Cython` are needed as prerequisites to install the requirements\n```\npip install cython\n```\nor\n```\nsudo apt update && sudo apt install cython3\n```\n```\n# on Ubuntu or Debian\nsudo apt update && sudo apt install ffmpeg\n\n# on Arch Linux\nsudo pacman -S ffmpeg\n\n# on MacOS using Homebrew (https:\u002F\u002Fbrew.sh\u002F)\nbrew install ffmpeg\n\n# on Windows using Chocolatey (https:\u002F\u002Fchocolatey.org\u002F)\nchoco install ffmpeg\n\n# on Windows using Scoop (https:\u002F\u002Fscoop.sh\u002F)\nscoop install ffmpeg\n\n# on Windows using WinGet (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fwinget-cli)\nwinget install ffmpeg\n```\n```\npip install -c constraints.txt -r requirements.txt\n```\n## Usage \n\n```\npython diarize.py -a AUDIO_FILE_NAME\n```\n\nIf your system has enough VRAM (>=10GB), you can use `diarize_parallel.py` instead, the difference is that it runs NeMo in parallel with Whisper, this can be beneficial in some cases and the result is the same since the two models are nondependent on each other. This is still experimental, so expect errors and sharp edges. Your feedback is welcome.\n\n## Command Line Options\n\n- `-a AUDIO_FILE_NAME`: The name of the audio file to be processed\n- `--no-stem`: Disables source separation\n- `--whisper-model`: The model to be used for ASR, default is `medium.en`\n- `--suppress_numerals`: Transcribes numbers in their pronounced letters instead of digits, improves alignment accuracy\n- `--device`: Choose which device to use, defaults to \"cuda\" if available\n- `--language`: Manually select language, useful if language detection failed\n- `--batch-size`: Batch size for batched inference, reduce if you run out of memory, set to 0 for non-batched inference\n\n## Known Limitations\n- Overlapping speakers are yet to be addressed, a possible approach would be to separate the audio file and isolate only one speaker, then feed it into the pipeline but this will need much more computation\n- There might be some errors, please raise an issue if you encounter any.\n\n## Future Improvements\n- Implement a maximum length per sentence for SRT\n\n## Acknowledgements\nSpecial Thanks for [@adamjonas](https:\u002F\u002Fgithub.com\u002Fadamjonas) for supporting this project\nThis work is based on [OpenAI's Whisper](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fwhisper) , [Faster Whisper](https:\u002F\u002Fgithub.com\u002Fguillaumekln\u002Ffaster-whisper) , [Nvidia NeMo](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNeMo) , and [Facebook's Demucs](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdemucs)\n\n## Citation\nIf you use this in your research, please cite the project:\n\n```bibtex\n@unpublished{hassouna2024whisperdiarization,\n  title={Whisper Diarization: Speaker Diarization Using OpenAI Whisper},\n  author={Ashraf, Mahmoud},\n  year={2024}\n}\n```\n","\u003Ch1 align=\"center\">基于 OpenAI Whisper 的说话人分离\u003C\u002Fh1>\n\n[![FreePalestine.Dev](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_readme_eaee9b1f935d.png)](https:\u002F\u002Ffreepalestine.dev)\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Factions\u002Fworkflows\u002Ftest_run.yml\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Factions\u002Fworkflows\u002Ftest_run.yml\u002Fbadge.svg\"\n         alt=\"构建状态\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fstargazers\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg?colorA=orange&colorB=orange&logo=github\"\n         alt=\"GitHub 星标\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg\"\n             alt=\"GitHub 问题\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fblob\u002Fmaster\u002FLICENSE\">\n        \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg\"\n             alt=\"GitHub 许可证\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fintent\u002Ftweet?text=&url=https%3A%2F%2Fgithub.com%2FMahmoudAshraf97%2Fwhisper-diarization\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl\u002Fhttps\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization.svg?style=social\" alt=\"Twitter\">\n  \u003C\u002Fa> \n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fblob\u002Fmain\u002FWhisper_Transcription_%2B_NeMo_Diarization.ipynb\">\n    \u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"在 Colab 中打开\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F11413\" target=\"_blank\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_readme_0dcd13139b79.png\" alt=\"MahmoudAshraf97%2Fwhisper-diarization | 今日第9大仓库\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\n# \n基于 OpenAI Whisper 的说话人分离流水线\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_readme_c8d5d5f7c398.png\" alt=\"drawing\" width=\"25\"\u002F> **如果您欣赏我对社区的贡献，请在 GitHub 上为该项目点赞（见右上角）！**\n\n## 是什么\n该仓库将 Whisper ASR 功能与语音活动检测 (VAD) 和说话人嵌入相结合，以识别 Whisper 生成的转录中每句话的说话人。首先从音频中提取人声，以提高说话人嵌入的准确性；然后使用 Whisper 生成转录；接着利用 `ctc-forced-aligner` 校正并对齐时间戳，从而减少因时间偏移导致的分离错误。随后，音频被送入 MarbleNet 进行 VAD 和分段处理，以排除静音部分；再使用 TitaNet 提取说话人嵌入，识别每个片段的说话人；最后将结果与 `ctc-forced-aligner` 生成的时间戳关联，根据时间戳检测每个词的说话人，并通过标点符号模型重新对齐，以补偿细微的时间偏移。\n\nWhisper 和 NeMo 的参数已编码到 `diarize.py` 和 `helpers.py` 中，后续我会添加 CLI 参数以便修改这些设置。\n## 安装\n需要 Python >= `3.10`，虽然 `3.9` 也能运行，但您需要手动逐个安装依赖项。\n\n安装依赖项前需先安装 `FFMPEG` 和 `Cython`：\n```\npip install cython\n```\n或\n```\nsudo apt update && sudo apt install cython3\n```\n```\n# 在 Ubuntu 或 Debian 上\nsudo apt update && sudo apt install ffmpeg\n\n# 在 Arch Linux 上\nsudo pacman -S ffmpeg\n\n# 在 MacOS 上使用 Homebrew (https:\u002F\u002Fbrew.sh\u002F)\nbrew install ffmpeg\n\n# 在 Windows 上使用 Chocolatey (https:\u002F\u002Fchocolatey.org\u002F)\nchoco install ffmpeg\n\n# 在 Windows 上使用 Scoop (https:\u002F\u002Fscoop.sh\u002F)\nscoop install ffmpeg\n\n# 在 Windows 上使用 WinGet (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fwinget-cli)\nwinget install ffmpeg\n```\n```\npip install -c constraints.txt -r requirements.txt\n```\n## 使用方法 \n\n```\npython diarize.py -a AUDIO_FILE_NAME\n```\n\n如果您的系统拥有足够的显存（>=10GB），可以改用 `diarize_parallel.py`，其区别在于它会并行运行 NeMo 和 Whisper。在某些情况下，这种方式可能更有优势，且由于两个模型相互独立，最终结果相同。不过目前这仍处于实验阶段，可能会存在一些问题和不足之处，欢迎提出您的反馈意见。\n## 命令行选项\n\n- `-a AUDIO_FILE_NAME`: 待处理的音频文件名\n- `--no-stem`: 禁用音源分离\n- `--whisper-model`: 用于 ASR 的模型，默认为 `medium.en`\n- `--suppress_numerals`: 将数字转写为其发音字母而非数字形式，有助于提高对齐精度\n- `--device`: 指定使用的设备，默认为“cuda”（如可用）\n- `--language`: 手动选择语言，适用于语言检测失败的情况\n- `--batch-size`: 批量推理时的批次大小，若内存不足可调小，设为 0 则进行非批量推理\n\n## 已知限制\n- 对于重叠说话的情况尚未解决。一种可能的方法是将音频文件分离，只保留一位说话人的部分，再将其输入到流程中，但这需要更多的计算资源。\n- 可能会出现一些错误，如有遇到请提交问题。\n\n## 未来改进方向\n- 实现 SRT 文件中每句话的最大长度限制。\n\n## 致谢\n特别感谢 [@adamjonas](https:\u002F\u002Fgithub.com\u002Fadamjonas) 对本项目的大力支持。\n本工作基于 [OpenAI's Whisper](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fwhisper)、[Faster Whisper](https:\u002F\u002Fgithub.com\u002Fguillaumekln\u002Ffaster-whisper)、[Nvidia NeMo](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNeMo) 以及 [Facebook's Demucs](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdemucs)。\n\n## 引用\n如果您在研究中使用了本项目，请引用如下：\n\n```bibtex\n@unpublished{hassouna2024whisperdiarization,\n  title={Whisper Diarization: 基于 OpenAI Whisper 的说话人分离},\n  author={Ashraf, Mahmoud},\n  year={2024}\n}\n```","# Whisper-Diarization 快速上手指南\n\nWhisper-Diarization 是一个基于 OpenAI Whisper 的说话人日志（Speaker Diarization）工具。它能识别音频中不同说话人的身份，并将说话人标签与 Whisper 生成的转录文本逐句对齐。该流程结合了语音活动检测（VAD）、说话人嵌入提取以及时间戳强制对齐技术，有效提升了多人对话场景下的识别准确度。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux (Ubuntu\u002FDebian, Arch), macOS, 或 Windows\n*   **Python 版本**：推荐 `3.10` 及以上（`3.9` 也可用，但需手动逐个安装依赖）\n*   **硬件要求**：\n    *   推荐使用 NVIDIA GPU（显存 >= 4GB 可运行基础模型，>= 10GB 可尝试并行加速模式）。\n    *   若无 GPU，可使用 CPU 运行，但速度较慢。\n*   **前置依赖**：必须安装 `FFMPEG` 和 `Cython`。\n\n### 安装前置依赖\n\n**1. 安装 Cython**\n```bash\npip install cython\n# 或在 Ubuntu\u002FDebian 上\nsudo apt update && sudo apt install cython3\n```\n\n**2. 安装 FFMPEG**\n请根据您的操作系统选择对应的安装命令：\n\n*   **Ubuntu \u002F Debian**:\n    ```bash\n    sudo apt update && sudo apt install ffmpeg\n    ```\n*   **Arch Linux**:\n    ```bash\n    sudo pacman -S ffmpeg\n    ```\n*   **macOS (使用 Homebrew)**:\n    ```bash\n    brew install ffmpeg\n    ```\n*   **Windows (使用 Chocolatey)**:\n    ```bash\n    choco install ffmpeg\n    ```\n*   **Windows (使用 Scoop)**:\n    ```bash\n    scoop install ffmpeg\n    ```\n*   **Windows (使用 WinGet)**:\n    ```bash\n    winget install ffmpeg\n    ```\n\n> **提示**：国内用户若遇到 pip 下载慢的问题，建议在安装 Python 依赖时添加清华或阿里镜像源，例如：`pip install -c constraints.txt -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n## 安装步骤\n\n完成前置依赖安装后，克隆项目并安装 Python 依赖包：\n\n```bash\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization.git\ncd whisper-diarization\n\n# 安装核心依赖\npip install -c constraints.txt -r requirements.txt\n```\n\n## 基本使用\n\n### 最简单的使用示例\n\n对单个音频文件进行说话人分离和转录，运行以下命令：\n\n```bash\npython diarize.py -a AUDIO_FILE_NAME\n```\n\n将 `AUDIO_FILE_NAME` 替换为您的实际音频文件路径（支持 mp3, wav, m4a 等常见格式）。\n\n### 常用参数说明\n\n您可以根据需求添加以下参数优化结果：\n\n*   **指定语言**（若自动检测失败）：\n    ```bash\n    python diarize.py -a AUDIO_FILE_NAME --language zh\n    ```\n*   **更换 Whisper 模型**（默认为 `medium.en`，中文建议用 `medium` 或 `large`）：\n    ```bash\n    python diarize.py -a AUDIO_FILE_NAME --whisper-model large\n    ```\n*   **禁用音源分离**（加快处理速度，但可能降低嘈杂环境下的准确率）：\n    ```bash\n    python diarize.py -a AUDIO_FILE_NAME --no-stem\n    ```\n*   **显存优化**（若显存不足，减小 batch size 或设为 0）：\n    ```bash\n    python diarize.py -a AUDIO_FILE_NAME --batch-size 0\n    ```\n\n### 进阶：并行加速模式\n\n如果您的显卡显存充足（>= 10GB），可以尝试使用并行脚本 `diarize_parallel.py`，它能同时运行 NeMo 和 Whisper 模型以提升效率（实验性功能）：\n\n```bash\npython diarize_parallel.py -a AUDIO_FILE_NAME\n```\n\n程序运行结束后，将在输出目录生成包含说话人标签的转录文件（通常为 SRT 或 TXT 格式）。","某法律科技团队正在处理数百小时的多方庭审录音，需要将其转化为可检索、可引用的结构化文字档案。\n\n### 没有 whisper-diarization 时\n- **说话人混淆**：原始转录文本将所有法官、律师和证人的发言混在一起，阅读时无法区分谁在说话，必须人工反复听音辨认。\n- **校对成本极高**：由于缺乏时间戳对齐，人工整理一份 1 小时的录音需耗时 3-4 小时进行分段和标注，效率极低。\n- **关键信息遗漏**：在多人同时插话或快速对话的场景下，传统工具容易漏掉短句，导致关键证词缺失。\n- **检索困难**：无法通过“查找某位特定律师的发言”来快速定位内容，只能全文盲搜，准确率低下。\n\n### 使用 whisper-diarization 后\n- **自动角色分离**：利用 TitaNet 提取声纹特征，系统自动将文本标记为“说话人 A（法官）”、“说话人 B（原告律师）”，清晰还原对话现场。\n- **精准时间对齐**：结合 `ctc-forced-aligner` 修正时间戳，确保每句话甚至每个单词都精确对应音频位置，校对时间缩短至 30 分钟以内。\n- **静音智能过滤**：内置 MarbleNet 进行语音活动检测（VAD），自动剔除长时间静音和背景噪音，只保留有效人声片段。\n- **结构化数据输出**：生成的日志直接包含说话人 ID 和时间段，支持按人物索引快速跳转，极大提升了案情复盘效率。\n\nwhisper-diarization 通过将高精度的语音识别与声纹分离技术深度融合，把原本繁琐的人工听写工作转变为自动化、结构化的数据生产流程。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMahmoudAshraf97_whisper-diarization_df949cf7.png","MahmoudAshraf97","Mahmoud Ashraf","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FMahmoudAshraf97_e274af47.jpg","Speech ML\u002FAI Engineer at @TarteelAI, \r\n\r\nComputer Engineering Graduate. Interested in Deep Learning and its applications Especially in Speech Recognition","@TarteelAI",null,"hassouna97.ma@gmail.com","https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97",[87,91],{"name":88,"color":89,"percentage":90},"Jupyter Notebook","#DA5B0B",53,{"name":92,"color":93,"percentage":94},"Python","#3572A5",47,5471,500,"2026-04-04T18:55:22","BSD-2-Clause","Linux, macOS, Windows","非绝对必需（默认使用 CUDA，若无则可能回退），推荐显存 >=10GB 以运行并行模式 (diarize_parallel.py)","未说明",{"notes":103,"python":104,"dependencies":105},"安装前必须预先安装 FFmpeg 和 Cython。若显存大于等于 10GB，可使用实验性的 diarize_parallel.py 脚本并行运行 NeMo 和 Whisper 以提升效率。该工具集成了语音活动检测 (VAD) 和说话人嵌入技术，并依赖 ctc-forced-aligner 进行时间戳校正。",">=3.10 (3.9 需手动安装依赖)",[106,107,108,109,110,111],"ffmpeg","cython","openai-whisper","nvidia-nemo","demucs","ctc-forced-aligner",[21],[114,115,116,117,118,119],"asr","speaker-diarization","speech","speech-recognition","speech-to-text","whisper","2026-03-27T02:49:30.150509","2026-04-06T05:37:29.787973",[123,128,133,138,143,148],{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},16676,"如何在 Google Colab 上运行该项目？","维护者已提供专门的 Colab Notebook，包含所有必要的环境配置和依赖项，可以直接开箱即用。无需手动执行 git clone 或 pip install 等步骤，直接打开提供的 Notebook 链接运行即可。","https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\u002F5",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},16677,"遇到 'ImportError: cannot import name generate_emissions from ctc_forced_aligner' 错误怎么办？","该问题通常由 setuptools 和 packaging 版本不匹配引起。请尝试升级 packaging 库：\npip install -U packaging\n如果问题依旧，建议卸载默认的 ctc_forced_aligner 包并从 GitHub 源码安装最新版本：\npip uninstall ctc_forced_aligner\npip install git+https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fctc-forced-aligner.git","https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\u002F201",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},16678,"处理长音频（如 4 小时）时内存溢出导致崩溃如何解决？","目前官方尚未提供完美的自动分块修复方案。临时变通方法是将音频文件手动分割成较小的片段（例如每段 1 小时），分别进行处理，最后再合并结果。简单的无重叠分块可能导致说话人标签不一致，理想方案是分段时保留重叠部分以确保说话人连续性，但这需要用户自行实现拼接逻辑。","https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\u002F301",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},16679,"遇到 'AssertionError: uroman not found' 错误如何修复？","这通常是因为缺少必要的系统依赖或环境配置不完整。在 Ubuntu 系统上，请确保按顺序执行以下操作：\n1. 安装 ffmpeg: sudo apt install ffmpeg\n2. 安装 cython: sudo apt update && sudo apt install cython3\n3. 更新 pip 到最新版本 (如 25.0.0)\n4. 克隆项目后直接运行。如果是在特定硬件环境下，确保显卡驱动和 CUDA 环境配置正确。","https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\u002F293",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},16680,"为什么会出现 'FileNotFoundError: ... mono_file.rttm' 错误？","此错误通常意味着说话人分离（diarization）步骤失败，导致预期的输出文件未生成。常见原因包括：\n1. 代码不支持并发执行（如在 FastAPI 中并行调用），需要修改代码以适配并发场景。\n2. 音频中包含音乐干扰了源分离（source splitting），可尝试添加 --no-stem 参数禁用源分离功能。\n3. 模型版本与当前安装的 pyannote.audio 或 torch 版本不兼容，可能需要降级相关库。建议查看完整的堆栈跟踪以定位具体失败原因。","https:\u002F\u002Fgithub.com\u002FMahmoudAshraf97\u002Fwhisper-diarization\u002Fissues\u002F212",{"id":149,"question_zh":150,"answer_zh":151,"source_url":127},16681,"说话人分离效果不佳或识别不准确的原因有哪些？","分离效果差通常由以下原因导致：\n1. 音频中包含背景音乐，导致源分离模块（dora）失败。日志中若出现 'Source splitting failed' 且提示缺少 'dora' 模块，需安装该模块或禁用源分离。\n2. 说话人音色非常相似且语速较快，导致模型难以区分。\n建议检查日志中是否有源分离失败的警告，并尝试更换不含音乐的音频测试，或调整模型参数。",[]]