Bert-vits2-2.3-Final,Bert-vits2最终版一键整合包(复刻生化危机艾达王)

近日,Bert-vits2发布了最新的版本2.3-final,意为最终版,修复了一些已知的bug,添加基于 WavLM 的 Discriminator(来源于 StyleTTS2),令人意外的是,因情感控制效果不佳,去除了 CLAP情感模型,换成了相对简单的 BERT 融合语义方式。

事实上,经过2.2版本的测试,CLAP情感模型的效果还是不错的,关于2.2版本,请移步:

Bert-vits2-v2.2新版本本地训练推理整合包(原神八重神子英文模型miko)

更多情报请关注Bert-vits2官网:

复制代码
https://github.com/fishaudio/Bert-VITS2/releases/tag/v2.3

本次我们基于最新版Bert-vits2-2.3来复刻生化危机经典角色艾达王(ada wong)的声音。

Bert-vits2-2.3项目配置

首先克隆项目:

复制代码
git clone https://github.com/v3ucn/Bert-vits2-V2.3.git

注意该项目fork自Bert-vits2的2.3分支,在其基础上增加了素材切分和转写标注等功能,更易于使用。

随后进入项目:

复制代码
cd Bert-vits2-V2.3

安装依赖:

复制代码
pip3 install -r requirements.txt

随后下载对应的模型,首先是bert模型:

复制代码
https://openi.pcl.ac.cn/Stardust_minus/Bert-VITS2/modelmanage/show_model

放入到bert目录:

复制代码
E:\work\Bert-VITS2-2.3\bert>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
│   bert_models.json  
│  
├───bert-base-japanese-v3  
│       .gitattributes  
│       config.json  
│       README.md  
│       tokenizer_config.json  
│       vocab.txt  
│  
├───bert-large-japanese-v2  
│       .gitattributes  
│       config.json  
│       README.md  
│       tokenizer_config.json  
│       vocab.txt  
│  
├───chinese-roberta-wwm-ext-large  
│       .gitattributes  
│       added_tokens.json  
│       config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│       vocab.txt  
│  
├───deberta-v2-large-japanese  
│       .gitattributes  
│       config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│  
├───deberta-v2-large-japanese-char-wwm  
│       .gitattributes  
│       config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer_config.json  
│       vocab.txt  
│  
└───deberta-v3-large  
        .gitattributes  
        config.json  
        generator_config.json  
        pytorch_model.bin  
        README.md  
        spm.model  
        tokenizer_config.json

注意,其中每个子目录中的pytorch_model.bin就是bert模型本体。

随后还得下载clap模型,虽然推理已经把clap去掉了,同时下载wav2vec2-large-robust-12-ft-emotion-msp-dim模型,放入到项目的emotional目录:

复制代码
E:\work\Bert-VITS2-2.3\emotional>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
├───clap-htsat-fused  
│       .gitattributes  
│       config.json  
│       merges.txt  
│       preprocessor_config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│       vocab.json  
│  
└───wav2vec2-large-robust-12-ft-emotion-msp-dim  
        .gitattributes  
        config.json  
        LICENSE  
        preprocessor_config.json  
        pytorch_model.bin  
        README.md  
        vocab.json

最后下载底模:

复制代码
https://huggingface.co/OedoSoldier/Bert-VITS2-2.3

放入到角色的models目录即可。

请注意这次2.3的底模是4个文件。

Bert-vits2-2.3数据预处理

把艾达王的语音素材放入到Data/ada/raw目录中,执行切分脚本:

复制代码
python3 audio_slicer.py

会切分成小片素材:

复制代码
E:\work\Bert-VITS2-2.3\Data\ada\raw>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
    ada_0.wav  
    ada_1.wav  
    ada_10.wav  
    ada_11.wav  
    ada_12.wav  
    ada_13.wav  
    ada_14.wav  
    ada_15.wav  
    ada_16.wav  
    ada_17.wav  
    ada_18.wav  
    ada_19.wav  
    ada_2.wav  
    ada_20.wav  
    ada_21.wav  
    ada_22.wav  
    ada_23.wav  
    ada_24.wav  
    ada_25.wav  
    ada_26.wav  
    ada_3.wav  
    ada_4.wav  
    ada_5.wav  
    ada_6.wav  
    ada_7.wav  
    ada_8.wav  
    ada_9.wav

随后运行转写和标注:

复制代码
python3 short_audio_transcribe.py

程序返回:

复制代码
E:\work\Bert-VITS2-2.3\venv\lib\site-packages\whisper\timing.py:58: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.  
  def backtrace(trace: np.ndarray):  
Data/ada/raw  
Detected language: en  
I do. The kind you like.  
Processed: 1/27  
Detected language: en  
Now where's the amber?  
Processed: 2/27  
Detected language: en  
Leave the girl. She's lost no matter what.  
Processed: 3/27  
Detected language: en  
You walk away now, and who knows?  
Processed: 4/27  
Detected language: en  
Maybe you'll live to meet me again.  
Processed: 5/27  
Detected language: en  
And I might get you that greeting you were looking for.  
Processed: 6/27  
Detected language: en  
How about we continue this discussion another time?  
Processed: 7/27  
Detected language: en  
Sorry, nothing yet.  
Processed: 8/27  
Detected language: en  
But my little helper is creating  
Processed: 9/27  
Detected language: en  
Quite the commotion.  
Processed: 10/27  
Detected language: en  
Everything will work out just fine.  
Processed: 11/27  
Detected language: en  
He's a good boy. Predictable.  
Processed: 12/27  
Detected language: en  
The deal was, we get you out of here when you deliver the amber. No amber, no protection, Louise.  
Processed: 13/27  
Detected language: en  
Nothing personal, Leon.  
Processed: 14/27  
Detected language: en  
Louise and I had an arrangement.  
Processed: 15/27  
Detected language: en  
Don't worry, I'll take good care of it.  
Processed: 16/27  
Detected language: en  
Just one question.  
Processed: 17/27  
Detected language: en  
What are you planning to do with this?  
Processed: 18/27  
Detected language: en  
So, we're talking millions of casualties?  
Processed: 19/27  
Detected language: en  
We're changing course. Now.  
Processed: 20/27  
Detected language: en  
You can stop right there, Leon.  
Processed: 21/27  
Detected language: en  
wouldn't make me use this.  
Processed: 22/27  
Detected language: en  
Would you? You don't seem surprised.  
Processed: 23/27  
Detected language: en  
Interesting.  
Processed: 24/27  
Detected language: en  
Not a bad move  
Processed: 25/27  
Detected language: en  
Very smooth. Ah, Leon.  
Processed: 26/27  
Detected language: en  
You know I don't work and tell.

注意,这里whiper会报一个警告,如果觉得不好看,可以修改timing.py第58行:

复制代码
修改前  
@numba.jit  
def backtrace(trace: np.ndarray):  
  
修改后  
@numba.jit(nopython=True)  
def backtrace(trace: np.ndarray):

随后,运行web预处理界面:

复制代码
python3 webui_preprocess.py

随后按照页面提示操作即可:

至此,数据预处理就结束了。

Bert-vits2-2.3训练和推理

在根目录运行命令:

复制代码
python3 train_ms.py

模型会在models目录生成:

复制代码
E:\work\Bert-VITS2-2.3\Data\ada\models>tree/f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
    G_150.pth

随后开启推理页面进行推理即可:

复制代码
python3 webui.py

新的推理页面增加了使用辅助文本的语意来辅助生成对话(语言保持与主文本相同),即以提示词prompt的形式来定制化生成语音的风格。

但又不能使用使用指令式文本(如:开心),要使用带有强烈情感的文本(如:我好快乐!!!)

这就导致生成的语音情感风格比较玄学:

因为你得不停地调整prompt来测试效果,不如之前地clap情感的audio prompt来的直观,但客观上讲,通过bert语义文本引导的风格化情感语音还是有一定效果的。

结语

更新Bert-vits2基础教程的同时,也学习到了很多东西,毫无疑问,Bert-vits2让更多的人领略到了深度学习的魅力,它是一个极其优秀的人工智能入门项目,兴趣永远是最好的老师,与各位共勉,最后奉上Bert-vits2-2.3-Final整合包:

复制代码
整合包链接:https://pan.baidu.com/s/182LZCu5cyR3nH8EoTBLR-g?pwd=v3uc

与众乡亲同飨。

相关推荐
七牛云行业应用几秒前
DSH Desktop 桌面版实测:Win/macOS 一键安装,“桌面也是插件“怎么理解,和 npx 起 Web UI 差在哪
人工智能·agent·ai编程
空堂与归2 分钟前
文本喂给模型前要做啥?文本预处理与张量表示全解析
人工智能
烂蜻蜓6 分钟前
Flask入门教程(二十四):请求对象API——获取客户端数据的完整指南
后端·python·flask
AI的探索之旅10 分钟前
97 个 OpenCV 实例(十七):图片读写,FileStorage 与 JPEG 采样
人工智能·opencv·计算机视觉
Forerror202613 分钟前
API网关怎么选?MAI Gateway vs 开源方案全面对比
人工智能·ai工具·maigateway·企业ai网关·企业级大模型网关
开开心心就好14 分钟前
手机悬屏翻译工具外语游戏漫画APP全覆盖
android·前端·javascript·python·游戏·pdf·html
梦在远山后15 分钟前
Python 中两种 Queue 的区别
python·langchain
Likeadust16 分钟前
一键创建,说开就开:私有化音视频系统EasyDSS视频会议的入会、协作与AI纪要全流程
人工智能·音视频·easydss
小陈phd16 分钟前
电商客服智能体状态机编排:基于 LangGraph 的双轨意图识别与分级降级工程实践
人工智能
code_pgf17 分钟前
总体目标与系统架构
人工智能·机器人