Spaces:
Runtime error
Runtime error
Duplicate from lj1995/vocal2guitar
Browse filesCo-authored-by: liu <lj1995@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes.
See raw diff
- #U4f7f#U7528#U9700#U9075#U5b88#U7684#U534f#U8bae-LICENSE.txt +50 -0
- .gitattributes +36 -0
- Changelog_CN.md +68 -0
- Changelog_EN.md +72 -0
- Changelog_KO.md +77 -0
- Dockerfile +13 -0
- LICENSE +21 -0
- MDXNet.py +274 -0
- README.md +14 -0
- Retrieval_based_Voice_Conversion_WebUI.ipynb +381 -0
- Retrieval_based_Voice_Conversion_WebUI_v2.ipynb +401 -0
- __pycache__/config.cpython-39.pyc +0 -0
- __pycache__/i18n.cpython-39.pyc +0 -0
- __pycache__/my_utils.cpython-39.pyc +0 -0
- __pycache__/vc_infer_pipeline.cpython-39.pyc +0 -0
- app.py +163 -0
- config.py +110 -0
- configs/32k.json +46 -0
- configs/40k.json +46 -0
- configs/48k.json +46 -0
- docs/#U5c0f#U767d#U7b80#U6613#U6559#U7a0b.doc +0 -0
- docs/README.en.md +104 -0
- docs/README.ja.md +104 -0
- docs/README.ko.han.md +100 -0
- docs/README.ko.md +112 -0
- docs/faiss_tips_en.md +102 -0
- docs/faiss_tips_ja.md +101 -0
- docs/faiss_tips_ko.md +132 -0
- docs/faq.md +89 -0
- docs/faq_en.md +95 -0
- docs/training_tips_en.md +65 -0
- docs/training_tips_ja.md +64 -0
- docs/training_tips_ko.md +53 -0
- envfilescheck.bat +348 -0
- export_onnx.py +54 -0
- extract_f0_print.py +160 -0
- extract_feature_print.py +116 -0
- extract_locale.py +31 -0
- ffmpeg +3 -0
- go-realtime-gui.bat +2 -0
- go-web.bat +2 -0
- gui.py +681 -0
- hubert_base.pt +3 -0
- i18n.py +28 -0
- i18n/en_US.json +1 -0
- i18n/es_ES.json +123 -0
- i18n/ja_JP.json +123 -0
- i18n/locale_diff.py +45 -0
- i18n/zh_CN.json +123 -0
- i18n/zh_HK.json +123 -0
#U4f7f#U7528#U9700#U9075#U5b88#U7684#U534f#U8bae-LICENSE.txt
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2023 liujing04
|
4 |
+
Copyright (c) 2023 源文雨
|
5 |
+
|
6 |
+
本软件及其相关代码以MIT协议开源,作者不对软件具备任何控制力,使用软件者、传播软件导出的声音者自负全责。
|
7 |
+
如不认可该条款,则不能使用或引用软件包内任何代码和文件。
|
8 |
+
|
9 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
14 |
+
|
15 |
+
特此授予任何获得本软件和相关文档文件(以下简称“软件”)副本的人免费使用、复制、修改、合并、出版、分发、再授权和/或销售本软件的权利,以及授予本软件所提供的人使用本软件的权利,但须符合以下条件:
|
16 |
+
上述版权声明和本许可声明应包含在软件的所有副本或实质部分中。
|
17 |
+
软件是“按原样”提供的,没有任何明示或暗示的保证,包括但不限于适销性、适用于特定目的和不侵权的保证。在任何情况下,作者或版权持有人均不承担因软件或软件的使用或其他交易而产生、产生或与之相关的任何索赔、损害赔偿或其他责任,无论是在合同诉讼、侵权诉讼还是其他诉讼中。
|
18 |
+
|
19 |
+
相关引用库协议如下:
|
20 |
+
#################
|
21 |
+
ContentVec
|
22 |
+
https://github.com/auspicious3000/contentvec/blob/main/LICENSE
|
23 |
+
MIT License
|
24 |
+
#################
|
25 |
+
VITS
|
26 |
+
https://github.com/jaywalnut310/vits/blob/main/LICENSE
|
27 |
+
MIT License
|
28 |
+
#################
|
29 |
+
HIFIGAN
|
30 |
+
https://github.com/jik876/hifi-gan/blob/master/LICENSE
|
31 |
+
MIT License
|
32 |
+
#################
|
33 |
+
gradio
|
34 |
+
https://github.com/gradio-app/gradio/blob/main/LICENSE
|
35 |
+
Apache License 2.0
|
36 |
+
#################
|
37 |
+
ffmpeg
|
38 |
+
https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.LGPLv3
|
39 |
+
https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2021-02-28-12-32/ffmpeg-n4.3.2-160-gfbb9368226-win64-lgpl-4.3.zip
|
40 |
+
LPGLv3 License
|
41 |
+
MIT License
|
42 |
+
#################
|
43 |
+
ultimatevocalremovergui
|
44 |
+
https://github.com/Anjok07/ultimatevocalremovergui/blob/master/LICENSE
|
45 |
+
https://github.com/yang123qwe/vocal_separation_by_uvr5
|
46 |
+
MIT License
|
47 |
+
#################
|
48 |
+
audio-slicer
|
49 |
+
https://github.com/openvpi/audio-slicer/blob/main/LICENSE
|
50 |
+
MIT License
|
.gitattributes
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
logs/added_IVF2225_Flat_nprobe_1_simple-guitar-crepe-guolv_v2.index filter=lfs diff=lfs merge=lfs -text
|
36 |
+
ffmpeg filter=lfs diff=lfs merge=lfs -text
|
Changelog_CN.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### 20230528更新
|
2 |
+
- 增加v2的jupyter notebook,韩文changelog,增加一些环境依赖
|
3 |
+
- 增加呼吸、清辅音、齿音保护模式
|
4 |
+
- 支持crepe-full推理
|
5 |
+
- UVR5人声伴奏分离加上3个去延迟模型和MDX-Net去混响模型,增加HP3人声提取模型
|
6 |
+
- 索引名称增加版本和实验名称
|
7 |
+
- 人声伴奏分离、推理批量导出增加音频导出格式选项
|
8 |
+
- 废弃32k模型的训练
|
9 |
+
|
10 |
+
todolist:
|
11 |
+
- 特征检索增加时序维度
|
12 |
+
- 特征检索增加pre-kmeans可选项
|
13 |
+
- 特征检索增加PCAR降维可选项
|
14 |
+
- 支持onnx推理(附带仅推理的小压缩包)
|
15 |
+
- 训练时在音高、gender、eq、噪声等方面对输入进行随机增强
|
16 |
+
- 补全v2版本的48k预训练模型
|
17 |
+
|
18 |
+
|
19 |
+
### 20230513更新
|
20 |
+
- 清除一键包内部老版本runtime内残留的infer_pack和uvr5_pack
|
21 |
+
- 修复训练集预处理伪多进程的bug
|
22 |
+
- 增加harvest识别音高可选通过中值滤波削弱哑音现象,可调整中值滤波半径
|
23 |
+
- 导出音频增加后处理重采样
|
24 |
+
- 训练n_cpu进程数从"仅调整f0提取"改为"调整数据预处理和f0提取"
|
25 |
+
- 自动检测logs文件夹下的index路径,提供下拉列表功能
|
26 |
+
- tab页增加"常见问题解答"(也可参考github-rvc-wiki)
|
27 |
+
- 相同路径的输入音频推理增加了音高缓存(用途:使用harvest音高提取,整个pipeline会经历漫长且重复的音高提取过程,如果不使用缓存,实验不同音色、索引、音高中值滤波半径参数的用户在第一次测试后的等待结果会非常痛苦)
|
28 |
+
|
29 |
+
### 20230514更新
|
30 |
+
- 音量包络对齐输入混合(可以缓解“输入静音输出小幅度噪声”的问题。如果输入音频背景底噪大则不建议开启,默认不开启(值为1可视为不开启))
|
31 |
+
- 支持按照指定频率保存提取的小模型(假如你想尝试不同epoch下的推理效果,但是不想保存所有大checkpoint并且每次都要ckpt手工处理提取小模型,这项功能会非常实用)
|
32 |
+
- 通过设置环境变量解决服务端开了系统全局代理导致浏览器连接错误的问题
|
33 |
+
- 支持v2预训练模型(目前只公开了40k版本进行测试,另外2个采样率还没有训练完全)
|
34 |
+
- 推理前限制超过1的过大音量
|
35 |
+
- 微调数据预处理参数
|
36 |
+
|
37 |
+
|
38 |
+
### 20230409更新
|
39 |
+
- 修正训练参数,提升显卡平均利用率,A100最高从25%提升至90%左右,V100:50%->90%左右,2060S:60%->85%左右,P40:25%->95%左右,训练速度显著提升
|
40 |
+
- 修正参数:总batch_size改为每张卡的batch_size
|
41 |
+
- 修正total_epoch:最大限制100解锁至1000;默认10提升至默认20
|
42 |
+
- 修复ckpt提取识别是否带音高错误导致推理异常的问题
|
43 |
+
- 修复分布式训练每个rank都保存一次ckpt的问题
|
44 |
+
- 特征提取进行nan特征过滤
|
45 |
+
- 修复静音输入输出随机辅音or噪声的问题(老版模型需要重做训练集重训)
|
46 |
+
|
47 |
+
### 20230416更新
|
48 |
+
- 新增本地实时变声迷你GUI,双击go-realtime-gui.bat启动
|
49 |
+
- 训练推理均对<50Hz的频段进行滤波过滤
|
50 |
+
- 训练推理音高提取pyworld最低音高从默认80下降至50,50-80hz间的男声低音不会哑
|
51 |
+
- WebUI支持根据系统区域变更语言(现支持en_US,ja_JP,zh_CN,zh_HK,zh_SG,zh_TW,不支持的默认en_US)
|
52 |
+
- 修正部分显卡识别(例如V100-16G识别失败,P4识别失败)
|
53 |
+
|
54 |
+
### 20230428更新
|
55 |
+
- 升级faiss索引设置,速度更快,质量更高
|
56 |
+
- 取消total_npy依赖,后续分享模型不再需要填写total_npy
|
57 |
+
- 解锁16系限制。4G显存GPU给到4G的推理设置。
|
58 |
+
- 修复部分音频格式下UVR5人声伴奏分离的bug
|
59 |
+
- 实时变声迷你gui增加对非40k与不懈怠音高模型的支持
|
60 |
+
|
61 |
+
### 后续计划:
|
62 |
+
功能:
|
63 |
+
- 支持多人训练选项卡(至多4人)
|
64 |
+
|
65 |
+
底模:
|
66 |
+
- 收集呼吸wav加入训练集修正呼吸变声电音的问题
|
67 |
+
- 我们正在训练增加了歌声训练集的底模,未来会公开
|
68 |
+
|
Changelog_EN.md
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### 2023-05-28
|
2 |
+
- Add v2 jupyter notebook, korean changelog, fix some environment requirments
|
3 |
+
- Add voiceless consonant and breath protection mode
|
4 |
+
- Support crepe-full pitch detect
|
5 |
+
- UVR5 vocal separation: support dereverb models and de-echo models
|
6 |
+
- Add experiment name and version on the name of index
|
7 |
+
- Support users to manually select export format of output audios when batch voice conversion processing and UVR5 vocal separation
|
8 |
+
- 32k model training is no more supported
|
9 |
+
|
10 |
+
todolist:
|
11 |
+
- Feature retrieval: add temporal feature retrieval
|
12 |
+
- Feature retrieval: add pre-kmeans option
|
13 |
+
- Feature retrieval: add PCAR dimensionality reduction
|
14 |
+
- Add onnx inference support
|
15 |
+
- Random data augmentation when training: pitch, gender, eq, noise
|
16 |
+
- Add v2 version pretrained-models
|
17 |
+
|
18 |
+
### 2023-05-13
|
19 |
+
- Clear the redundant codes in the old version of runtime in the one-click-package: infer_pack and uvr5_pack
|
20 |
+
- Fix pseudo multiprocessing bug in training set preprocessing
|
21 |
+
- Adding median filtering radius adjustment for harvest pitch recognize algorithm
|
22 |
+
- Support post processing resampling for exporting audio
|
23 |
+
- Multi processing "n_cpu" setting for training is changed from "f0 extraction" to "data preprocessing and f0 extraction"
|
24 |
+
- Automatically detect the index paths under the logs folder and provide a drop-down list function
|
25 |
+
- Add "Frequently Asked Questions and Answers" on the tab page (you can also refer to github RVC wiki)
|
26 |
+
- When inference, harvest pitch is cached when using same input audio path (purpose: using harvest pitch extraction, the entire pipeline will go through a long and repetitive pitch extraction process. If caching is not used, users who experiment with different timbre, index, and pitch median filtering radius settings will experience a very painful waiting process after the first inference)
|
27 |
+
|
28 |
+
### 2023-05-14
|
29 |
+
- Use volume envelope of input to mix or replace the volume envelope of output (can alleviate the problem of "input muting and output small amplitude noise". If the input audio background noise is high, it is not recommended to turn it on, and it is not turned on by default (1 can be considered as not turned on)
|
30 |
+
- Support saving extracted small models at a specified frequency (if you want to see the performance under different epochs, but do not want to save all large checkpoints and manually extract small models by ckpt-processing every time, this feature will be very practical)
|
31 |
+
- Resolve the issue of "connection errors" caused by the server's global proxy by setting environment variables
|
32 |
+
- Supports pre-trained v2 models (currently only 40k versions are publicly available for testing, and the other two sampling rates have not been fully trained yet)
|
33 |
+
- Limit excessive volume exceeding 1 before inference
|
34 |
+
- Slightly adjusted the settings of training-set preprocessing
|
35 |
+
|
36 |
+
|
37 |
+
#######################
|
38 |
+
|
39 |
+
History changelogs:
|
40 |
+
|
41 |
+
### 2023-04-09
|
42 |
+
- Fixed training parameters to improve GPU utilization rate: A100 increased from 25% to around 90%, V100: 50% to around 90%, 2060S: 60% to around 85%, P40: 25% to around 95%; significantly improved training speed
|
43 |
+
- Changed parameter: total batch_size is now per GPU batch_size
|
44 |
+
- Changed total_epoch: maximum limit increased from 100 to 1000; default increased from 10 to 20
|
45 |
+
- Fixed issue of ckpt extraction recognizing pitch incorrectly, causing abnormal inference
|
46 |
+
- Fixed issue of distributed training saving ckpt for each rank
|
47 |
+
- Applied nan feature filtering for feature extraction
|
48 |
+
- Fixed issue with silent input/output producing random consonants or noise (old models need to retrain with a new dataset)
|
49 |
+
|
50 |
+
### 2023-04-16 Update
|
51 |
+
- Added local real-time voice changing mini-GUI, start by double-clicking go-realtime-gui.bat
|
52 |
+
- Applied filtering for frequency bands below 50Hz during training and inference
|
53 |
+
- Lowered the minimum pitch extraction of pyworld from the default 80 to 50 for training and inference, allowing male low-pitched voices between 50-80Hz not to be muted
|
54 |
+
- WebUI supports changing languages according to system locale (currently supporting en_US, ja_JP, zh_CN, zh_HK, zh_SG, zh_TW; defaults to en_US if not supported)
|
55 |
+
- Fixed recognition of some GPUs (e.g., V100-16G recognition failure, P4 recognition failure)
|
56 |
+
|
57 |
+
### 2023-04-28 Update
|
58 |
+
- Upgraded faiss index settings for faster speed and higher quality
|
59 |
+
- Removed dependency on total_npy; future model sharing will not require total_npy input
|
60 |
+
- Unlocked restrictions for the 16-series GPUs, providing 4GB inference settings for 4GB VRAM GPUs
|
61 |
+
- Fixed bug in UVR5 vocal accompaniment separation for certain audio formats
|
62 |
+
- Real-time voice changing mini-GUI now supports non-40k and non-lazy pitch models
|
63 |
+
|
64 |
+
### Future Plans:
|
65 |
+
Features:
|
66 |
+
- Add option: extract small models for each epoch save
|
67 |
+
- Add option: export additional mp3 to the specified path during inference
|
68 |
+
- Support multi-person training tab (up to 4 people)
|
69 |
+
|
70 |
+
Base model:
|
71 |
+
- Collect breathing wav files to add to the training dataset to fix the issue of distorted breath sounds
|
72 |
+
- We are currently training a base model with an extended singing dataset, which will be released in the future
|
Changelog_KO.md
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### 2023년 5월 28일 업데이트
|
2 |
+
|
3 |
+
- v2 jupyter notebook 추가, 한국어 업데이트 로그 추가, 의존성 모듈 일부 수정.
|
4 |
+
- 무성음 및 숨소리 보호 모드 추가.
|
5 |
+
- crepe-full pitch 감지 지원.
|
6 |
+
- UVR5 보컬 분리: 디버브 및 디-에코 모델 지원.
|
7 |
+
- index 이름에 experiment 이름과 버전 추가.
|
8 |
+
- 배치 음성 변환 처리 및 UVR5 보컬 분리 시, 사용자가 수동으로 출력 오디오의 내보내기(export) 형식을 선택할 수 있도록 지원.
|
9 |
+
- 32k 훈련 모델 지원 종료.
|
10 |
+
|
11 |
+
추후 업데이트 목록:
|
12 |
+
|
13 |
+
- 특징 검색: 시간적 특징 검색 추가.
|
14 |
+
- 특징 검색: pre-kmeans 옵션 추가.
|
15 |
+
- 특징 검색: PCAR 차원 축소 추가.
|
16 |
+
- onnx 추론 지원 추가.
|
17 |
+
- 학습 시 랜덤 데이터 증강: 음고, 성별, eq, 잡음.
|
18 |
+
- v2 버전 사전 훈련된 모델 추가.
|
19 |
+
|
20 |
+
### 2023년 5월 13일 업데이트
|
21 |
+
|
22 |
+
- 원클릭 패키지의 이전 버전 런타임 내, 불필요한 코드(infer_pack 및 uvr5_pack) 제거.
|
23 |
+
- 훈련 세트 전처리의 유사 다중 처리 버그 수정.
|
24 |
+
- Harvest 피치 인식 알고리즘에 대한 중위수 필터링 반경 조정 추가.
|
25 |
+
- 오디오 내보낼 때, 후처리 리샘플링 지원.
|
26 |
+
- 훈련에 대한 다중 처리 "n_cpu" 설정이 "f0 추출"에서 "데이터 전처리 및 f0 추출"로 변경.
|
27 |
+
- logs 폴더 하의 인덱스 경로를 자동으로 감지 및 드롭다운 목록 기능 제공.
|
28 |
+
- 탭 페이지에 "자주 묻는 질문과 답변" 추가. (github RVC wiki 참조 가능)
|
29 |
+
- 동일한 입력 오디오 경로를 사용할 때 추론, Harvest 피치를 캐시.
|
30 |
+
(주의: Harvest 피치 추출을 사용하면 전체 파이프라인은 길고 반복적인 피치 추출 과정을 거치게됩니다. 캐싱을 하지 않는다면, 첫 inference 이후의 단계에서 timbre, 인덱스, 피치 중위수 필터링 반경 설정 등 대기시간이 엄청나게 길어집니다!)
|
31 |
+
|
32 |
+
### 2023년 5월 14일 업데이트
|
33 |
+
|
34 |
+
- 입력의 볼륨 캡슐을 사용하여 출력의 볼륨 캡슐을 혼합하거나 대체. (입력이 무음이거나 출력의 노이즈 문제를 최소화 할 수 있습니다. 입력 오디오의 배경 노이즈(소음)가 큰 경우 해당 기능을 사용하지 않는 것이 좋습니다. 기본적으로 비활성화 되어있는 옵션입니다. (1: 비활성화 상태))
|
35 |
+
- 추출된 소형 모델을 지정된 빈도로 저장하는 기능을 지원. (다양한 에폭 하에서의 성능을 보려고 하지만 모든 대형 체크포인트를 저장하고 매번 ckpt 처리를 통해 소형 모델을 수동으로 추출하고 싶지 않은 경우 이 기능은 매우 유용합니다)
|
36 |
+
- 환경 변수를 설정하여 서버의 전역 프록시로 인한 "연결 오류" 문제 해결.
|
37 |
+
- 사전 훈련된 v2 모델 지원. (현재 40k 버전만 테스트를 위해 공개적으로 사용 가능하며, 다른 두 개의 샘플링 비율은 아직 완전히 훈련되지 않아 보류되었습니다.)
|
38 |
+
- 추론 전, 1을 초과하는 과도한 볼륨 제한.
|
39 |
+
- 데이터 전처리 매개변수 미세 조정.
|
40 |
+
|
41 |
+
### 2023년 4월 9일 업데이트
|
42 |
+
|
43 |
+
- GPU 이용률 향상을 위해 훈련 파라미터 수정: A100은 25%에서 약 90%로 증가, V100: 50%에서 약 90%로 증가, 2060S: 60%에서 약 85%로 증가, P40: 25%에서 약 95%로 증가.
|
44 |
+
훈련 속도가 크게 향상.
|
45 |
+
- 매개변수 기준 변경: total batch_size는 GPU당 batch_size를 의미.
|
46 |
+
- total_epoch 변경: 최대 한도가 100에서 1000으로 증가. 기본값이 10에서 20으로 증가.
|
47 |
+
- ckpt 추출이 피치를 잘못 인식하여 비정상적인 추론을 유발하는 문제 수정.
|
48 |
+
- 분산 훈련 과정에서 각 랭크마다 ckpt를 저장하는 문제 수정.
|
49 |
+
- 특성 추출 과정에 나노 특성 필터링 적용.
|
50 |
+
- 무음 입력/출력이 랜덤하게 소음을 생성하는 문제 수정. (이전 모델은 새 데이터셋으로 다시 훈련해야 합니다)
|
51 |
+
|
52 |
+
### 2023년 4월 16일 업데이트
|
53 |
+
|
54 |
+
- 로컬 실시간 음성 변경 미니-GUI 추가, go-realtime-gui.bat를 더블 클릭하여 시작.
|
55 |
+
- 훈련 및 추론 중 50Hz 이하의 주파수 대역에 대해 필터링 적용.
|
56 |
+
- 훈련 및 추론의 pyworld 최소 피치 추출을 기본 80에서 50으로 낮춤. 이로 인해, 50-80Hz 사이의 남성 저음이 무음화되지 않습니다.
|
57 |
+
- 시스템 지역에 따른 WebUI 언어 변경 지원. (현재 en_US, ja_JP, zh_CN, zh_HK, zh_SG, zh_TW를 지원하며, 지원되지 않는 경우 기본값은 en_US)
|
58 |
+
- 일부 GPU의 인식 수정. (예: V100-16G 인식 실패, P4 인식 실패)
|
59 |
+
|
60 |
+
### 2023년 4월 28일 업데이트
|
61 |
+
|
62 |
+
- Faiss 인덱스 설정 업그레이드로 속도가 더 빨라지고 품질이 향상.
|
63 |
+
- total_npy에 대한 의존성 제거. 추후의 모델 공유는 total_npy 입력을 필요로 하지 않습니다.
|
64 |
+
- 16 시리즈 GPU에 대한 제한 해제, 4GB VRAM GPU에 대한 4GB 추론 설정 제공.
|
65 |
+
- 일부 오디오 형식에 대한 UVR5 보컬 동반 분리에서의 버그 수정.
|
66 |
+
- 실시간 음성 변경 미니-GUI는 이제 non-40k 및 non-lazy 피치 모델을 지원합니다.
|
67 |
+
|
68 |
+
### 추후 계획
|
69 |
+
|
70 |
+
Features:
|
71 |
+
|
72 |
+
- 다중 사용자 훈련 탭 지원.(최대 4명)
|
73 |
+
|
74 |
+
Base model:
|
75 |
+
|
76 |
+
- 훈련 데이터셋에 숨소리 wav 파일을 추가하여, 보컬의 호흡이 노이즈로 변환되는 문제 수정.
|
77 |
+
- 보컬 훈련 세트의 기본 모델을 추가하기 위한 작업을 진행중이며, 이는 향후에 발표될 예정.
|
Dockerfile
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# syntax=docker/dockerfile:1
|
2 |
+
|
3 |
+
FROM python:3.10-bullseye
|
4 |
+
|
5 |
+
EXPOSE 7865
|
6 |
+
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
COPY . .
|
10 |
+
|
11 |
+
RUN pip3 install -r requirements.txt
|
12 |
+
|
13 |
+
CMD ["python3", "infer-web.py"]
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2023 liujing04
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
MDXNet.py
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import soundfile as sf
|
2 |
+
import torch, pdb, time, argparse, os, warnings, sys, librosa
|
3 |
+
import numpy as np
|
4 |
+
import onnxruntime as ort
|
5 |
+
from scipy.io.wavfile import write
|
6 |
+
from tqdm import tqdm
|
7 |
+
import torch
|
8 |
+
import torch.nn as nn
|
9 |
+
|
10 |
+
dim_c = 4
|
11 |
+
|
12 |
+
|
13 |
+
class Conv_TDF_net_trim:
|
14 |
+
def __init__(
|
15 |
+
self, device, model_name, target_name, L, dim_f, dim_t, n_fft, hop=1024
|
16 |
+
):
|
17 |
+
super(Conv_TDF_net_trim, self).__init__()
|
18 |
+
|
19 |
+
self.dim_f = dim_f
|
20 |
+
self.dim_t = 2**dim_t
|
21 |
+
self.n_fft = n_fft
|
22 |
+
self.hop = hop
|
23 |
+
self.n_bins = self.n_fft // 2 + 1
|
24 |
+
self.chunk_size = hop * (self.dim_t - 1)
|
25 |
+
self.window = torch.hann_window(window_length=self.n_fft, periodic=True).to(
|
26 |
+
device
|
27 |
+
)
|
28 |
+
self.target_name = target_name
|
29 |
+
self.blender = "blender" in model_name
|
30 |
+
|
31 |
+
out_c = dim_c * 4 if target_name == "*" else dim_c
|
32 |
+
self.freq_pad = torch.zeros(
|
33 |
+
[1, out_c, self.n_bins - self.dim_f, self.dim_t]
|
34 |
+
).to(device)
|
35 |
+
|
36 |
+
self.n = L // 2
|
37 |
+
|
38 |
+
def stft(self, x):
|
39 |
+
x = x.reshape([-1, self.chunk_size])
|
40 |
+
x = torch.stft(
|
41 |
+
x,
|
42 |
+
n_fft=self.n_fft,
|
43 |
+
hop_length=self.hop,
|
44 |
+
window=self.window,
|
45 |
+
center=True,
|
46 |
+
return_complex=True,
|
47 |
+
)
|
48 |
+
x = torch.view_as_real(x)
|
49 |
+
x = x.permute([0, 3, 1, 2])
|
50 |
+
x = x.reshape([-1, 2, 2, self.n_bins, self.dim_t]).reshape(
|
51 |
+
[-1, dim_c, self.n_bins, self.dim_t]
|
52 |
+
)
|
53 |
+
return x[:, :, : self.dim_f]
|
54 |
+
|
55 |
+
def istft(self, x, freq_pad=None):
|
56 |
+
freq_pad = (
|
57 |
+
self.freq_pad.repeat([x.shape[0], 1, 1, 1])
|
58 |
+
if freq_pad is None
|
59 |
+
else freq_pad
|
60 |
+
)
|
61 |
+
x = torch.cat([x, freq_pad], -2)
|
62 |
+
c = 4 * 2 if self.target_name == "*" else 2
|
63 |
+
x = x.reshape([-1, c, 2, self.n_bins, self.dim_t]).reshape(
|
64 |
+
[-1, 2, self.n_bins, self.dim_t]
|
65 |
+
)
|
66 |
+
x = x.permute([0, 2, 3, 1])
|
67 |
+
x = x.contiguous()
|
68 |
+
x = torch.view_as_complex(x)
|
69 |
+
x = torch.istft(
|
70 |
+
x, n_fft=self.n_fft, hop_length=self.hop, window=self.window, center=True
|
71 |
+
)
|
72 |
+
return x.reshape([-1, c, self.chunk_size])
|
73 |
+
|
74 |
+
|
75 |
+
def get_models(device, dim_f, dim_t, n_fft):
|
76 |
+
return Conv_TDF_net_trim(
|
77 |
+
device=device,
|
78 |
+
model_name="Conv-TDF",
|
79 |
+
target_name="vocals",
|
80 |
+
L=11,
|
81 |
+
dim_f=dim_f,
|
82 |
+
dim_t=dim_t,
|
83 |
+
n_fft=n_fft,
|
84 |
+
)
|
85 |
+
|
86 |
+
|
87 |
+
warnings.filterwarnings("ignore")
|
88 |
+
cpu = torch.device("cpu")
|
89 |
+
if torch.cuda.is_available():
|
90 |
+
device = torch.device("cuda:0")
|
91 |
+
elif torch.backends.mps.is_available():
|
92 |
+
device = torch.device("mps")
|
93 |
+
else:
|
94 |
+
device = torch.device("cpu")
|
95 |
+
|
96 |
+
|
97 |
+
class Predictor:
|
98 |
+
def __init__(self, args):
|
99 |
+
self.args = args
|
100 |
+
self.model_ = get_models(
|
101 |
+
device=cpu, dim_f=args.dim_f, dim_t=args.dim_t, n_fft=args.n_fft
|
102 |
+
)
|
103 |
+
self.model = ort.InferenceSession(
|
104 |
+
os.path.join(args.onnx, self.model_.target_name + ".onnx"),
|
105 |
+
providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
|
106 |
+
)
|
107 |
+
print("onnx load done")
|
108 |
+
|
109 |
+
def demix(self, mix):
|
110 |
+
samples = mix.shape[-1]
|
111 |
+
margin = self.args.margin
|
112 |
+
chunk_size = self.args.chunks * 44100
|
113 |
+
assert not margin == 0, "margin cannot be zero!"
|
114 |
+
if margin > chunk_size:
|
115 |
+
margin = chunk_size
|
116 |
+
|
117 |
+
segmented_mix = {}
|
118 |
+
|
119 |
+
if self.args.chunks == 0 or samples < chunk_size:
|
120 |
+
chunk_size = samples
|
121 |
+
|
122 |
+
counter = -1
|
123 |
+
for skip in range(0, samples, chunk_size):
|
124 |
+
counter += 1
|
125 |
+
|
126 |
+
s_margin = 0 if counter == 0 else margin
|
127 |
+
end = min(skip + chunk_size + margin, samples)
|
128 |
+
|
129 |
+
start = skip - s_margin
|
130 |
+
|
131 |
+
segmented_mix[skip] = mix[:, start:end].copy()
|
132 |
+
if end == samples:
|
133 |
+
break
|
134 |
+
|
135 |
+
sources = self.demix_base(segmented_mix, margin_size=margin)
|
136 |
+
"""
|
137 |
+
mix:(2,big_sample)
|
138 |
+
segmented_mix:offset->(2,small_sample)
|
139 |
+
sources:(1,2,big_sample)
|
140 |
+
"""
|
141 |
+
return sources
|
142 |
+
|
143 |
+
def demix_base(self, mixes, margin_size):
|
144 |
+
chunked_sources = []
|
145 |
+
progress_bar = tqdm(total=len(mixes))
|
146 |
+
progress_bar.set_description("Processing")
|
147 |
+
for mix in mixes:
|
148 |
+
cmix = mixes[mix]
|
149 |
+
sources = []
|
150 |
+
n_sample = cmix.shape[1]
|
151 |
+
model = self.model_
|
152 |
+
trim = model.n_fft // 2
|
153 |
+
gen_size = model.chunk_size - 2 * trim
|
154 |
+
pad = gen_size - n_sample % gen_size
|
155 |
+
mix_p = np.concatenate(
|
156 |
+
(np.zeros((2, trim)), cmix, np.zeros((2, pad)), np.zeros((2, trim))), 1
|
157 |
+
)
|
158 |
+
mix_waves = []
|
159 |
+
i = 0
|
160 |
+
while i < n_sample + pad:
|
161 |
+
waves = np.array(mix_p[:, i : i + model.chunk_size])
|
162 |
+
mix_waves.append(waves)
|
163 |
+
i += gen_size
|
164 |
+
mix_waves = torch.tensor(mix_waves, dtype=torch.float32).to(cpu)
|
165 |
+
with torch.no_grad():
|
166 |
+
_ort = self.model
|
167 |
+
spek = model.stft(mix_waves)
|
168 |
+
if self.args.denoise:
|
169 |
+
spec_pred = (
|
170 |
+
-_ort.run(None, {"input": -spek.cpu().numpy()})[0] * 0.5
|
171 |
+
+ _ort.run(None, {"input": spek.cpu().numpy()})[0] * 0.5
|
172 |
+
)
|
173 |
+
tar_waves = model.istft(torch.tensor(spec_pred))
|
174 |
+
else:
|
175 |
+
tar_waves = model.istft(
|
176 |
+
torch.tensor(_ort.run(None, {"input": spek.cpu().numpy()})[0])
|
177 |
+
)
|
178 |
+
tar_signal = (
|
179 |
+
tar_waves[:, :, trim:-trim]
|
180 |
+
.transpose(0, 1)
|
181 |
+
.reshape(2, -1)
|
182 |
+
.numpy()[:, :-pad]
|
183 |
+
)
|
184 |
+
|
185 |
+
start = 0 if mix == 0 else margin_size
|
186 |
+
end = None if mix == list(mixes.keys())[::-1][0] else -margin_size
|
187 |
+
if margin_size == 0:
|
188 |
+
end = None
|
189 |
+
sources.append(tar_signal[:, start:end])
|
190 |
+
|
191 |
+
progress_bar.update(1)
|
192 |
+
|
193 |
+
chunked_sources.append(sources)
|
194 |
+
_sources = np.concatenate(chunked_sources, axis=-1)
|
195 |
+
# del self.model
|
196 |
+
progress_bar.close()
|
197 |
+
return _sources
|
198 |
+
|
199 |
+
def prediction(self, m, vocal_root, others_root, format):
|
200 |
+
os.makedirs(vocal_root, exist_ok=True)
|
201 |
+
os.makedirs(others_root, exist_ok=True)
|
202 |
+
basename = os.path.basename(m)
|
203 |
+
mix, rate = librosa.load(m, mono=False, sr=44100)
|
204 |
+
if mix.ndim == 1:
|
205 |
+
mix = np.asfortranarray([mix, mix])
|
206 |
+
mix = mix.T
|
207 |
+
sources = self.demix(mix.T)
|
208 |
+
opt = sources[0].T
|
209 |
+
if format in ["wav", "flac"]:
|
210 |
+
sf.write(
|
211 |
+
"%s/%s_main_vocal.%s" % (vocal_root, basename, format), mix - opt, rate
|
212 |
+
)
|
213 |
+
sf.write("%s/%s_others.%s" % (others_root, basename, format), opt, rate)
|
214 |
+
else:
|
215 |
+
path_vocal = "%s/%s_main_vocal.wav" % (vocal_root, basename)
|
216 |
+
path_other = "%s/%s_others.wav" % (others_root, basename)
|
217 |
+
sf.write(path_vocal, mix - opt, rate)
|
218 |
+
sf.write(path_other, opt, rate)
|
219 |
+
if os.path.exists(path_vocal):
|
220 |
+
os.system(
|
221 |
+
"ffmpeg -i %s -vn %s -q:a 2 -y"
|
222 |
+
% (path_vocal, path_vocal[:-4] + ".%s" % format)
|
223 |
+
)
|
224 |
+
if os.path.exists(path_other):
|
225 |
+
os.system(
|
226 |
+
"ffmpeg -i %s -vn %s -q:a 2 -y"
|
227 |
+
% (path_other, path_other[:-4] + ".%s" % format)
|
228 |
+
)
|
229 |
+
|
230 |
+
|
231 |
+
class MDXNetDereverb:
|
232 |
+
def __init__(self, chunks):
|
233 |
+
self.onnx = "uvr5_weights/onnx_dereverb_By_FoxJoy"
|
234 |
+
self.shifts = 10 #'Predict with randomised equivariant stabilisation'
|
235 |
+
self.mixing = "min_mag" # ['default','min_mag','max_mag']
|
236 |
+
self.chunks = chunks
|
237 |
+
self.margin = 44100
|
238 |
+
self.dim_t = 9
|
239 |
+
self.dim_f = 3072
|
240 |
+
self.n_fft = 6144
|
241 |
+
self.denoise = True
|
242 |
+
self.pred = Predictor(self)
|
243 |
+
|
244 |
+
def _path_audio_(self, input, vocal_root, others_root, format):
|
245 |
+
self.pred.prediction(input, vocal_root, others_root, format)
|
246 |
+
|
247 |
+
|
248 |
+
if __name__ == "__main__":
|
249 |
+
dereverb = MDXNetDereverb(15)
|
250 |
+
from time import time as ttime
|
251 |
+
|
252 |
+
t0 = ttime()
|
253 |
+
dereverb._path_audio_(
|
254 |
+
"雪雪伴奏对消HP5.wav",
|
255 |
+
"vocal",
|
256 |
+
"others",
|
257 |
+
)
|
258 |
+
t1 = ttime()
|
259 |
+
print(t1 - t0)
|
260 |
+
|
261 |
+
|
262 |
+
"""
|
263 |
+
|
264 |
+
runtime\python.exe MDXNet.py
|
265 |
+
|
266 |
+
6G:
|
267 |
+
15/9:0.8G->6.8G
|
268 |
+
14:0.8G->6.5G
|
269 |
+
25:炸
|
270 |
+
|
271 |
+
half15:0.7G->6.6G,22.69s
|
272 |
+
fp32-15:0.7G->6.6G,20.85s
|
273 |
+
|
274 |
+
"""
|
README.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Vocal2guitar
|
3 |
+
emoji: 🏃
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: red
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.34.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: mit
|
11 |
+
duplicated_from: lj1995/vocal2guitar
|
12 |
+
---
|
13 |
+
|
14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
Retrieval_based_Voice_Conversion_WebUI.ipynb
ADDED
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"nbformat": 4,
|
3 |
+
"nbformat_minor": 0,
|
4 |
+
"metadata": {
|
5 |
+
"colab": {
|
6 |
+
"private_outputs": true,
|
7 |
+
"provenance": []
|
8 |
+
},
|
9 |
+
"kernelspec": {
|
10 |
+
"name": "python3",
|
11 |
+
"display_name": "Python 3"
|
12 |
+
},
|
13 |
+
"language_info": {
|
14 |
+
"name": "python"
|
15 |
+
},
|
16 |
+
"accelerator": "GPU",
|
17 |
+
"gpuClass": "standard"
|
18 |
+
},
|
19 |
+
"cells": [
|
20 |
+
{
|
21 |
+
"cell_type": "markdown",
|
22 |
+
"source": [
|
23 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI.ipynb)"
|
24 |
+
],
|
25 |
+
"metadata": {
|
26 |
+
"id": "ZFFCx5J80SGa"
|
27 |
+
}
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"cell_type": "code",
|
31 |
+
"execution_count": null,
|
32 |
+
"metadata": {
|
33 |
+
"id": "GmFP6bN9dvOq"
|
34 |
+
},
|
35 |
+
"outputs": [],
|
36 |
+
"source": [
|
37 |
+
"#@title 查看显卡\n",
|
38 |
+
"!nvidia-smi"
|
39 |
+
]
|
40 |
+
},
|
41 |
+
{
|
42 |
+
"cell_type": "code",
|
43 |
+
"source": [
|
44 |
+
"#@title 安装依赖\n",
|
45 |
+
"!apt-get -y install build-essential python3-dev ffmpeg\n",
|
46 |
+
"!pip3 install --upgrade setuptools wheel\n",
|
47 |
+
"!pip3 install --upgrade pip\n",
|
48 |
+
"!pip3 install faiss-gpu fairseq gradio ffmpeg ffmpeg-python praat-parselmouth pyworld numpy==1.23.5 numba==0.56.4 librosa==0.9.2"
|
49 |
+
],
|
50 |
+
"metadata": {
|
51 |
+
"id": "wjddIFr1oS3W"
|
52 |
+
},
|
53 |
+
"execution_count": null,
|
54 |
+
"outputs": []
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"cell_type": "code",
|
58 |
+
"source": [
|
59 |
+
"#@title 克隆仓库\n",
|
60 |
+
"\n",
|
61 |
+
"!git clone --depth=1 -b stable https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI\n",
|
62 |
+
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
63 |
+
"!mkdir -p pretrained uvr5_weights"
|
64 |
+
],
|
65 |
+
"metadata": {
|
66 |
+
"id": "ge_97mfpgqTm"
|
67 |
+
},
|
68 |
+
"execution_count": null,
|
69 |
+
"outputs": []
|
70 |
+
},
|
71 |
+
{
|
72 |
+
"cell_type": "code",
|
73 |
+
"source": [
|
74 |
+
"#@title 更新仓库(一般无需执行)\n",
|
75 |
+
"!git pull"
|
76 |
+
],
|
77 |
+
"metadata": {
|
78 |
+
"id": "BLDEZADkvlw1"
|
79 |
+
},
|
80 |
+
"execution_count": null,
|
81 |
+
"outputs": []
|
82 |
+
},
|
83 |
+
{
|
84 |
+
"cell_type": "code",
|
85 |
+
"source": [
|
86 |
+
"#@title 安装aria2\n",
|
87 |
+
"!apt -y install -qq aria2"
|
88 |
+
],
|
89 |
+
"metadata": {
|
90 |
+
"id": "pqE0PrnuRqI2"
|
91 |
+
},
|
92 |
+
"execution_count": null,
|
93 |
+
"outputs": []
|
94 |
+
},
|
95 |
+
{
|
96 |
+
"cell_type": "code",
|
97 |
+
"source": [
|
98 |
+
"#@title 下载底模\n",
|
99 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D32k.pth\n",
|
100 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D40k.pth\n",
|
101 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D48k.pth\n",
|
102 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o G32k.pth\n",
|
103 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o G40k.pth\n",
|
104 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o G48k.pth\n",
|
105 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0D32k.pth\n",
|
106 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0D40k.pth\n",
|
107 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0D48k.pth\n",
|
108 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0G32k.pth\n",
|
109 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0G40k.pth\n",
|
110 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0G48k.pth"
|
111 |
+
],
|
112 |
+
"metadata": {
|
113 |
+
"id": "UG3XpUwEomUz"
|
114 |
+
},
|
115 |
+
"execution_count": null,
|
116 |
+
"outputs": []
|
117 |
+
},
|
118 |
+
{
|
119 |
+
"cell_type": "code",
|
120 |
+
"source": [
|
121 |
+
"#@title 下载人声分离模型\n",
|
122 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2-人声vocals+非人声instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP2-人声vocals+非人声instrumentals.pth\n",
|
123 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5-主旋律人声vocals+其他instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP5-主旋律人声vocals+其他instrumentals.pth"
|
124 |
+
],
|
125 |
+
"metadata": {
|
126 |
+
"id": "HugjmZqZRuiF"
|
127 |
+
},
|
128 |
+
"execution_count": null,
|
129 |
+
"outputs": []
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"cell_type": "code",
|
133 |
+
"source": [
|
134 |
+
"#@title 下载hubert_base\n",
|
135 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d /content/Retrieval-based-Voice-Conversion-WebUI -o hubert_base.pt"
|
136 |
+
],
|
137 |
+
"metadata": {
|
138 |
+
"id": "2RCaT9FTR0ej"
|
139 |
+
},
|
140 |
+
"execution_count": null,
|
141 |
+
"outputs": []
|
142 |
+
},
|
143 |
+
{
|
144 |
+
"cell_type": "code",
|
145 |
+
"source": [
|
146 |
+
"#@title 挂载谷歌云盘\n",
|
147 |
+
"\n",
|
148 |
+
"from google.colab import drive\n",
|
149 |
+
"drive.mount('/content/drive')"
|
150 |
+
],
|
151 |
+
"metadata": {
|
152 |
+
"id": "jwu07JgqoFON"
|
153 |
+
},
|
154 |
+
"execution_count": null,
|
155 |
+
"outputs": []
|
156 |
+
},
|
157 |
+
{
|
158 |
+
"cell_type": "code",
|
159 |
+
"source": [
|
160 |
+
"#@title 从谷歌云盘加载打包好的数据集到/content/dataset\n",
|
161 |
+
"\n",
|
162 |
+
"#@markdown 数据集位置\n",
|
163 |
+
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n",
|
164 |
+
"\n",
|
165 |
+
"!mkdir -p /content/dataset\n",
|
166 |
+
"!unzip -d /content/dataset -B {DATASET}"
|
167 |
+
],
|
168 |
+
"metadata": {
|
169 |
+
"id": "Mwk7Q0Loqzjx"
|
170 |
+
},
|
171 |
+
"execution_count": null,
|
172 |
+
"outputs": []
|
173 |
+
},
|
174 |
+
{
|
175 |
+
"cell_type": "code",
|
176 |
+
"source": [
|
177 |
+
"#@title 重命名数据集中的重名文件\n",
|
178 |
+
"!ls -a /content/dataset/\n",
|
179 |
+
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
180 |
+
],
|
181 |
+
"metadata": {
|
182 |
+
"id": "PDlFxWHWEynD"
|
183 |
+
},
|
184 |
+
"execution_count": null,
|
185 |
+
"outputs": []
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"cell_type": "code",
|
189 |
+
"source": [
|
190 |
+
"#@title 启动web\n",
|
191 |
+
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
192 |
+
"# %load_ext tensorboard\n",
|
193 |
+
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
194 |
+
"!python3 infer-web.py --colab --pycmd python3"
|
195 |
+
],
|
196 |
+
"metadata": {
|
197 |
+
"id": "7vh6vphDwO0b"
|
198 |
+
},
|
199 |
+
"execution_count": null,
|
200 |
+
"outputs": []
|
201 |
+
},
|
202 |
+
{
|
203 |
+
"cell_type": "code",
|
204 |
+
"source": [
|
205 |
+
"#@title 手动将训练后的模型文件备份到谷歌云盘\n",
|
206 |
+
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
207 |
+
"\n",
|
208 |
+
"#@markdown 模型名\n",
|
209 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
210 |
+
"#@markdown 模型epoch\n",
|
211 |
+
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
212 |
+
"\n",
|
213 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
214 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
215 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/added_*.index /content/drive/MyDrive/\n",
|
216 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/total_*.npy /content/drive/MyDrive/\n",
|
217 |
+
"\n",
|
218 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth"
|
219 |
+
],
|
220 |
+
"metadata": {
|
221 |
+
"id": "FgJuNeAwx5Y_"
|
222 |
+
},
|
223 |
+
"execution_count": null,
|
224 |
+
"outputs": []
|
225 |
+
},
|
226 |
+
{
|
227 |
+
"cell_type": "code",
|
228 |
+
"source": [
|
229 |
+
"#@title 从谷歌云盘恢复pth\n",
|
230 |
+
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
231 |
+
"\n",
|
232 |
+
"#@markdown 模型名\n",
|
233 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
234 |
+
"#@markdown 模型epoch\n",
|
235 |
+
"MODELEPOCH = 7500 #@param {type:\"integer\"}\n",
|
236 |
+
"\n",
|
237 |
+
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
238 |
+
"\n",
|
239 |
+
"!cp /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
240 |
+
"!cp /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
241 |
+
"!cp /content/drive/MyDrive/*.index /content/\n",
|
242 |
+
"!cp /content/drive/MyDrive/*.npy /content/\n",
|
243 |
+
"!cp /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth"
|
244 |
+
],
|
245 |
+
"metadata": {
|
246 |
+
"id": "OVQoLQJXS7WX"
|
247 |
+
},
|
248 |
+
"execution_count": null,
|
249 |
+
"outputs": []
|
250 |
+
},
|
251 |
+
{
|
252 |
+
"cell_type": "code",
|
253 |
+
"source": [
|
254 |
+
"#@title 手动预处理(不推荐)\n",
|
255 |
+
"#@markdown 模型名\n",
|
256 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
257 |
+
"#@markdown 采样率\n",
|
258 |
+
"BITRATE = 48000 #@param {type:\"integer\"}\n",
|
259 |
+
"#@markdown 使用的进程数\n",
|
260 |
+
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
261 |
+
"\n",
|
262 |
+
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n"
|
263 |
+
],
|
264 |
+
"metadata": {
|
265 |
+
"id": "ZKAyuKb9J6dz"
|
266 |
+
},
|
267 |
+
"execution_count": null,
|
268 |
+
"outputs": []
|
269 |
+
},
|
270 |
+
{
|
271 |
+
"cell_type": "code",
|
272 |
+
"source": [
|
273 |
+
"#@title 手动提取特征(不推荐)\n",
|
274 |
+
"#@markdown 模型名\n",
|
275 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
276 |
+
"#@markdown 使用的进程数\n",
|
277 |
+
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
278 |
+
"#@markdown 音高提取算法\n",
|
279 |
+
"ALGO = \"harvest\" #@param {type:\"string\"}\n",
|
280 |
+
"\n",
|
281 |
+
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
282 |
+
"\n",
|
283 |
+
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}\n"
|
284 |
+
],
|
285 |
+
"metadata": {
|
286 |
+
"id": "CrxJqzAUKmPJ"
|
287 |
+
},
|
288 |
+
"execution_count": null,
|
289 |
+
"outputs": []
|
290 |
+
},
|
291 |
+
{
|
292 |
+
"cell_type": "code",
|
293 |
+
"source": [
|
294 |
+
"#@title 手动训练(不推荐)\n",
|
295 |
+
"#@markdown 模型名\n",
|
296 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
297 |
+
"#@markdown 使用的GPU\n",
|
298 |
+
"USEGPU = \"0\" #@param {type:\"string\"}\n",
|
299 |
+
"#@markdown 批大小\n",
|
300 |
+
"BATCHSIZE = 32 #@param {type:\"integer\"}\n",
|
301 |
+
"#@markdown 停止的epoch\n",
|
302 |
+
"MODELEPOCH = 3200 #@param {type:\"integer\"}\n",
|
303 |
+
"#@markdown 保存epoch间隔\n",
|
304 |
+
"EPOCHSAVE = 100 #@param {type:\"integer\"}\n",
|
305 |
+
"#@markdown 采样率\n",
|
306 |
+
"MODELSAMPLE = \"48k\" #@param {type:\"string\"}\n",
|
307 |
+
"#@markdown 是否缓存训练集\n",
|
308 |
+
"CACHEDATA = 1 #@param {type:\"integer\"}\n",
|
309 |
+
"#@markdown 是否仅保存最新的ckpt文件\n",
|
310 |
+
"ONLYLATEST = 0 #@param {type:\"integer\"}\n",
|
311 |
+
"\n",
|
312 |
+
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}\n"
|
313 |
+
],
|
314 |
+
"metadata": {
|
315 |
+
"id": "IMLPLKOaKj58"
|
316 |
+
},
|
317 |
+
"execution_count": null,
|
318 |
+
"outputs": []
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"cell_type": "code",
|
322 |
+
"source": [
|
323 |
+
"#@title 删除其它pth,只留选中的(慎点,仔细看代码)\n",
|
324 |
+
"#@markdown 模型名\n",
|
325 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
326 |
+
"#@markdown 选中模型epoch\n",
|
327 |
+
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
328 |
+
"\n",
|
329 |
+
"!echo \"备份选中的模型。。。\"\n",
|
330 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
331 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
332 |
+
"\n",
|
333 |
+
"!echo \"正在删除。。。\"\n",
|
334 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
335 |
+
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
336 |
+
"\n",
|
337 |
+
"!echo \"恢复选中的模型。。。\"\n",
|
338 |
+
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
339 |
+
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
340 |
+
"\n",
|
341 |
+
"!echo \"删除完成\"\n",
|
342 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
343 |
+
],
|
344 |
+
"metadata": {
|
345 |
+
"id": "haYA81hySuDl"
|
346 |
+
},
|
347 |
+
"execution_count": null,
|
348 |
+
"outputs": []
|
349 |
+
},
|
350 |
+
{
|
351 |
+
"cell_type": "code",
|
352 |
+
"source": [
|
353 |
+
"#@title 清除项目���所有文件,只留选中的模型(慎点,仔细看代码)\n",
|
354 |
+
"#@markdown 模型名\n",
|
355 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
356 |
+
"#@markdown 选中模型epoch\n",
|
357 |
+
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
358 |
+
"\n",
|
359 |
+
"!echo \"备份选中的模型。。。\"\n",
|
360 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
361 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
362 |
+
"\n",
|
363 |
+
"!echo \"正在删除。。。\"\n",
|
364 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
365 |
+
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
366 |
+
"\n",
|
367 |
+
"!echo \"恢复选中的模型。。。\"\n",
|
368 |
+
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
369 |
+
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
370 |
+
"\n",
|
371 |
+
"!echo \"删除完成\"\n",
|
372 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
373 |
+
],
|
374 |
+
"metadata": {
|
375 |
+
"id": "QhSiPTVPoIRh"
|
376 |
+
},
|
377 |
+
"execution_count": null,
|
378 |
+
"outputs": []
|
379 |
+
}
|
380 |
+
]
|
381 |
+
}
|
Retrieval_based_Voice_Conversion_WebUI_v2.ipynb
ADDED
@@ -0,0 +1,401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"attachments": {},
|
5 |
+
"cell_type": "markdown",
|
6 |
+
"metadata": {
|
7 |
+
"id": "ZFFCx5J80SGa"
|
8 |
+
},
|
9 |
+
"source": [
|
10 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI_v2.ipynb)"
|
11 |
+
]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"cell_type": "code",
|
15 |
+
"execution_count": null,
|
16 |
+
"metadata": {
|
17 |
+
"id": "GmFP6bN9dvOq"
|
18 |
+
},
|
19 |
+
"outputs": [],
|
20 |
+
"source": [
|
21 |
+
"#@title 查看显卡\n",
|
22 |
+
"!nvidia-smi"
|
23 |
+
]
|
24 |
+
},
|
25 |
+
{
|
26 |
+
"cell_type": "code",
|
27 |
+
"execution_count": null,
|
28 |
+
"metadata": {
|
29 |
+
"id": "wjddIFr1oS3W"
|
30 |
+
},
|
31 |
+
"outputs": [],
|
32 |
+
"source": [
|
33 |
+
"#@title 安装依赖\n",
|
34 |
+
"!apt-get -y install build-essential python3-dev ffmpeg\n",
|
35 |
+
"!pip3 install --upgrade setuptools wheel\n",
|
36 |
+
"!pip3 install --upgrade pip\n",
|
37 |
+
"!pip3 install faiss-gpu fairseq gradio ffmpeg ffmpeg-python praat-parselmouth pyworld numpy==1.23.5 numba==0.56.4 librosa==0.9.2"
|
38 |
+
]
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"cell_type": "code",
|
42 |
+
"execution_count": null,
|
43 |
+
"metadata": {
|
44 |
+
"id": "ge_97mfpgqTm"
|
45 |
+
},
|
46 |
+
"outputs": [],
|
47 |
+
"source": [
|
48 |
+
"#@title 克隆仓库\n",
|
49 |
+
"\n",
|
50 |
+
"!mkdir Retrieval-based-Voice-Conversion-WebUI\n",
|
51 |
+
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
52 |
+
"!git init\n",
|
53 |
+
"!git remote add origin https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git\n",
|
54 |
+
"!git fetch origin cfd984812804ddc9247d65b14c82cd32e56c1133 --depth=1 \n",
|
55 |
+
"!git reset --hard FETCH_HEAD"
|
56 |
+
]
|
57 |
+
},
|
58 |
+
{
|
59 |
+
"cell_type": "code",
|
60 |
+
"execution_count": null,
|
61 |
+
"metadata": {
|
62 |
+
"id": "BLDEZADkvlw1"
|
63 |
+
},
|
64 |
+
"outputs": [],
|
65 |
+
"source": [
|
66 |
+
"#@title 更新仓库(一般无需执行)\n",
|
67 |
+
"!git pull"
|
68 |
+
]
|
69 |
+
},
|
70 |
+
{
|
71 |
+
"cell_type": "code",
|
72 |
+
"execution_count": null,
|
73 |
+
"metadata": {
|
74 |
+
"id": "pqE0PrnuRqI2"
|
75 |
+
},
|
76 |
+
"outputs": [],
|
77 |
+
"source": [
|
78 |
+
"#@title 安装aria2\n",
|
79 |
+
"!apt -y install -qq aria2"
|
80 |
+
]
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"cell_type": "code",
|
84 |
+
"execution_count": null,
|
85 |
+
"metadata": {
|
86 |
+
"id": "UG3XpUwEomUz"
|
87 |
+
},
|
88 |
+
"outputs": [],
|
89 |
+
"source": [
|
90 |
+
"#@title 下载底模\n",
|
91 |
+
"\n",
|
92 |
+
"# v1\n",
|
93 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D32k.pth\n",
|
94 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D40k.pth\n",
|
95 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o D48k.pth\n",
|
96 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o G32k.pth\n",
|
97 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o G40k.pth\n",
|
98 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o G48k.pth\n",
|
99 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0D32k.pth\n",
|
100 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0D40k.pth\n",
|
101 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0D48k.pth\n",
|
102 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0G32k.pth\n",
|
103 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0G40k.pth\n",
|
104 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained -o f0G48k.pth\n",
|
105 |
+
"\n",
|
106 |
+
"#v2\n",
|
107 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o D32k.pth\n",
|
108 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o D40k.pth\n",
|
109 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o D48k.pth\n",
|
110 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/G32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o G32k.pth\n",
|
111 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/G40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o G40k.pth\n",
|
112 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/G48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o G48k.pth\n",
|
113 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o f0D32k.pth\n",
|
114 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o f0D40k.pth\n",
|
115 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o f0D48k.pth\n",
|
116 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G32k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o f0G32k.pth\n",
|
117 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G40k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o f0G40k.pth\n",
|
118 |
+
"# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G48k.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/pretrained_v2 -o f0G48k.pth"
|
119 |
+
]
|
120 |
+
},
|
121 |
+
{
|
122 |
+
"cell_type": "code",
|
123 |
+
"execution_count": null,
|
124 |
+
"metadata": {
|
125 |
+
"id": "HugjmZqZRuiF"
|
126 |
+
},
|
127 |
+
"outputs": [],
|
128 |
+
"source": [
|
129 |
+
"#@title 下载人声分离模型\n",
|
130 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2-人声vocals+非人声instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP2-人声vocals+非人声instrumentals.pth\n",
|
131 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5-主旋律人声vocals+其他instrumentals.pth -d /content/Retrieval-based-Voice-Conversion-WebUI/uvr5_weights -o HP5-主旋律人声vocals+其他instrumentals.pth"
|
132 |
+
]
|
133 |
+
},
|
134 |
+
{
|
135 |
+
"cell_type": "code",
|
136 |
+
"execution_count": null,
|
137 |
+
"metadata": {
|
138 |
+
"id": "2RCaT9FTR0ej"
|
139 |
+
},
|
140 |
+
"outputs": [],
|
141 |
+
"source": [
|
142 |
+
"#@title 下载hubert_base\n",
|
143 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d /content/Retrieval-based-Voice-Conversion-WebUI -o hubert_base.pt"
|
144 |
+
]
|
145 |
+
},
|
146 |
+
{
|
147 |
+
"cell_type": "code",
|
148 |
+
"execution_count": null,
|
149 |
+
"metadata": {
|
150 |
+
"id": "jwu07JgqoFON"
|
151 |
+
},
|
152 |
+
"outputs": [],
|
153 |
+
"source": [
|
154 |
+
"#@title 挂载谷歌云盘\n",
|
155 |
+
"\n",
|
156 |
+
"from google.colab import drive\n",
|
157 |
+
"drive.mount('/content/drive')"
|
158 |
+
]
|
159 |
+
},
|
160 |
+
{
|
161 |
+
"cell_type": "code",
|
162 |
+
"execution_count": null,
|
163 |
+
"metadata": {
|
164 |
+
"id": "Mwk7Q0Loqzjx"
|
165 |
+
},
|
166 |
+
"outputs": [],
|
167 |
+
"source": [
|
168 |
+
"#@title 从谷歌云盘加载打包好的数据集到/content/dataset\n",
|
169 |
+
"\n",
|
170 |
+
"#@markdown 数据集位置\n",
|
171 |
+
"DATASET = \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" #@param {type:\"string\"}\n",
|
172 |
+
"\n",
|
173 |
+
"!mkdir -p /content/dataset\n",
|
174 |
+
"!unzip -d /content/dataset -B {DATASET}"
|
175 |
+
]
|
176 |
+
},
|
177 |
+
{
|
178 |
+
"cell_type": "code",
|
179 |
+
"execution_count": null,
|
180 |
+
"metadata": {
|
181 |
+
"id": "PDlFxWHWEynD"
|
182 |
+
},
|
183 |
+
"outputs": [],
|
184 |
+
"source": [
|
185 |
+
"#@title 重命名数据集中的重名文件\n",
|
186 |
+
"!ls -a /content/dataset/\n",
|
187 |
+
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
188 |
+
]
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"cell_type": "code",
|
192 |
+
"execution_count": null,
|
193 |
+
"metadata": {
|
194 |
+
"id": "7vh6vphDwO0b"
|
195 |
+
},
|
196 |
+
"outputs": [],
|
197 |
+
"source": [
|
198 |
+
"#@title 启动web\n",
|
199 |
+
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
200 |
+
"# %load_ext tensorboard\n",
|
201 |
+
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
202 |
+
"!python3 infer-web.py --colab --pycmd python3"
|
203 |
+
]
|
204 |
+
},
|
205 |
+
{
|
206 |
+
"cell_type": "code",
|
207 |
+
"execution_count": null,
|
208 |
+
"metadata": {
|
209 |
+
"id": "FgJuNeAwx5Y_"
|
210 |
+
},
|
211 |
+
"outputs": [],
|
212 |
+
"source": [
|
213 |
+
"#@title 手动将训练后的模型文件备份到谷歌云盘\n",
|
214 |
+
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
215 |
+
"\n",
|
216 |
+
"#@markdown 模型名\n",
|
217 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
218 |
+
"#@markdown 模型epoch\n",
|
219 |
+
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
220 |
+
"\n",
|
221 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
222 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
223 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/added_*.index /content/drive/MyDrive/\n",
|
224 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/total_*.npy /content/drive/MyDrive/\n",
|
225 |
+
"\n",
|
226 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth"
|
227 |
+
]
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"cell_type": "code",
|
231 |
+
"execution_count": null,
|
232 |
+
"metadata": {
|
233 |
+
"id": "OVQoLQJXS7WX"
|
234 |
+
},
|
235 |
+
"outputs": [],
|
236 |
+
"source": [
|
237 |
+
"#@title 从谷歌云盘恢复pth\n",
|
238 |
+
"#@markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
239 |
+
"\n",
|
240 |
+
"#@markdown 模型名\n",
|
241 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
242 |
+
"#@markdown 模型epoch\n",
|
243 |
+
"MODELEPOCH = 7500 #@param {type:\"integer\"}\n",
|
244 |
+
"\n",
|
245 |
+
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
246 |
+
"\n",
|
247 |
+
"!cp /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
248 |
+
"!cp /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
249 |
+
"!cp /content/drive/MyDrive/*.index /content/\n",
|
250 |
+
"!cp /content/drive/MyDrive/*.npy /content/\n",
|
251 |
+
"!cp /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth"
|
252 |
+
]
|
253 |
+
},
|
254 |
+
{
|
255 |
+
"cell_type": "code",
|
256 |
+
"execution_count": null,
|
257 |
+
"metadata": {
|
258 |
+
"id": "ZKAyuKb9J6dz"
|
259 |
+
},
|
260 |
+
"outputs": [],
|
261 |
+
"source": [
|
262 |
+
"#@title 手动预处理(不推荐)\n",
|
263 |
+
"#@markdown 模型名\n",
|
264 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
265 |
+
"#@markdown 采样率\n",
|
266 |
+
"BITRATE = 48000 #@param {type:\"integer\"}\n",
|
267 |
+
"#@markdown 使用的进程数\n",
|
268 |
+
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
269 |
+
"\n",
|
270 |
+
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True\n"
|
271 |
+
]
|
272 |
+
},
|
273 |
+
{
|
274 |
+
"cell_type": "code",
|
275 |
+
"execution_count": null,
|
276 |
+
"metadata": {
|
277 |
+
"id": "CrxJqzAUKmPJ"
|
278 |
+
},
|
279 |
+
"outputs": [],
|
280 |
+
"source": [
|
281 |
+
"#@title 手动提取特征(不推荐)\n",
|
282 |
+
"#@markdown 模型名\n",
|
283 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
284 |
+
"#@markdown 使用的进程数\n",
|
285 |
+
"THREADCOUNT = 8 #@param {type:\"integer\"}\n",
|
286 |
+
"#@markdown 音高提取算法\n",
|
287 |
+
"ALGO = \"harvest\" #@param {type:\"string\"}\n",
|
288 |
+
"\n",
|
289 |
+
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
290 |
+
"\n",
|
291 |
+
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}\n"
|
292 |
+
]
|
293 |
+
},
|
294 |
+
{
|
295 |
+
"cell_type": "code",
|
296 |
+
"execution_count": null,
|
297 |
+
"metadata": {
|
298 |
+
"id": "IMLPLKOaKj58"
|
299 |
+
},
|
300 |
+
"outputs": [],
|
301 |
+
"source": [
|
302 |
+
"#@title 手���训练(不推荐)\n",
|
303 |
+
"#@markdown 模型名\n",
|
304 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
305 |
+
"#@markdown 使用的GPU\n",
|
306 |
+
"USEGPU = \"0\" #@param {type:\"string\"}\n",
|
307 |
+
"#@markdown 批大小\n",
|
308 |
+
"BATCHSIZE = 32 #@param {type:\"integer\"}\n",
|
309 |
+
"#@markdown 停止的epoch\n",
|
310 |
+
"MODELEPOCH = 3200 #@param {type:\"integer\"}\n",
|
311 |
+
"#@markdown 保存epoch间隔\n",
|
312 |
+
"EPOCHSAVE = 100 #@param {type:\"integer\"}\n",
|
313 |
+
"#@markdown 采样率\n",
|
314 |
+
"MODELSAMPLE = \"48k\" #@param {type:\"string\"}\n",
|
315 |
+
"#@markdown 是否缓存训练集\n",
|
316 |
+
"CACHEDATA = 1 #@param {type:\"integer\"}\n",
|
317 |
+
"#@markdown 是否仅保存最新的ckpt文件\n",
|
318 |
+
"ONLYLATEST = 0 #@param {type:\"integer\"}\n",
|
319 |
+
"\n",
|
320 |
+
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}\n"
|
321 |
+
]
|
322 |
+
},
|
323 |
+
{
|
324 |
+
"cell_type": "code",
|
325 |
+
"execution_count": null,
|
326 |
+
"metadata": {
|
327 |
+
"id": "haYA81hySuDl"
|
328 |
+
},
|
329 |
+
"outputs": [],
|
330 |
+
"source": [
|
331 |
+
"#@title 删除其它pth,只留选中的(慎点,仔细看代码)\n",
|
332 |
+
"#@markdown 模型名\n",
|
333 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
334 |
+
"#@markdown 选中模型epoch\n",
|
335 |
+
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
336 |
+
"\n",
|
337 |
+
"!echo \"备份选中的模型。。。\"\n",
|
338 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
339 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
340 |
+
"\n",
|
341 |
+
"!echo \"正在删除。。。\"\n",
|
342 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
343 |
+
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
344 |
+
"\n",
|
345 |
+
"!echo \"恢复选中的模型。。。\"\n",
|
346 |
+
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
347 |
+
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
348 |
+
"\n",
|
349 |
+
"!echo \"删除完成\"\n",
|
350 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
351 |
+
]
|
352 |
+
},
|
353 |
+
{
|
354 |
+
"cell_type": "code",
|
355 |
+
"execution_count": null,
|
356 |
+
"metadata": {
|
357 |
+
"id": "QhSiPTVPoIRh"
|
358 |
+
},
|
359 |
+
"outputs": [],
|
360 |
+
"source": [
|
361 |
+
"#@title 清除项目下所有文件,只留选中的模型(慎点,仔细看代码)\n",
|
362 |
+
"#@markdown 模型名\n",
|
363 |
+
"MODELNAME = \"lulu\" #@param {type:\"string\"}\n",
|
364 |
+
"#@markdown 选中模型epoch\n",
|
365 |
+
"MODELEPOCH = 9600 #@param {type:\"integer\"}\n",
|
366 |
+
"\n",
|
367 |
+
"!echo \"备份选中的模型。。。\"\n",
|
368 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
369 |
+
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
370 |
+
"\n",
|
371 |
+
"!echo \"正在删除。。。\"\n",
|
372 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
373 |
+
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
374 |
+
"\n",
|
375 |
+
"!echo \"恢复选中的模型。。。\"\n",
|
376 |
+
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth \n",
|
377 |
+
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
378 |
+
"\n",
|
379 |
+
"!echo \"删除完成\"\n",
|
380 |
+
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
381 |
+
]
|
382 |
+
}
|
383 |
+
],
|
384 |
+
"metadata": {
|
385 |
+
"accelerator": "GPU",
|
386 |
+
"colab": {
|
387 |
+
"private_outputs": true,
|
388 |
+
"provenance": []
|
389 |
+
},
|
390 |
+
"gpuClass": "standard",
|
391 |
+
"kernelspec": {
|
392 |
+
"display_name": "Python 3",
|
393 |
+
"name": "python3"
|
394 |
+
},
|
395 |
+
"language_info": {
|
396 |
+
"name": "python"
|
397 |
+
}
|
398 |
+
},
|
399 |
+
"nbformat": 4,
|
400 |
+
"nbformat_minor": 0
|
401 |
+
}
|
__pycache__/config.cpython-39.pyc
ADDED
Binary file (3.13 kB). View file
|
|
__pycache__/i18n.cpython-39.pyc
ADDED
Binary file (1.19 kB). View file
|
|
__pycache__/my_utils.cpython-39.pyc
ADDED
Binary file (728 Bytes). View file
|
|
__pycache__/vc_infer_pipeline.cpython-39.pyc
ADDED
Binary file (8.37 kB). View file
|
|
app.py
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import io
|
2 |
+
import os
|
3 |
+
os.system("chmod 777 ffmpeg")
|
4 |
+
import torch
|
5 |
+
import gradio as gr
|
6 |
+
import librosa
|
7 |
+
import numpy as np
|
8 |
+
import soundfile
|
9 |
+
import logging
|
10 |
+
from fairseq import checkpoint_utils
|
11 |
+
from my_utils import load_audio
|
12 |
+
from vc_infer_pipeline import VC
|
13 |
+
import traceback
|
14 |
+
from config import Config
|
15 |
+
from infer_pack.models import (
|
16 |
+
SynthesizerTrnMs256NSFsid,
|
17 |
+
SynthesizerTrnMs256NSFsid_nono,
|
18 |
+
SynthesizerTrnMs768NSFsid,
|
19 |
+
SynthesizerTrnMs768NSFsid_nono,
|
20 |
+
)
|
21 |
+
from i18n import I18nAuto
|
22 |
+
|
23 |
+
logging.getLogger("numba").setLevel(logging.WARNING)
|
24 |
+
logging.getLogger("markdown_it").setLevel(logging.WARNING)
|
25 |
+
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
26 |
+
logging.getLogger("matplotlib").setLevel(logging.WARNING)
|
27 |
+
|
28 |
+
i18n = I18nAuto()
|
29 |
+
i18n.print()
|
30 |
+
|
31 |
+
config = Config()
|
32 |
+
|
33 |
+
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
34 |
+
["hubert_base.pt"],
|
35 |
+
suffix="",
|
36 |
+
)
|
37 |
+
hubert_model = models[0]
|
38 |
+
hubert_model = hubert_model.to(config.device)
|
39 |
+
hubert_model = hubert_model.float()
|
40 |
+
hubert_model.eval()
|
41 |
+
|
42 |
+
global n_spk, tgt_sr, net_g, vc, cpt, version
|
43 |
+
person = "weights/simple-guitar-crepe-guolv_e1000.pth"
|
44 |
+
print("loading %s" % person)
|
45 |
+
cpt = torch.load(person, map_location="cpu")
|
46 |
+
tgt_sr = cpt["config"][-1]
|
47 |
+
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0] # n_spk
|
48 |
+
net_g = SynthesizerTrnMs768NSFsid(*cpt["config"], is_half=False)
|
49 |
+
del net_g.enc_q
|
50 |
+
print(net_g.load_state_dict(cpt["weight"], strict=False))
|
51 |
+
net_g.eval().to(config.device)
|
52 |
+
net_g = net_g.float()
|
53 |
+
vc = VC(tgt_sr, config)
|
54 |
+
n_spk = cpt["config"][-3]
|
55 |
+
version="v2"
|
56 |
+
|
57 |
+
default_audio=load_audio("logs/mute/1_16k_wavs/mute.wav",16000)
|
58 |
+
def vc_single(
|
59 |
+
# sid=0,
|
60 |
+
input_audio_path,#待选取
|
61 |
+
f0_up_key,#待选取
|
62 |
+
f0_method,
|
63 |
+
file_index="logs/added_IVF2225_Flat_nprobe_1_simple-guitar-crepe-guolv_v2.index",#写死
|
64 |
+
index_rate=1,#写死1
|
65 |
+
filter_radius=3,#不需要,随便写,3
|
66 |
+
resample_sr=0,#写死0不需要
|
67 |
+
rms_mix_rate=1,#写死1不需要
|
68 |
+
protect=0.5,#写死0.5不需要
|
69 |
+
):
|
70 |
+
global tgt_sr, net_g, vc, hubert_model, version
|
71 |
+
if input_audio_path is None:
|
72 |
+
return "You need to upload an audio", None
|
73 |
+
f0_up_key = int(f0_up_key)
|
74 |
+
try:
|
75 |
+
audio = input_audio_path[1] / 32768.0
|
76 |
+
if len(audio.shape) == 2:
|
77 |
+
audio = np.mean(audio, -1)
|
78 |
+
audio = librosa.resample(audio, orig_sr=input_audio_path[0], target_sr=16000)
|
79 |
+
audio_max = np.abs(audio).max() / 0.95
|
80 |
+
if audio_max > 1:
|
81 |
+
audio /= audio_max
|
82 |
+
times = [0, 0, 0]
|
83 |
+
audio_opt = vc.pipeline(
|
84 |
+
model=hubert_model,
|
85 |
+
net_g=net_g,
|
86 |
+
sid=0,
|
87 |
+
audio=audio,
|
88 |
+
input_audio_path="123",
|
89 |
+
times=times,
|
90 |
+
f0_up_key=f0_up_key,
|
91 |
+
f0_method=f0_method,
|
92 |
+
file_index=file_index,
|
93 |
+
index_rate=index_rate,
|
94 |
+
if_f0=1,
|
95 |
+
filter_radius=filter_radius,
|
96 |
+
tgt_sr=tgt_sr,
|
97 |
+
resample_sr=resample_sr,
|
98 |
+
rms_mix_rate=rms_mix_rate,
|
99 |
+
version="v2",
|
100 |
+
protect=protect,
|
101 |
+
f0_file=None,
|
102 |
+
)
|
103 |
+
if resample_sr >= 16000 and tgt_sr != resample_sr:
|
104 |
+
tgt_sr = resample_sr
|
105 |
+
index_info = (
|
106 |
+
"Using index:%s." % file_index
|
107 |
+
if os.path.exists(file_index)
|
108 |
+
else "Index not used."
|
109 |
+
)
|
110 |
+
return "Success.\n %s\nTime:\n npy:%ss, f0:%ss, infer:%ss" % (
|
111 |
+
index_info,
|
112 |
+
times[0],
|
113 |
+
times[1],
|
114 |
+
times[2],
|
115 |
+
), (tgt_sr, audio_opt)
|
116 |
+
except:
|
117 |
+
info = traceback.format_exc()
|
118 |
+
print(info)
|
119 |
+
return "报错了!信息如下:%s"%info, (16000, default_audio)
|
120 |
+
|
121 |
+
app = gr.Blocks()
|
122 |
+
with app:
|
123 |
+
with gr.Tabs():
|
124 |
+
with gr.TabItem("人声转吉他极简在线demo"):
|
125 |
+
gr.Markdown(
|
126 |
+
value="""
|
127 |
+
变调越高吉他音越细,越低越沉闷
|
128 |
+
"""
|
129 |
+
)
|
130 |
+
vc_input = gr.Audio(label="上传音频")
|
131 |
+
with gr.Column():
|
132 |
+
with gr.Row():
|
133 |
+
vc_transform = gr.Slider(
|
134 |
+
minimum=-12,
|
135 |
+
maximum=12,
|
136 |
+
label="变调(半音数量,升八度12降八度-12)",
|
137 |
+
value=0,
|
138 |
+
step=1,
|
139 |
+
interactive=True,
|
140 |
+
)
|
141 |
+
f0method = gr.Radio(
|
142 |
+
label=i18n(
|
143 |
+
"选择音高提取算法:语音推荐dio歌声推荐pm"
|
144 |
+
),
|
145 |
+
choices=["pm", "dio"],
|
146 |
+
value="dio",
|
147 |
+
interactive=True,
|
148 |
+
)
|
149 |
+
with gr.Row():
|
150 |
+
but = gr.Button(i18n("转换"), variant="primary")
|
151 |
+
vc_output1 = gr.Textbox(label=i18n("输出信息"))
|
152 |
+
vc_output2 = gr.Audio(label=i18n("输出音频(右下角三个点,点了可���下载)"))
|
153 |
+
but.click(
|
154 |
+
vc_single,
|
155 |
+
[
|
156 |
+
vc_input,
|
157 |
+
vc_transform,
|
158 |
+
f0method
|
159 |
+
],
|
160 |
+
[vc_output1, vc_output2],
|
161 |
+
)
|
162 |
+
|
163 |
+
app.launch(server_name="0.0.0.0",quiet=True)
|
config.py
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import argparse
|
2 |
+
import torch
|
3 |
+
from multiprocessing import cpu_count
|
4 |
+
|
5 |
+
|
6 |
+
def config_file_change_fp32():
|
7 |
+
for config_file in ["32k.json", "40k.json", "48k.json"]:
|
8 |
+
with open(f"configs/{config_file}", "r") as f:
|
9 |
+
strr = f.read().replace("true", "false")
|
10 |
+
with open(f"configs/{config_file}", "w") as f:
|
11 |
+
f.write(strr)
|
12 |
+
with open("trainset_preprocess_pipeline_print.py", "r") as f:
|
13 |
+
strr = f.read().replace("3.7", "3.0")
|
14 |
+
with open("trainset_preprocess_pipeline_print.py", "w") as f:
|
15 |
+
f.write(strr)
|
16 |
+
|
17 |
+
|
18 |
+
class Config:
|
19 |
+
def __init__(self):
|
20 |
+
self.device = "cuda:0"
|
21 |
+
self.is_half = True
|
22 |
+
self.n_cpu = 0
|
23 |
+
self.gpu_name = None
|
24 |
+
self.gpu_mem = None
|
25 |
+
(
|
26 |
+
self.python_cmd,
|
27 |
+
self.listen_port,
|
28 |
+
self.iscolab,
|
29 |
+
self.noparallel,
|
30 |
+
self.noautoopen,
|
31 |
+
) = self.arg_parse()
|
32 |
+
self.x_pad, self.x_query, self.x_center, self.x_max = self.device_config()
|
33 |
+
|
34 |
+
@staticmethod
|
35 |
+
def arg_parse() -> tuple:
|
36 |
+
parser = argparse.ArgumentParser()
|
37 |
+
parser.add_argument("--port", type=int, default=7865, help="Listen port")
|
38 |
+
parser.add_argument(
|
39 |
+
"--pycmd", type=str, default="python", help="Python command"
|
40 |
+
)
|
41 |
+
parser.add_argument("--colab", action="store_true", help="Launch in colab")
|
42 |
+
parser.add_argument(
|
43 |
+
"--noparallel", action="store_true", help="Disable parallel processing"
|
44 |
+
)
|
45 |
+
parser.add_argument(
|
46 |
+
"--noautoopen",
|
47 |
+
action="store_true",
|
48 |
+
help="Do not open in browser automatically",
|
49 |
+
)
|
50 |
+
cmd_opts = parser.parse_args()
|
51 |
+
|
52 |
+
cmd_opts.port = cmd_opts.port if 0 <= cmd_opts.port <= 65535 else 7865
|
53 |
+
|
54 |
+
return (
|
55 |
+
cmd_opts.pycmd,
|
56 |
+
cmd_opts.port,
|
57 |
+
cmd_opts.colab,
|
58 |
+
cmd_opts.noparallel,
|
59 |
+
cmd_opts.noautoopen,
|
60 |
+
)
|
61 |
+
|
62 |
+
def device_config(self) -> tuple:
|
63 |
+
if torch.cuda.is_available():
|
64 |
+
i_device = int(self.device.split(":")[-1])
|
65 |
+
self.gpu_name = torch.cuda.get_device_name(i_device)
|
66 |
+
if (
|
67 |
+
("16" in self.gpu_name and "V100" not in self.gpu_name.upper())
|
68 |
+
or "P40" in self.gpu_name.upper()
|
69 |
+
or "1060" in self.gpu_name
|
70 |
+
or "1070" in self.gpu_name
|
71 |
+
or "1080" in self.gpu_name
|
72 |
+
):
|
73 |
+
print("16系/10系显卡和P40强制单精度")
|
74 |
+
self.is_half = False
|
75 |
+
config_file_change_fp32()
|
76 |
+
else:
|
77 |
+
self.gpu_name = None
|
78 |
+
self.gpu_mem = int(
|
79 |
+
torch.cuda.get_device_properties(i_device).total_memory
|
80 |
+
/ 1024
|
81 |
+
/ 1024
|
82 |
+
/ 1024
|
83 |
+
+ 0.4
|
84 |
+
)
|
85 |
+
if self.gpu_mem <= 4:
|
86 |
+
with open("trainset_preprocess_pipeline_print.py", "r") as f:
|
87 |
+
strr = f.read().replace("3.7", "3.0")
|
88 |
+
with open("trainset_preprocess_pipeline_print.py", "w") as f:
|
89 |
+
f.write(strr)
|
90 |
+
elif torch.backends.mps.is_available():
|
91 |
+
print("没有发现支持的N卡, 使用MPS进行推理")
|
92 |
+
self.device = "mps"
|
93 |
+
self.is_half = False
|
94 |
+
config_file_change_fp32()
|
95 |
+
else:
|
96 |
+
print("没有发现支持的N卡, 使用CPU进行推理")
|
97 |
+
self.device = "cpu"
|
98 |
+
self.is_half = False
|
99 |
+
config_file_change_fp32()
|
100 |
+
|
101 |
+
if self.n_cpu == 0:
|
102 |
+
self.n_cpu = cpu_count()
|
103 |
+
|
104 |
+
x_pad = 0.1
|
105 |
+
x_query = 4
|
106 |
+
x_center = 20
|
107 |
+
x_max = 22
|
108 |
+
self.is_half=False
|
109 |
+
self.device="cpu"
|
110 |
+
return x_pad, x_query, x_center, x_max
|
configs/32k.json
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 200,
|
4 |
+
"seed": 1234,
|
5 |
+
"epochs": 20000,
|
6 |
+
"learning_rate": 1e-4,
|
7 |
+
"betas": [0.8, 0.99],
|
8 |
+
"eps": 1e-9,
|
9 |
+
"batch_size": 4,
|
10 |
+
"fp16_run": true,
|
11 |
+
"lr_decay": 0.999875,
|
12 |
+
"segment_size": 12800,
|
13 |
+
"init_lr_ratio": 1,
|
14 |
+
"warmup_epochs": 0,
|
15 |
+
"c_mel": 45,
|
16 |
+
"c_kl": 1.0
|
17 |
+
},
|
18 |
+
"data": {
|
19 |
+
"max_wav_value": 32768.0,
|
20 |
+
"sampling_rate": 32000,
|
21 |
+
"filter_length": 1024,
|
22 |
+
"hop_length": 320,
|
23 |
+
"win_length": 1024,
|
24 |
+
"n_mel_channels": 80,
|
25 |
+
"mel_fmin": 0.0,
|
26 |
+
"mel_fmax": null
|
27 |
+
},
|
28 |
+
"model": {
|
29 |
+
"inter_channels": 192,
|
30 |
+
"hidden_channels": 192,
|
31 |
+
"filter_channels": 768,
|
32 |
+
"n_heads": 2,
|
33 |
+
"n_layers": 6,
|
34 |
+
"kernel_size": 3,
|
35 |
+
"p_dropout": 0,
|
36 |
+
"resblock": "1",
|
37 |
+
"resblock_kernel_sizes": [3,7,11],
|
38 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
39 |
+
"upsample_rates": [10,4,2,2,2],
|
40 |
+
"upsample_initial_channel": 512,
|
41 |
+
"upsample_kernel_sizes": [16,16,4,4,4],
|
42 |
+
"use_spectral_norm": false,
|
43 |
+
"gin_channels": 256,
|
44 |
+
"spk_embed_dim": 109
|
45 |
+
}
|
46 |
+
}
|
configs/40k.json
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 200,
|
4 |
+
"seed": 1234,
|
5 |
+
"epochs": 20000,
|
6 |
+
"learning_rate": 1e-4,
|
7 |
+
"betas": [0.8, 0.99],
|
8 |
+
"eps": 1e-9,
|
9 |
+
"batch_size": 4,
|
10 |
+
"fp16_run": true,
|
11 |
+
"lr_decay": 0.999875,
|
12 |
+
"segment_size": 12800,
|
13 |
+
"init_lr_ratio": 1,
|
14 |
+
"warmup_epochs": 0,
|
15 |
+
"c_mel": 45,
|
16 |
+
"c_kl": 1.0
|
17 |
+
},
|
18 |
+
"data": {
|
19 |
+
"max_wav_value": 32768.0,
|
20 |
+
"sampling_rate": 40000,
|
21 |
+
"filter_length": 2048,
|
22 |
+
"hop_length": 400,
|
23 |
+
"win_length": 2048,
|
24 |
+
"n_mel_channels": 125,
|
25 |
+
"mel_fmin": 0.0,
|
26 |
+
"mel_fmax": null
|
27 |
+
},
|
28 |
+
"model": {
|
29 |
+
"inter_channels": 192,
|
30 |
+
"hidden_channels": 192,
|
31 |
+
"filter_channels": 768,
|
32 |
+
"n_heads": 2,
|
33 |
+
"n_layers": 6,
|
34 |
+
"kernel_size": 3,
|
35 |
+
"p_dropout": 0,
|
36 |
+
"resblock": "1",
|
37 |
+
"resblock_kernel_sizes": [3,7,11],
|
38 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
39 |
+
"upsample_rates": [10,10,2,2],
|
40 |
+
"upsample_initial_channel": 512,
|
41 |
+
"upsample_kernel_sizes": [16,16,4,4],
|
42 |
+
"use_spectral_norm": false,
|
43 |
+
"gin_channels": 256,
|
44 |
+
"spk_embed_dim": 109
|
45 |
+
}
|
46 |
+
}
|
configs/48k.json
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"train": {
|
3 |
+
"log_interval": 200,
|
4 |
+
"seed": 1234,
|
5 |
+
"epochs": 20000,
|
6 |
+
"learning_rate": 1e-4,
|
7 |
+
"betas": [0.8, 0.99],
|
8 |
+
"eps": 1e-9,
|
9 |
+
"batch_size": 4,
|
10 |
+
"fp16_run": true,
|
11 |
+
"lr_decay": 0.999875,
|
12 |
+
"segment_size": 11520,
|
13 |
+
"init_lr_ratio": 1,
|
14 |
+
"warmup_epochs": 0,
|
15 |
+
"c_mel": 45,
|
16 |
+
"c_kl": 1.0
|
17 |
+
},
|
18 |
+
"data": {
|
19 |
+
"max_wav_value": 32768.0,
|
20 |
+
"sampling_rate": 48000,
|
21 |
+
"filter_length": 2048,
|
22 |
+
"hop_length": 480,
|
23 |
+
"win_length": 2048,
|
24 |
+
"n_mel_channels": 128,
|
25 |
+
"mel_fmin": 0.0,
|
26 |
+
"mel_fmax": null
|
27 |
+
},
|
28 |
+
"model": {
|
29 |
+
"inter_channels": 192,
|
30 |
+
"hidden_channels": 192,
|
31 |
+
"filter_channels": 768,
|
32 |
+
"n_heads": 2,
|
33 |
+
"n_layers": 6,
|
34 |
+
"kernel_size": 3,
|
35 |
+
"p_dropout": 0,
|
36 |
+
"resblock": "1",
|
37 |
+
"resblock_kernel_sizes": [3,7,11],
|
38 |
+
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
|
39 |
+
"upsample_rates": [10,6,2,2,2],
|
40 |
+
"upsample_initial_channel": 512,
|
41 |
+
"upsample_kernel_sizes": [16,16,4,4,4],
|
42 |
+
"use_spectral_norm": false,
|
43 |
+
"gin_channels": 256,
|
44 |
+
"spk_embed_dim": 109
|
45 |
+
}
|
46 |
+
}
|
docs/#U5c0f#U767d#U7b80#U6613#U6559#U7a0b.doc
ADDED
Binary file (603 kB). View file
|
|
docs/README.en.md
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
|
3 |
+
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
|
4 |
+
An easy-to-use Voice Conversion framework based on VITS.<br><br>
|
5 |
+
|
6 |
+
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
|
7 |
+
|
8 |
+
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
|
9 |
+
|
10 |
+
[![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/github/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI.ipynb)
|
11 |
+
[![Licence](https://img.shields.io/github/license/liujing04/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/%E4%BD%BF%E7%94%A8%E9%9C%80%E9%81%B5%E5%AE%88%E7%9A%84%E5%8D%8F%E8%AE%AE-LICENSE.txt)
|
12 |
+
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
|
13 |
+
|
14 |
+
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
|
15 |
+
|
16 |
+
</div>
|
17 |
+
|
18 |
+
------
|
19 |
+
[**Changelog**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md) | [**FAQ (Frequently Asked Questions)**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/FAQ-(Frequently-Asked-Questions))
|
20 |
+
|
21 |
+
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
|
22 |
+
|
23 |
+
> Check our [Demo Video](https://www.bilibili.com/video/BV1pm4y1z7Gm/) here!
|
24 |
+
|
25 |
+
> Realtime Voice Conversion Software using RVC : [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
|
26 |
+
|
27 |
+
> The dataset for the pre-training model uses nearly 50 hours of high quality VCTK open source dataset.
|
28 |
+
|
29 |
+
> High quality licensed song datasets will be added to training-set one after another for your use, without worrying about copyright infringement.
|
30 |
+
## Summary
|
31 |
+
This repository has the following features:
|
32 |
+
+ Reduce tone leakage by replacing source feature to training-set feature using top1 retrieval;
|
33 |
+
+ Easy and fast training, even on relatively poor graphics cards;
|
34 |
+
+ Training with a small amount of data also obtains relatively good results (>=10min low noise speech recommended);
|
35 |
+
+ Supporting model fusion to change timbres (using ckpt processing tab->ckpt merge);
|
36 |
+
+ Easy-to-use Webui interface;
|
37 |
+
+ Use the UVR5 model to quickly separate vocals and instruments.
|
38 |
+
## Preparing the environment
|
39 |
+
We recommend you install the dependencies through poetry.
|
40 |
+
|
41 |
+
The following commands need to be executed in the environment of Python version 3.8 or higher:
|
42 |
+
```bash
|
43 |
+
# Install PyTorch-related core dependencies, skip if installed
|
44 |
+
# Reference: https://pytorch.org/get-started/locally/
|
45 |
+
pip install torch torchvision torchaudio
|
46 |
+
|
47 |
+
#For Windows + Nvidia Ampere Architecture(RTX30xx), you need to specify the cuda version corresponding to pytorch according to the experience of https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/issues/21
|
48 |
+
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
|
49 |
+
|
50 |
+
# Install the Poetry dependency management tool, skip if installed
|
51 |
+
# Reference: https://python-poetry.org/docs/#installation
|
52 |
+
curl -sSL https://install.python-poetry.org | python3 -
|
53 |
+
|
54 |
+
# Install the project dependencies
|
55 |
+
poetry install
|
56 |
+
```
|
57 |
+
You can also use pip to install the dependencies
|
58 |
+
|
59 |
+
```bash
|
60 |
+
pip install -r requirements.txt
|
61 |
+
```
|
62 |
+
|
63 |
+
## Preparation of other Pre-models
|
64 |
+
RVC requires other pre-models to infer and train.
|
65 |
+
|
66 |
+
You need to download them from our [Huggingface space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/).
|
67 |
+
|
68 |
+
Here's a list of Pre-models and other files that RVC needs:
|
69 |
+
```bash
|
70 |
+
hubert_base.pt
|
71 |
+
|
72 |
+
./pretrained
|
73 |
+
|
74 |
+
./uvr5_weights
|
75 |
+
|
76 |
+
If you want to test the v2 version model (the v2 version model has changed the input from the 256 dimensional feature of 9-layer Hubert+final_proj to the 768 dimensional feature of 12-layer Hubert, and has added 3 period discriminators), you will need to download additional features
|
77 |
+
|
78 |
+
./pretrained_v2
|
79 |
+
|
80 |
+
#If you are using Windows, you may also need this dictionary, skip if FFmpeg is installed
|
81 |
+
ffmpeg.exe
|
82 |
+
```
|
83 |
+
Then use this command to start Webui:
|
84 |
+
```bash
|
85 |
+
python infer-web.py
|
86 |
+
```
|
87 |
+
If you are using Windows, you can download and extract `RVC-beta.7z` to use RVC directly and use `go-web.bat` to start Webui.
|
88 |
+
|
89 |
+
There's also a tutorial on RVC in Chinese and you can check it out if needed.
|
90 |
+
|
91 |
+
## Credits
|
92 |
+
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
|
93 |
+
+ [VITS](https://github.com/jaywalnut310/vits)
|
94 |
+
+ [HIFIGAN](https://github.com/jik876/hifi-gan)
|
95 |
+
+ [Gradio](https://github.com/gradio-app/gradio)
|
96 |
+
+ [FFmpeg](https://github.com/FFmpeg/FFmpeg)
|
97 |
+
+ [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
|
98 |
+
+ [audio-slicer](https://github.com/openvpi/audio-slicer)
|
99 |
+
## Thanks to all contributors for their efforts
|
100 |
+
|
101 |
+
<a href="https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
|
102 |
+
<img src="https://contrib.rocks/image?repo=liujing04/Retrieval-based-Voice-Conversion-WebUI" />
|
103 |
+
</a>
|
104 |
+
|
docs/README.ja.md
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
|
3 |
+
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
|
4 |
+
VITSに基づく使いやすい音声変換(voice changer)framework<br><br>
|
5 |
+
|
6 |
+
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
|
7 |
+
|
8 |
+
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
|
9 |
+
|
10 |
+
[![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/github/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI.ipynb)
|
11 |
+
[![Licence](https://img.shields.io/github/license/liujing04/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/%E4%BD%BF%E7%94%A8%E9%9C%80%E9%81%B5%E5%AE%88%E7%9A%84%E5%8D%8F%E8%AE%AE-LICENSE.txt)
|
12 |
+
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
|
13 |
+
|
14 |
+
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
|
15 |
+
|
16 |
+
</div>
|
17 |
+
|
18 |
+
------
|
19 |
+
|
20 |
+
[**更新日誌**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
|
21 |
+
|
22 |
+
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
|
23 |
+
|
24 |
+
> デモ動画は[こちら](https://www.bilibili.com/video/BV1pm4y1z7Gm/)でご覧ください。
|
25 |
+
|
26 |
+
> RVCによるリアルタイム音声変換: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
|
27 |
+
|
28 |
+
> 著作権侵害を心配することなく使用できるように、基底モデルは約50時間の高品質なオープンソースデータセットで訓練されています。
|
29 |
+
|
30 |
+
> 今後も、次々と使用許可のある高品質な歌声の資料集を追加し、基底モデルを訓練する予定です。
|
31 |
+
|
32 |
+
## はじめに
|
33 |
+
本リポジトリには下記の特徴があります。
|
34 |
+
|
35 |
+
+ Top1検索を用いることで、生の特徴量を訓練用データセット特徴量に変換し、トーンリーケージを削減します。
|
36 |
+
+ 比較的貧弱なGPUでも、高速かつ簡単に訓練できます。
|
37 |
+
+ 少量のデータセットからでも、比較的良い結果を得ることができます。(10分以上のノイズの少ない音声を推奨します。)
|
38 |
+
+ モデルを融合することで、音声を混ぜることができます。(ckpt processingタブの、ckpt mergeを使用します。)
|
39 |
+
+ 使いやすいWebUI。
|
40 |
+
+ UVR5 Modelも含んでいるため、人の声とBGMを素早く分離できます。
|
41 |
+
|
42 |
+
## 環境構築
|
43 |
+
Poetryで依存関係をインストールすることをお勧めします。
|
44 |
+
|
45 |
+
下記のコマンドは、Python3.8以上の環境で実行する必要があります:
|
46 |
+
```bash
|
47 |
+
# PyTorch関連の依存関係をインストール。インストール済の場合は省略。
|
48 |
+
# 参照先: https://pytorch.org/get-started/locally/
|
49 |
+
pip install torch torchvision torchaudio
|
50 |
+
|
51 |
+
#Windows+ Nvidia Ampere Architecture(RTX30xx)の場合、 #21 に従い、pytorchに対応するcuda versionを指定する必要があります。
|
52 |
+
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
|
53 |
+
|
54 |
+
# PyTorch関連の依存関係をインストール。インストール済の場合は省略。
|
55 |
+
# 参照先: https://python-poetry.org/docs/#installation
|
56 |
+
curl -sSL https://install.python-poetry.org | python3 -
|
57 |
+
|
58 |
+
# Poetry経由で依存関係をインストール
|
59 |
+
poetry install
|
60 |
+
```
|
61 |
+
|
62 |
+
pipでも依存関係のインストールが可能です:
|
63 |
+
|
64 |
+
```bash
|
65 |
+
pip install -r requirements.txt
|
66 |
+
```
|
67 |
+
|
68 |
+
## 基底modelsを準備
|
69 |
+
RVCは推論/訓練のために、様々な事前訓練を行った基底モデルを必要とします。
|
70 |
+
|
71 |
+
modelsは[Hugging Face space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)からダウンロードできます。
|
72 |
+
|
73 |
+
以下は、RVCに必要な基底モデルやその他のファイルの一覧です。
|
74 |
+
```bash
|
75 |
+
hubert_base.pt
|
76 |
+
|
77 |
+
./pretrained
|
78 |
+
|
79 |
+
./uvr5_weights
|
80 |
+
|
81 |
+
# ffmpegがすでにinstallされている場合は省略
|
82 |
+
./ffmpeg
|
83 |
+
```
|
84 |
+
その後、下記のコマンドでWebUIを起動します。
|
85 |
+
```bash
|
86 |
+
python infer-web.py
|
87 |
+
```
|
88 |
+
Windowsをお使いの方は、直接`RVC-beta.7z`をダウンロード後に展開し、`go-web.bat`をクリックすることで、WebUIを起動することができます。(7zipが必要です。)
|
89 |
+
|
90 |
+
また、リポジトリに[小白简易教程.doc](./小白简易教程.doc)がありますので、参考にしてください(中国語版のみ)。
|
91 |
+
|
92 |
+
## 参考プロジェクト
|
93 |
+
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
|
94 |
+
+ [VITS](https://github.com/jaywalnut310/vits)
|
95 |
+
+ [HIFIGAN](https://github.com/jik876/hifi-gan)
|
96 |
+
+ [Gradio](https://github.com/gradio-app/gradio)
|
97 |
+
+ [FFmpeg](https://github.com/FFmpeg/FFmpeg)
|
98 |
+
+ [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
|
99 |
+
+ [audio-slicer](https://github.com/openvpi/audio-slicer)
|
100 |
+
|
101 |
+
## 貢献者(contributor)の皆様の尽力に感謝します
|
102 |
+
<a href="https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
|
103 |
+
<img src="https://contrib.rocks/image?repo=liujing04/Retrieval-based-Voice-Conversion-WebUI" />
|
104 |
+
</a>
|
docs/README.ko.han.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
|
3 |
+
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
|
4 |
+
VITS基盤의 簡單하고使用하기 쉬운音聲變換틀<br><br>
|
5 |
+
|
6 |
+
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
|
7 |
+
|
8 |
+
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
|
9 |
+
|
10 |
+
[![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/github/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI.ipynb)
|
11 |
+
[![Licence](https://img.shields.io/github/license/liujing04/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/%E4%BD%BF%E7%94%A8%E9%9C%80%E9%81%B5%E5%AE%88%E7%9A%84%E5%8D%8F%E8%AE%AE-LICENSE.txt)
|
12 |
+
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
|
13 |
+
|
14 |
+
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
|
15 |
+
|
16 |
+
</div>
|
17 |
+
|
18 |
+
------
|
19 |
+
[**更新日誌**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
|
20 |
+
|
21 |
+
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
|
22 |
+
|
23 |
+
> [示範映像](https://www.bilibili.com/video/BV1pm4y1z7Gm/)을 確認해 보세요!
|
24 |
+
|
25 |
+
> RVC를活用한實時間音聲變換: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
|
26 |
+
|
27 |
+
> 基本모델은 50時間假量의 高品質 오픈 소스 VCTK 데이터셋을 使用하였으므로, 著作權上의 念慮가 없으니 安心하고 使用하시기 바랍니다.
|
28 |
+
|
29 |
+
> 著作權問題가 없는 高品質의 노래를 以後에도 繼續해서 訓練할 豫定입니다.
|
30 |
+
|
31 |
+
## 紹介
|
32 |
+
本Repo는 다음과 같은 特徵을 가지고 있습니다:
|
33 |
+
+ top1檢索을利用하여 入力音色特徵을 訓練세트音色特徵으로 代替하여 音色의漏出을 防止;
|
34 |
+
+ 相對的으로 낮은性能의 GPU에서도 빠른訓練可能;
|
35 |
+
+ 적은量의 데이터로 訓練해도 좋은 結果를 얻을 수 있음 (最小10分以上의 低雜음音聲데이터를 使用하는 것을 勸獎);
|
36 |
+
+ 모델融合을通한 音色의 變調可能 (ckpt處理탭->ckpt混合選擇);
|
37 |
+
+ 使用하기 쉬운 WebUI (웹 使用者인터페이스);
|
38 |
+
+ UVR5 모델을 利用하여 목소리와 背景音樂의 빠른 分離;
|
39 |
+
|
40 |
+
## 環境의準備
|
41 |
+
poetry를通해 依存를設置하는 것을 勸獎합니다.
|
42 |
+
|
43 |
+
다음命令은 Python 버전3.8以上의環境에서 實行되어야 합니다:
|
44 |
+
```bash
|
45 |
+
# PyTorch 關聯主要依存設置, 이미設置되어 있는 境遇 건너뛰기 可能
|
46 |
+
# 參照: https://pytorch.org/get-started/locally/
|
47 |
+
pip install torch torchvision torchaudio
|
48 |
+
|
49 |
+
# Windows + Nvidia Ampere Architecture(RTX30xx)를 使用하고 있다面, #21 에서 명시된 것과 같이 PyTorch에 맞는 CUDA 버전을 指定해야 합니다.
|
50 |
+
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
|
51 |
+
|
52 |
+
# Poetry 設置, 이미設置되어 있는 境遇 건너뛰기 可能
|
53 |
+
# Reference: https://python-poetry.org/docs/#installation
|
54 |
+
curl -sSL https://install.python-poetry.org | python3 -
|
55 |
+
|
56 |
+
# 依存設置
|
57 |
+
poetry install
|
58 |
+
```
|
59 |
+
pip를 活用하여依存를 設置하여도 無妨합니다.
|
60 |
+
|
61 |
+
```bash
|
62 |
+
pip install -r requirements.txt
|
63 |
+
```
|
64 |
+
|
65 |
+
## 其他預備모델準備
|
66 |
+
RVC 모델은 推論과訓練을 依하여 다른 預備모델이 必要합니다.
|
67 |
+
|
68 |
+
[Huggingface space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)를 通해서 다운로드 할 수 있습니다.
|
69 |
+
|
70 |
+
다음은 RVC에 必要한 預備모델 및 其他 파일 目錄입니다:
|
71 |
+
```bash
|
72 |
+
hubert_base.pt
|
73 |
+
|
74 |
+
./pretrained
|
75 |
+
|
76 |
+
./uvr5_weights
|
77 |
+
|
78 |
+
# Windows를 使用하는境遇 이 사전도 必要할 수 있습니다. FFmpeg가 設置되어 있으면 건너뛰어도 됩니다.
|
79 |
+
ffmpeg.exe
|
80 |
+
```
|
81 |
+
그後 以下의 命令을 使用하여 WebUI를 始作할 수 있습니다:
|
82 |
+
```bash
|
83 |
+
python infer-web.py
|
84 |
+
```
|
85 |
+
Windows를 使用하는境遇 `RVC-beta.7z`를 다운로드 및 壓縮解除하여 RVC를 直接使用하거나 `go-web.bat`을 使用하여 WebUi를 直接할 수 있습니다.
|
86 |
+
|
87 |
+
## 參考
|
88 |
+
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
|
89 |
+
+ [VITS](https://github.com/jaywalnut310/vits)
|
90 |
+
+ [HIFIGAN](https://github.com/jik876/hifi-gan)
|
91 |
+
+ [Gradio](https://github.com/gradio-app/gradio)
|
92 |
+
+ [FFmpeg](https://github.com/FFmpeg/FFmpeg)
|
93 |
+
+ [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
|
94 |
+
+ [audio-slicer](https://github.com/openvpi/audio-slicer)
|
95 |
+
## 모든寄與者분들의勞力에感謝드립니다
|
96 |
+
|
97 |
+
<a href="https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
|
98 |
+
<img src="https://contrib.rocks/image?repo=liujing04/Retrieval-based-Voice-Conversion-WebUI" />
|
99 |
+
</a>
|
100 |
+
|
docs/README.ko.md
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
|
3 |
+
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
|
4 |
+
VITS 기반의 간단하고 사용하기 쉬운 음성 변환 프레임워크.<br><br>
|
5 |
+
|
6 |
+
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
|
7 |
+
|
8 |
+
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
|
9 |
+
|
10 |
+
[![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/github/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI.ipynb)
|
11 |
+
[![Licence](https://img.shields.io/github/license/liujing04/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/%E4%BD%BF%E7%94%A8%E9%9C%80%E9%81%B5%E5%AE%88%E7%9A%84%E5%8D%8F%E8%AE%AE-LICENSE.txt)
|
12 |
+
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
|
13 |
+
|
14 |
+
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
|
15 |
+
|
16 |
+
</div>
|
17 |
+
|
18 |
+
---
|
19 |
+
|
20 |
+
[**업데이트 로그**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_KO.md)
|
21 |
+
|
22 |
+
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
|
23 |
+
|
24 |
+
> [데모 영상](https://www.bilibili.com/video/BV1pm4y1z7Gm/)을 확인해 보세요!
|
25 |
+
|
26 |
+
> RVC를 활용한 실시간 음성변환: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
|
27 |
+
|
28 |
+
> 기본 모델은 50시간 가량의 고퀄리티 오픈 소스 VCTK 데이터셋을 사용하였으므로, 저작권상의 염려가 없으니 안심하고 사용하시기 바랍니다.
|
29 |
+
|
30 |
+
> 저작권 문제가 없는 고퀄리티의 노래를 이후에도 계속해서 훈련할 예정입니다.
|
31 |
+
|
32 |
+
## 소개
|
33 |
+
|
34 |
+
본 Repo는 다음과 같은 특징을 가지고 있습니다:
|
35 |
+
|
36 |
+
- top1 검색을 이용하여 입력 음색 특징을 훈련 세트 음색 특징으로 대체하여 음색의 누출을 방지;
|
37 |
+
- 상대적으로 낮은 성능의 GPU에서도 빠른 훈련 가능;
|
38 |
+
- 적은 양의 데이터로 훈련해도 좋은 결과를 얻을 수 있음 (최소 10분 이상의 저잡음 음성 데이터를 사용하는 것을 권장);
|
39 |
+
- 모델 융합을 통한 음색의 변조 가능 (ckpt 처리 탭->ckpt 병합 선택);
|
40 |
+
- 사용하기 쉬운 WebUI (웹 인터페이스);
|
41 |
+
- UVR5 모델을 이용하여 목소리와 배경음악의 빠른 분리;
|
42 |
+
|
43 |
+
## 환경의 준비
|
44 |
+
|
45 |
+
poetry를 통해 dependecies를 설치하는 것을 권장합니다.
|
46 |
+
|
47 |
+
다음 명령은 Python 버전 3.8 이상의 환경에서 실행되어야 합니다:
|
48 |
+
|
49 |
+
```bash
|
50 |
+
# PyTorch 관련 주요 dependencies 설치, 이미 설치되어 있는 경우 건너뛰기 가능
|
51 |
+
# 참조: https://pytorch.org/get-started/locally/
|
52 |
+
pip install torch torchvision torchaudio
|
53 |
+
|
54 |
+
# Windows + Nvidia Ampere Architecture(RTX30xx)를 사용하고 있다면, https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/issues/21 에서 명시된 것과 같이 PyTorch에 맞는 CUDA 버전을 지정해야 합니다.
|
55 |
+
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
|
56 |
+
|
57 |
+
# Poetry 설치, 이미 설치되어 있는 경우 건너뛰기 가능
|
58 |
+
# Reference: https://python-poetry.org/docs/#installation
|
59 |
+
curl -sSL https://install.python-poetry.org | python3 -
|
60 |
+
|
61 |
+
# Dependecies 설치
|
62 |
+
poetry install
|
63 |
+
```
|
64 |
+
|
65 |
+
pip를 활용하여 dependencies를 설치하여도 무방합니다.
|
66 |
+
|
67 |
+
```bash
|
68 |
+
pip install -r requirements.txt
|
69 |
+
```
|
70 |
+
|
71 |
+
## 기타 사전 모델 준비
|
72 |
+
|
73 |
+
RVC 모델은 추론과 훈련을 위하여 다른 사전 모델이 필요합니다.
|
74 |
+
|
75 |
+
[Huggingface space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)를 통해서 다운로드 할 수 있습니다.
|
76 |
+
|
77 |
+
다음은 RVC에 필요한 사전 모델 및 기타 파일 목록입니다:
|
78 |
+
|
79 |
+
```bash
|
80 |
+
hubert_base.pt
|
81 |
+
|
82 |
+
./pretrained
|
83 |
+
|
84 |
+
./uvr5_weights
|
85 |
+
|
86 |
+
# Windows를 사용하는 경우 이 사전도 필요할 수 있습니다. FFmpeg가 설치되어 있으면 건너뛰어도 됩니다.
|
87 |
+
ffmpeg.exe
|
88 |
+
```
|
89 |
+
|
90 |
+
그 후 이하의 명령을 사용하여 WebUI를 시작할 수 있습니다:
|
91 |
+
|
92 |
+
```bash
|
93 |
+
python infer-web.py
|
94 |
+
```
|
95 |
+
|
96 |
+
Windows를 사용하는 경우 `RVC-beta.7z`를 다운로드 및 압축 해제하여 RVC를 직접 사용하거나 `go-web.bat`을 사용하여 WebUi를 시작할 수 있습니다.
|
97 |
+
|
98 |
+
## 참고
|
99 |
+
|
100 |
+
- [ContentVec](https://github.com/auspicious3000/contentvec/)
|
101 |
+
- [VITS](https://github.com/jaywalnut310/vits)
|
102 |
+
- [HIFIGAN](https://github.com/jik876/hifi-gan)
|
103 |
+
- [Gradio](https://github.com/gradio-app/gradio)
|
104 |
+
- [FFmpeg](https://github.com/FFmpeg/FFmpeg)
|
105 |
+
- [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
|
106 |
+
- [audio-slicer](https://github.com/openvpi/audio-slicer)
|
107 |
+
|
108 |
+
## 모든 기여자 분들의 노력에 감사드립니다.
|
109 |
+
|
110 |
+
<a href="https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
|
111 |
+
<img src="https://contrib.rocks/image?repo=liujing04/Retrieval-based-Voice-Conversion-WebUI" />
|
112 |
+
</a>
|
docs/faiss_tips_en.md
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
faiss tuning TIPS
|
2 |
+
==================
|
3 |
+
# about faiss
|
4 |
+
faiss is a library of neighborhood searches for dense vectors, developed by facebook research, which efficiently implements many approximate neighborhood search methods.
|
5 |
+
Approximate Neighbor Search finds similar vectors quickly while sacrificing some accuracy.
|
6 |
+
|
7 |
+
## faiss in RVC
|
8 |
+
In RVC, for the embedding of features converted by HuBERT, we search for embeddings similar to the embedding generated from the training data and mix them to achieve a conversion that is closer to the original speech. However, since this search takes time if performed naively, high-speed conversion is realized by using approximate neighborhood search.
|
9 |
+
|
10 |
+
# implementation overview
|
11 |
+
In '/logs/your-experiment/3_feature256' where the model is located, features extracted by HuBERT from each voice data are located.
|
12 |
+
From here we read the npy files in order sorted by filename and concatenate the vectors to create big_npy. (This vector has shape [N, 256].)
|
13 |
+
After saving big_npy as /logs/your-experiment/total_fea.npy, train it with faiss.
|
14 |
+
|
15 |
+
In this article, I will explain the meaning of these parameters.
|
16 |
+
|
17 |
+
# Explanation of the method
|
18 |
+
## index factory
|
19 |
+
An index factory is a unique faiss notation that expresses a pipeline that connects multiple approximate neighborhood search methods as a string.
|
20 |
+
This allows you to try various approximate neighborhood search methods simply by changing the index factory string.
|
21 |
+
In RVC it is used like this:
|
22 |
+
|
23 |
+
```python
|
24 |
+
index = faiss.index_factory(256, "IVF%s,Flat" % n_ivf)
|
25 |
+
```
|
26 |
+
Among the arguments of index_factory, the first is the number of dimensions of the vector, the second is the index factory string, and the third is the distance to use.
|
27 |
+
|
28 |
+
For more detailed notation
|
29 |
+
https://github.com/facebookresearch/faiss/wiki/The-index-factory
|
30 |
+
|
31 |
+
## index for distance
|
32 |
+
There are two typical indexes used as similarity of embedding as follows.
|
33 |
+
|
34 |
+
- Euclidean distance (METRIC_L2)
|
35 |
+
- inner product (METRIC_INNER_PRODUCT)
|
36 |
+
|
37 |
+
Euclidean distance takes the squared difference in each dimension, sums the differences in all dimensions, and then takes the square root. This is the same as the distance in 2D and 3D that we use on a daily basis.
|
38 |
+
The inner product is not used as an index of similarity as it is, and the cosine similarity that takes the inner product after being normalized by the L2 norm is generally used.
|
39 |
+
|
40 |
+
Which is better depends on the case, but cosine similarity is often used in embedding obtained by word2vec and similar image retrieval models learned by ArcFace. If you want to do l2 normalization on vector X with numpy, you can do it with the following code with eps small enough to avoid 0 division.
|
41 |
+
|
42 |
+
```python
|
43 |
+
X_normed = X / np.maximum(eps, np.linalg.norm(X, ord=2, axis=-1, keepdims=True))
|
44 |
+
```
|
45 |
+
|
46 |
+
Also, for the index factory, you can change the distance index used for calculation by choosing the value to pass as the third argument.
|
47 |
+
|
48 |
+
```python
|
49 |
+
index = faiss.index_factory(dimention, text, faiss.METRIC_INNER_PRODUCT)
|
50 |
+
```
|
51 |
+
|
52 |
+
## IVF
|
53 |
+
IVF (Inverted file indexes) is an algorithm similar to the inverted index in full-text search.
|
54 |
+
During learning, the search target is clustered with kmeans, and Voronoi partitioning is performed using the cluster center. Each data point is assigned a cluster, so we create a dictionary that looks up the data points from the clusters.
|
55 |
+
|
56 |
+
For example, if clusters are assigned as follows
|
57 |
+
|index|Cluster|
|
58 |
+
|-----|-------|
|
59 |
+
|1|A|
|
60 |
+
|2|B|
|
61 |
+
|3|A|
|
62 |
+
|4|C|
|
63 |
+
|5|B|
|
64 |
+
|
65 |
+
The resulting inverted index looks like this:
|
66 |
+
|
67 |
+
|cluster|index|
|
68 |
+
|-------|-----|
|
69 |
+
|A|1, 3|
|
70 |
+
|B|2, 5|
|
71 |
+
|C|4|
|
72 |
+
|
73 |
+
When searching, we first search n_probe clusters from the clusters, and then calculate the distances for the data points belonging to each cluster.
|
74 |
+
|
75 |
+
# recommend parameter
|
76 |
+
There are official guidelines on how to choose an index, so I will explain accordingly.
|
77 |
+
https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index
|
78 |
+
|
79 |
+
For datasets below 1M, 4bit-PQ is the most efficient method available in faiss as of April 2023.
|
80 |
+
Combining this with IVF, narrowing down the candidates with 4bit-PQ, and finally recalculating the distance with an accurate index can be described by using the following index factory.
|
81 |
+
|
82 |
+
```python
|
83 |
+
index = faiss.index_factory(256, "IVF1024,PQ128x4fs,RFlat")
|
84 |
+
```
|
85 |
+
|
86 |
+
## Recommended parameters for IVF
|
87 |
+
Consider the case of too many IVFs. For example, if coarse quantization by IVF is performed for the number of data, this is the same as a naive exhaustive search and is inefficient.
|
88 |
+
For 1M or less, IVF values are recommended between 4*sqrt(N) ~ 16*sqrt(N) for N number of data points.
|
89 |
+
|
90 |
+
Since the calculation time increases in proportion to the number of n_probes, please consult with the accuracy and choose appropriately. Personally, I don't think RVC needs that much accuracy, so n_probe = 1 is fine.
|
91 |
+
|
92 |
+
## FastScan
|
93 |
+
FastScan is a method that enables high-speed approximation of distances by Cartesian product quantization by performing them in registers.
|
94 |
+
Cartesian product quantization performs clustering independently for each d dimension (usually d = 2) during learning, calculates the distance between clusters in advance, and creates a lookup table. At the time of prediction, the distance of each dimension can be calculated in O(1) by looking at the lookup table.
|
95 |
+
So the number you specify after PQ usually specifies half the dimension of the vector.
|
96 |
+
|
97 |
+
For a more detailed description of FastScan, please refer to the official documentation.
|
98 |
+
https://github.com/facebookresearch/faiss/wiki/Fast-accumulation-of-PQ-and-AQ-codes-(FastScan)
|
99 |
+
|
100 |
+
## RFlat
|
101 |
+
RFlat is an instruction to recalculate the rough distance calculated by FastScan with the exact distance specified by the third argument of index factory.
|
102 |
+
When getting k neighbors, k*k_factor points are recalculated.
|
docs/faiss_tips_ja.md
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
faiss tuning TIPS
|
2 |
+
==================
|
3 |
+
# about faiss
|
4 |
+
faissはfacebook researchの開発する、密なベクトルに対する近傍探索をまとめたライブラリで、多くの近似近傍探索の手法を効率的に実装しています。
|
5 |
+
近似近傍探索はある程度精度を犠牲にしながら高速に類似するベクトルを探します。
|
6 |
+
|
7 |
+
## faiss in RVC
|
8 |
+
RVCではHuBERTで変換した特徴量のEmbeddingに対し、学習データから生成されたEmbeddingと類似するものを検索し、混ぜることでより元の音声に近い変換を実現しています。ただ、この検索は愚直に行うと時間がかかるため、近似近傍探索を用いることで高速な変換を実現しています。
|
9 |
+
|
10 |
+
# 実装のoverview
|
11 |
+
モデルが配置されている '/logs/your-experiment/3_feature256'には各音声データからHuBERTで抽出された特徴量が配置されています。
|
12 |
+
ここからnpyファイルをファイル名でソートした順番で読み込み、ベクトルを連結してbig_npyを作成しfaissを学習させます。(このベクトルのshapeは[N, 256]です。)
|
13 |
+
|
14 |
+
本Tipsではまずこれらのパラメータの意味を解説します。
|
15 |
+
|
16 |
+
# 手法の解説
|
17 |
+
## index factory
|
18 |
+
index factoryは複数の近似近傍探索の手法を繋げるパイプラインをstringで表記するfaiss独自の記法です。
|
19 |
+
これにより、index factoryの文字列を変更するだけで様々な近似近傍探索の手法を試せます。
|
20 |
+
RVCでは以下のように使われています。
|
21 |
+
|
22 |
+
```python
|
23 |
+
index = faiss.index_factory(256, "IVF%s,Flat" % n_ivf)
|
24 |
+
```
|
25 |
+
index_factoryの引数のうち、1つ目はベクトルの次元数、2つ目はindex factoryの文字列で、3つ目には用いる距離を指定することができます。
|
26 |
+
|
27 |
+
より詳細な記法については
|
28 |
+
https://github.com/facebookresearch/faiss/wiki/The-index-factory
|
29 |
+
|
30 |
+
## 距離指標
|
31 |
+
embeddingの類似度として用いられる代表的な指標として以下の二つがあります。
|
32 |
+
|
33 |
+
- ユークリッド距離(METRIC_L2)
|
34 |
+
- 内積(METRIC_INNER_PRODUCT)
|
35 |
+
|
36 |
+
ユークリッド距離では各次元において二乗の差をとり、全次元の差を足してから平方根をとります。これは日常的に用いる2次元、3次元での距離と同じです。
|
37 |
+
内積はこのままでは類似度の指標として用いず、一般的にはL2ノルムで正規化してから内積をとるコサイン類似度を用います。
|
38 |
+
|
39 |
+
どちらがよいかは場合によりますが、word2vec等で得られるembeddingやArcFace等で学習した類似画像検索のモデルではコサイン類似度が用いられることが多いです。ベクトルXに対してl2正規化をnumpyで行う場合は、0 divisionを避けるために十分に小さな値をepsとして以下のコードで可能です。
|
40 |
+
|
41 |
+
```python
|
42 |
+
X_normed = X / np.maximum(eps, np.linalg.norm(X, ord=2, axis=-1, keepdims=True))
|
43 |
+
```
|
44 |
+
|
45 |
+
また、index factoryには第3引数に渡す値を選ぶことで計算に用いる距離指標を変更できます。
|
46 |
+
|
47 |
+
```python
|
48 |
+
index = faiss.index_factory(dimention, text, faiss.METRIC_INNER_PRODUCT)
|
49 |
+
```
|
50 |
+
|
51 |
+
## IVF
|
52 |
+
IVF(Inverted file indexes)は全文検索における転置インデックスと似たようなアルゴリズムです。
|
53 |
+
学習時には検索対象に対してkmeansでクラスタリングを行い、クラスタ中心を用いてボロノイ分割を行います。各データ点には一つずつクラスタが割り当てられるので、クラスタからデータ点を逆引きする辞書を作成します。
|
54 |
+
|
55 |
+
例えば以下のようにクラスタが割り当てられた場合
|
56 |
+
|index|クラスタ|
|
57 |
+
|-----|-------|
|
58 |
+
|1|A|
|
59 |
+
|2|B|
|
60 |
+
|3|A|
|
61 |
+
|4|C|
|
62 |
+
|5|B|
|
63 |
+
|
64 |
+
作成される転置インデックスは以下のようになります。
|
65 |
+
|
66 |
+
|クラスタ|index|
|
67 |
+
|-------|-----|
|
68 |
+
|A|1, 3|
|
69 |
+
|B|2, 5|
|
70 |
+
|C|4|
|
71 |
+
|
72 |
+
検索時にはまずクラスタからn_probe個のクラスタを検索し、次にそれぞれのクラスタに属するデータ点について距離を計算します。
|
73 |
+
|
74 |
+
# 推奨されるパラメータ
|
75 |
+
indexの選び方については公式にガイドラインがあるので、それに準じて説明します。
|
76 |
+
https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index
|
77 |
+
|
78 |
+
1M以下のデータセットにおいては4bit-PQが2023年4月時点ではfaissで利用できる最も効率的な手法です。
|
79 |
+
これをIVFと組み合わせ、4bit-PQで候補を絞り、最後に正確な指標で距離を再計算するには以下のindex factoryを用いることで記載できます。
|
80 |
+
|
81 |
+
```python
|
82 |
+
index = faiss.index_factory(256, "IVF1024,PQ128x4fs,RFlat")
|
83 |
+
```
|
84 |
+
|
85 |
+
## IVFの推奨パラメータ
|
86 |
+
IVFの数が多すぎる場合、たとえばデータ数の数だけIVFによる粗量子化を行うと、これは愚直な全探索と同じになり効率が悪いです。
|
87 |
+
1M以下の場合ではIVFの値はデータ点の数Nに対して4*sqrt(N) ~ 16*sqrt(N)に推奨しています。
|
88 |
+
|
89 |
+
n_probeはn_probeの数に比例して計算時間が増えるので、精度と相談して適切に選んでください。個人的にはRVCにおいてそこまで精度は必要ないと思うのでn_probe = 1で良いと思います。
|
90 |
+
|
91 |
+
## FastScan
|
92 |
+
FastScanは直積量子化で大まかに距離を近似するのを、レジスタ内で行うことにより高速に行うようにした手法です。
|
93 |
+
直積量子化は学習時にd次元ごと(通常はd=2)に独立してクラスタリングを行い、クラスタ同士の距離を事前計算してlookup tableを作成します。予測時はlookup tableを見ることで各次元の距離をO(1)で計算できます。
|
94 |
+
そのため、PQの次に指定する数字は通常ベクトルの半分の次元を指定します。
|
95 |
+
|
96 |
+
FastScanに関するより詳細な説明は公式のドキュメントを参照してください。
|
97 |
+
https://github.com/facebookresearch/faiss/wiki/Fast-accumulation-of-PQ-and-AQ-codes-(FastScan)
|
98 |
+
|
99 |
+
## RFlat
|
100 |
+
RFlatはFastScanで計算した大まかな距離を、index factoryの第三引数で指定した正確な距離で再計算する指示です。
|
101 |
+
k個の近傍を取得する際は、k*k_factor個の点について再計算が行われます。
|
docs/faiss_tips_ko.md
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Facebook AI Similarity Search (Faiss) 팁
|
2 |
+
==================
|
3 |
+
# Faiss에 대하여
|
4 |
+
Faiss 는 Facebook Research가 개발하는, 고밀도 벡터 이웃 검색 라이브러리입니다. 근사 근접 탐색법 (Approximate Neigbor Search)은 약간의 정확성을 희생하여 유사 벡터를 고속으로 찾습니다.
|
5 |
+
|
6 |
+
## RVC에 있어서 Faiss
|
7 |
+
RVC에서는 HuBERT로 변환한 feature의 embedding을 위해 훈련 데이터에서 생성된 embedding과 유사한 embadding을 검색하고 혼합하여 원래의 음성에 더욱 가까운 변환을 달성합니다. 그러나, 이 탐색법은 단순히 수행하면 시간이 다소 소모되므로, 근사 근접 탐색법을 통해 고속 변환을 가능케 하고 있습니다.
|
8 |
+
|
9 |
+
# 구현 개요
|
10 |
+
모델이 위치한 `/logs/your-experiment/3_feature256`에는 각 음성 데이터에서 HuBERT가 추출한 feature들이 있습니다. 여기에서 파일 이름별로 정렬된 npy 파일을 읽고, 벡터를 연결하여 big_npy ([N, 256] 모양의 벡터) 를 만듭니다. big_npy를 `/logs/your-experiment/total_fea.npy`로 저장한 후, Faiss로 학습시킵니다.
|
11 |
+
|
12 |
+
2023/04/18 기준으로, Faiss의 Index Factory 기능을 이용해, L2 거리에 근거하는 IVF를 이용하고 있습니다. IVF의 분할수(n_ivf)는 N//39로, n_probe는 int(np.power(n_ivf, 0.3))가 사용되고 있습니다. (infer-web.py의 train_index 주위를 찾으십시오.)
|
13 |
+
|
14 |
+
이 팁에서는 먼저 이러한 매개 변수의 의미를 설명하고, 개발자가 추후 더 나은 index를 작성할 수 있도록 하는 조언을 작성합니다.
|
15 |
+
|
16 |
+
# 방법의 설명
|
17 |
+
## Index factory
|
18 |
+
index factory는 여러 근사 근접 탐색법을 문자열로 연결하는 pipeline을 문자열로 표기하는 Faiss만의 독자적인 기법입니다. 이를 통해 index factory의 문자열을 변경하는 것만으로 다양한 근사 근접 탐색을 시도해 볼 수 있습니다. RVC에서는 다음과 같이 사용됩니다:
|
19 |
+
|
20 |
+
```python
|
21 |
+
index = Faiss.index_factory(256, "IVF%s,Flat" % n_ivf)
|
22 |
+
```
|
23 |
+
`index_factory`의 인수들 중 첫 번째는 벡터의 차원 수이고, 두번째는 index factory 문자열이며, 세번째에는 사용할 거리를 지정할 수 있습니다.
|
24 |
+
|
25 |
+
기법의 보다 자세한 설명은 https://github.com/facebookresearch/Faiss/wiki/The-index-factory 를 확인해 주십시오.
|
26 |
+
|
27 |
+
## 거리에 대한 index
|
28 |
+
embedding의 유사도로서 사용되는 대표적인 지표로서 이하의 2개가 있습니다.
|
29 |
+
|
30 |
+
- 유클리드 거리 (METRIC_L2)
|
31 |
+
- 내적(内積) (METRIC_INNER_PRODUCT)
|
32 |
+
|
33 |
+
유클리드 거리에서는 각 차원에서 제곱의 차를 구하고, 각 차원에서 구한 차를 모두 더한 후 제곱근을 취합니다. 이것은 일상적으로 사용되는 2차원, 3차원에서의 거리의 연산법과 같습니다. 내적은 그 값을 그대로 유사도 지표로 사용하지 않고, L2 정규화를 한 이후 내적을 취하는 코사인 유사도를 사용합니다.
|
34 |
+
|
35 |
+
어느 쪽이 더 좋은지는 경우에 따라 다르지만, word2vec에서 얻은 embedding 및 ArcFace를 활용한 이미지 검색 모델은 코사인 유사성이 이용되는 경우가 많습니다. numpy를 사용하여 벡터 X에 대해 L2 정규화를 하고자 하는 경우, 0 division을 피하기 위해 충분히 작은 값을 eps로 한 뒤 이하에 코드를 활용하면 됩니다.
|
36 |
+
|
37 |
+
```python
|
38 |
+
X_normed = X / np.maximum(eps, np.linalg.norm(X, ord=2, axis=-1, keepdims=True))
|
39 |
+
```
|
40 |
+
|
41 |
+
또한, `index factory`의 3번째 인수에 건네주는 값을 선택하는 것을 통해 계산에 사용하는 거리 index를 변경할 수 있습니다.
|
42 |
+
|
43 |
+
```python
|
44 |
+
index = Faiss.index_factory(dimention, text, Faiss.METRIC_INNER_PRODUCT)
|
45 |
+
```
|
46 |
+
|
47 |
+
## IVF
|
48 |
+
IVF (Inverted file indexes)는 역색인 탐색법과 유사한 알고리즘입니다. 학습시에는 검색 대상에 대해 k-평균 군집법을 실시하고 클러스터 중심을 이용해 보로노이 분할을 실시합니다. 각 데이터 포인트에는 클러스터가 할당되므로, 클러스터에서 데이터 포인트를 조회하는 dictionary를 만듭니다.
|
49 |
+
|
50 |
+
예를 들어, 클러스터가 다음과 같이 할당된 경우
|
51 |
+
|index|Cluster|
|
52 |
+
|-----|-------|
|
53 |
+
|1|A|
|
54 |
+
|2|B|
|
55 |
+
|3|A|
|
56 |
+
|4|C|
|
57 |
+
|5|B|
|
58 |
+
|
59 |
+
IVF 이후의 결과는 다음과 같습니다:
|
60 |
+
|
61 |
+
|cluster|index|
|
62 |
+
|-------|-----|
|
63 |
+
|A|1, 3|
|
64 |
+
|B|2, 5|
|
65 |
+
|C|4|
|
66 |
+
|
67 |
+
탐색 시, 우선 클러스터에서 `n_probe`개의 클러스터를 탐색한 다음, 각 클러스터에 속한 데이터 포인트의 거리를 계산합니다.
|
68 |
+
|
69 |
+
# 권장 매개변수
|
70 |
+
index의 선택 방법에 대해서는 공식적으로 가이드 라인이 있으므로, 거기에 준해 설명합니다.
|
71 |
+
https://github.com/facebookresearch/Faiss/wiki/Guidelines-to-choose-an-index
|
72 |
+
|
73 |
+
1M 이하의 데이터 세트에 있어서는 4bit-PQ가 2023년 4월 시점에서는 Faiss로 이용할 수 있는 가장 효율적인 수법입니다. 이것을 IVF와 조합해, 4bit-PQ로 후보를 추려내고, 마지막으로 이하의 index factory를 이용하여 정확한 지표로 거리��� 재계산하면 됩니다.
|
74 |
+
|
75 |
+
```python
|
76 |
+
index = Faiss.index_factory(256, "IVF1024,PQ128x4fs,RFlat")
|
77 |
+
```
|
78 |
+
|
79 |
+
## IVF 권장 매개변수
|
80 |
+
IVF의 수가 너무 많으면, 가령 데이터 수의 수만큼 IVF로 양자화(Quantization)를 수행하면, 이것은 완전탐색과 같아져 효율이 나빠지게 됩니다. 1M 이하의 경우 IVF 값은 데이터 포인트 수 N에 대해 4sqrt(N) ~ 16sqrt(N)를 사용하는 것을 권장합니다.
|
81 |
+
|
82 |
+
n_probe는 n_probe의 수에 비례하여 계산 시간이 늘어나므로 정확도와 시간을 적절히 균형을 맞추어 주십시오. 개인적으로 RVC에 있어서 그렇게까지 정확도는 필요 없다고 생각하기 때문에 n_probe = 1이면 된다고 생각합니다.
|
83 |
+
|
84 |
+
## FastScan
|
85 |
+
FastScan은 직적 양자화를 레지스터에서 수행함으로써 거리의 고속 근사를 가능하게 하는 방법입니다.직적 양자화는 학습시에 d차원마다(보통 d=2)에 독립적으로 클러스터링을 실시해, 클러스터끼리의 거리를 사전 계산해 lookup table를 작성합니다. 예측시는 lookup table을 보면 각 차원의 거리를 O(1)로 계산할 수 있습니다. 따라서 PQ 다음에 지정하는 숫자는 일반적으로 벡터의 절반 차원을 지정합니다.
|
86 |
+
|
87 |
+
FastScan에 대한 자세한 설명은 공식 문서를 참조하십시오.
|
88 |
+
https://github.com/facebookresearch/Faiss/wiki/Fast-accumulation-of-PQ-and-AQ-codes-(FastScan)
|
89 |
+
|
90 |
+
## RFlat
|
91 |
+
RFlat은 FastScan이 계산한 대략적인 거리를 index factory의 3번째 인수로 지정한 정확한 거리로 다시 계산하라는 인스트럭션입니다. k개의 근접 변수를 가져올 때 k*k_factor개의 점에 대해 재계산이 이루어집니다.
|
92 |
+
|
93 |
+
# Embedding 테크닉
|
94 |
+
## Alpha 쿼리 확장
|
95 |
+
퀴리 확장이란 탐색에서 사용되는 기술로, 예를 들어 전문 탐색 시, 입력된 검색문에 단어를 몇 개를 추가함으로써 검색 정확도를 올리는 방법입니다. 백터 탐색을 위해서도 몇가지 방법이 제안되었는데, 그 중 α-쿼리 확장은 추가 학습이 필요 없는 매우 효과적인 방법으로 알려져 있습니다. [Attention-Based Query Expansion Learning](https://arxiv.org/abs/2007.08019)와 [2nd place solution of kaggle shopee competition](https://www.kaggle.com/code/lyakaap/2nd-place-solution/notebook) 논문에서 소개된 바 있습니다..
|
96 |
+
|
97 |
+
α-쿼리 확장은 한 벡터에 인접한 벡터를 유사도의 α곱한 가중치로 더해주면 됩니다. 코드로 예시를 들어 보겠습니다. big_npy를 α query expansion로 대체합니다.
|
98 |
+
|
99 |
+
```python
|
100 |
+
alpha = 3.
|
101 |
+
index = Faiss.index_factory(256, "IVF512,PQ128x4fs,RFlat")
|
102 |
+
original_norm = np.maximum(np.linalg.norm(big_npy, ord=2, axis=1, keepdims=True), 1e-9)
|
103 |
+
big_npy /= original_norm
|
104 |
+
index.train(big_npy)
|
105 |
+
index.add(big_npy)
|
106 |
+
dist, neighbor = index.search(big_npy, num_expand)
|
107 |
+
|
108 |
+
expand_arrays = []
|
109 |
+
ixs = np.arange(big_npy.shape[0])
|
110 |
+
for i in range(-(-big_npy.shape[0]//batch_size)):
|
111 |
+
ix = ixs[i*batch_size:(i+1)*batch_size]
|
112 |
+
weight = np.power(np.einsum("nd,nmd->nm", big_npy[ix], big_npy[neighbor[ix]]), alpha)
|
113 |
+
expand_arrays.append(np.sum(big_npy[neighbor[ix]] * np.expand_dims(weight, axis=2),axis=1))
|
114 |
+
big_npy = np.concatenate(expand_arrays, axis=0)
|
115 |
+
|
116 |
+
# index version 정규화
|
117 |
+
big_npy = big_npy / np.maximum(np.linalg.norm(big_npy, ord=2, axis=1, keepdims=True), 1e-9)
|
118 |
+
```
|
119 |
+
|
120 |
+
위 테크닉은 탐색을 수행하는 쿼리에도, 탐색 대상 DB에도 적응 가능한 테크닉입니다.
|
121 |
+
|
122 |
+
## MiniBatch KMeans에 의한 embedding 압축
|
123 |
+
|
124 |
+
total_fea.npy가 너무 클 경우 K-means를 이용하여 벡터를 작게 만드는 것이 가능합니다. 이하 코드로 embedding의 압축이 가능합니다. n_clusters에 압축하고자 하는 크기를 지정하고 batch_size에 256 * CPU의 코어 수를 지정함으로써 CPU 병렬화의 혜택을 충분히 얻을 수 있습니다.
|
125 |
+
|
126 |
+
```python
|
127 |
+
import multiprocessing
|
128 |
+
from sklearn.cluster import MiniBatchKMeans
|
129 |
+
kmeans = MiniBatchKMeans(n_clusters=10000, batch_size=256 * multiprocessing.cpu_count(), init="random")
|
130 |
+
kmeans.fit(big_npy)
|
131 |
+
sample_npy = kmeans.cluster_centers_
|
132 |
+
```
|
docs/faq.md
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Q1:ffmpeg error/utf8 error.
|
2 |
+
|
3 |
+
大概率不是ffmpeg问题,而是音频路径问题;<br>
|
4 |
+
ffmpeg读取路径带空格、()等特殊符号,可能出现ffmpeg error;训练集音频带中文路径,在写入filelist.txt的时候可能出现utf8 error;<br>
|
5 |
+
|
6 |
+
## Q2:一键训练结束没有索引
|
7 |
+
|
8 |
+
显示"Training is done. The program is closed."则模型训练成功,后续紧邻的报错是假的;<br>
|
9 |
+
|
10 |
+
一键训练结束完成没有added开头的索引文件,可能是因为训练集太大卡住了添加索引的步骤;已通过批处理add索引解决内存add索引对内存需求过大的问题。临时可尝试再次点击"训练索引"按钮。<br>
|
11 |
+
|
12 |
+
## Q3:训练结束推理没看到训练集的音色
|
13 |
+
点刷新音色再看看,如果还没有看看训练有没有报错,控制台和webui的截图,logs/实验名下的log,都可以发给开发者看看。<br>
|
14 |
+
|
15 |
+
## Q4:如何分享模型
|
16 |
+
rvc_root/logs/实验名 下面存储的pth不是用来分享模型用来推理的,而是为了存储实验状态供复现,以及继续训练用的。用来分享的模型应该是weights文件夹下大小为60+MB的pth文件;<br>
|
17 |
+
后续将把weights/exp_name.pth和logs/exp_name/added_xxx.index合并打包成weights/exp_name.zip省去填写index的步骤,那么zip文件用来分享,不要分享pth文件,除非是想换机器继续训练;<br>
|
18 |
+
如果你把logs文件夹下的几百MB的pth文件复制/分享到weights文件夹下强行用于推理,可能会出现f0,tgt_sr等各种key不存在的报错。你需要用ckpt选项卡最下面,手工或自动(本地logs下如果能找到相关信息则会自动)选择是否携带音高、目标音频采样率的选项后进行ckpt小模型提取(输入路径填G开头的那个),提取完在weights文件夹下会出现60+MB的pth文件,刷新音色后可以选择使用。<br>
|
19 |
+
|
20 |
+
## Q5:Connection Error.
|
21 |
+
也许你关闭了控制台(黑色窗口)。<br>
|
22 |
+
|
23 |
+
## Q6:WebUI弹出Expecting value: line 1 column 1 (char 0).
|
24 |
+
请关闭系统局域网代理/全局代理。<br>
|
25 |
+
|
26 |
+
这个不仅是客户端的代理,也包括服务端的代理(例如你使用autodl设置了http_proxy和https_proxy学术加速,使用时也需要unset关掉)<br>
|
27 |
+
|
28 |
+
## Q7:不用WebUI如何通过命令训练推理
|
29 |
+
训练脚本:<br>
|
30 |
+
可先跑通WebUI,消息窗内会显示数据集处理和训练用命令行;<br>
|
31 |
+
|
32 |
+
推理脚本:<br>
|
33 |
+
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py<br>
|
34 |
+
|
35 |
+
例子:<br>
|
36 |
+
|
37 |
+
runtime\python.exe myinfer.py 0 "E:\codes\py39\RVC-beta\todo-songs\1111.wav" "E:\codes\py39\logs\mi-test\added_IVF677_Flat_nprobe_7.index" harvest "test.wav" "weights/mi-test.pth" 0.6 cuda:0 True<br>
|
38 |
+
|
39 |
+
f0up_key=sys.argv[1]<br>
|
40 |
+
input_path=sys.argv[2]<br>
|
41 |
+
index_path=sys.argv[3]<br>
|
42 |
+
f0method=sys.argv[4]#harvest or pm<br>
|
43 |
+
opt_path=sys.argv[5]<br>
|
44 |
+
model_path=sys.argv[6]<br>
|
45 |
+
index_rate=float(sys.argv[7])<br>
|
46 |
+
device=sys.argv[8]<br>
|
47 |
+
is_half=bool(sys.argv[9])<br>
|
48 |
+
|
49 |
+
## Q8:Cuda error/Cuda out of memory.
|
50 |
+
小概率是cuda配置问题、设备不支持;大概率是显存不够(out of memory);<br>
|
51 |
+
|
52 |
+
训练的话缩小batch size(如果缩小到1还不够只能更换显卡训练),推理的话酌情缩小config.py结尾的x_pad,x_query,x_center,x_max。4G以下显存(例如1060(3G)和各种2G显卡)可以直接放弃,4G显存显卡还有救。<br>
|
53 |
+
|
54 |
+
## Q9:total_epoch调多少比较好
|
55 |
+
|
56 |
+
如果训练集音质差底噪大,20~30足够了,调太高,底模音质无法带高你的低音质训练集<br>
|
57 |
+
如果训练集音质高底噪低时长多,可以调高,200是ok的(训练速度很快,既然你有条件准备高音质训练集,显卡想必条件也不错,肯定不在乎多一些训练时间)<br>
|
58 |
+
|
59 |
+
## Q10:需要多少训练集时长
|
60 |
+
推荐10min至50min<br>
|
61 |
+
保证音质高底噪低的情况下,如果有个人特色的音色统一,则多多益善<br>
|
62 |
+
高水平的训练集(精简+音色有特色),5min至10min也是ok的,仓库作者本人就经常这么玩<br>
|
63 |
+
也有人拿1min至2min的数据来训练并且训练成功的,但是成功经验是其他人不可复现的,不太具备参考价值。这要求训练集音色特色非常明显(比如说高频气声较明显的萝莉少女音),且音质高;<br>
|
64 |
+
1min以下时长数据目前没见有人尝试(成功)过。不建议进行这种鬼畜行为。<br>
|
65 |
+
|
66 |
+
## Q11:index rate干嘛用的,怎么调(科普)
|
67 |
+
如果底模和推理源的音质高于训练集的音质,他们可以带高推理结果的音质,但代价可能是音色往底模/推理源的音色靠,这种现象叫做"音色泄露";<br>
|
68 |
+
index rate用来削减/解决音色泄露问题。调到1,则理论上不存在推理源的音色泄露问题,但音质更倾向于训练集。如果训练集音质比推理源低,则index rate调高可能降低音质。调到0,则不具备利用检索混合来保护训练集音色的效果;<br>
|
69 |
+
如果训练集优���时长多,可调高total_epoch,此时模型本身不太会引用推理源和底模的音色,很少存在"音色泄露"问题,此时index_rate不重要,你甚至可以不建立/分享index索引文件。<br>
|
70 |
+
|
71 |
+
## Q11:推理怎么选gpu
|
72 |
+
config.py文件里device cuda:后面选择卡号;<br>
|
73 |
+
卡号和显卡的映射关系,在训练选项卡的显卡信息栏里能看到。<br>
|
74 |
+
|
75 |
+
## Q12:如何推理训练中间保存的pth
|
76 |
+
通过ckpt选项卡最下面提取小模型。<br>
|
77 |
+
|
78 |
+
|
79 |
+
## Q13:如何中断和继续训练
|
80 |
+
现阶段只能关闭WebUI控制台双击go-web.bat重启程序。网页参数也要刷新重新填写;<br>
|
81 |
+
继续训练:相同网页参数点训练模型,就会接着上次的checkpoint继续训练。<br>
|
82 |
+
|
83 |
+
## Q14:训练时出现文件页面/内存error
|
84 |
+
进程开太多了,内存炸了。你可能可以通过如下方式解决<br>
|
85 |
+
1、"提取音高和处理数据使用的CPU进程数" 酌情拉低;<br>
|
86 |
+
2、训练集音频手工切一下,不要太长。<br>
|
87 |
+
|
88 |
+
|
89 |
+
|
docs/faq_en.md
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Q1:ffmpeg error/utf8 error.
|
2 |
+
It is most likely not a FFmpeg issue, but rather an audio path issue;
|
3 |
+
|
4 |
+
FFmpeg may encounter an error when reading paths containing special characters like spaces and (), which may cause an FFmpeg error; and when the training set's audio contains Chinese paths, writing it into filelist.txt may cause a utf8 error.<br>
|
5 |
+
|
6 |
+
## Q2:Cannot find index file after "One-click Training".
|
7 |
+
If it displays "Training is done. The program is closed," then the model has been trained successfully, and the subsequent errors are fake;
|
8 |
+
|
9 |
+
The lack of an 'added' index file after One-click training may be due to the training set being too large, causing the addition of the index to get stuck; this has been resolved by using batch processing to add the index, which solves the problem of memory overload when adding the index. As a temporary solution, try clicking the "Train Index" button again.<br>
|
10 |
+
|
11 |
+
## Q3:Cannot find the model in “Inferencing timbre” after training
|
12 |
+
Click “Refresh timbre list” and check again; if still not visible, check if there are any errors during training and send screenshots of the console, web UI, and logs/experiment_name/*.log to the developers for further analysis.<br>
|
13 |
+
|
14 |
+
## Q4:How to share a model/How to use others' models?
|
15 |
+
The pth files stored in rvc_root/logs/experiment_name are not meant for sharing or inference, but for storing the experiment checkpoits for reproducibility and further training. The model to be shared should be the 60+MB pth file in the weights folder;
|
16 |
+
|
17 |
+
In the future, weights/exp_name.pth and logs/exp_name/added_xxx.index will be merged into a single weights/exp_name.zip file to eliminate the need for manual index input; so share the zip file, not the pth file, unless you want to continue training on a different machine;
|
18 |
+
|
19 |
+
Copying/sharing the several hundred MB pth files from the logs folder to the weights folder for forced inference may result in errors such as missing f0, tgt_sr, or other keys. You need to use the ckpt tab at the bottom to manually or automatically (if the information is found in the logs/exp_name), select whether to include pitch infomation and target audio sampling rate options and then extract the smaller model. After extraction, there will be a 60+ MB pth file in the weights folder, and you can refresh the voices to use it.<br>
|
20 |
+
|
21 |
+
## Q5:Connection Error.
|
22 |
+
You may have closed the console (black command line window).<br>
|
23 |
+
|
24 |
+
## Q6:WebUI popup 'Expecting value: line 1 column 1 (char 0)'.
|
25 |
+
Please disable system LAN proxy/global proxy and then refresh.<br>
|
26 |
+
|
27 |
+
## Q7:How to train and infer without the WebUI?
|
28 |
+
Training script:<br>
|
29 |
+
You can run training in WebUI first, and the command-line versions of dataset preprocessing and training will be displayed in the message window.<br>
|
30 |
+
|
31 |
+
Inference script:<br>
|
32 |
+
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py<br>
|
33 |
+
|
34 |
+
|
35 |
+
e.g.<br>
|
36 |
+
|
37 |
+
runtime\python.exe myinfer.py 0 "E:\codes\py39\RVC-beta\todo-songs\1111.wav" "E:\codes\py39\logs\mi-test\added_IVF677_Flat_nprobe_7.index" harvest "test.wav" "weights/mi-test.pth" 0.6 cuda:0 True<br>
|
38 |
+
|
39 |
+
|
40 |
+
f0up_key=sys.argv[1]<br>
|
41 |
+
input_path=sys.argv[2]<br>
|
42 |
+
index_path=sys.argv[3]<br>
|
43 |
+
f0method=sys.argv[4]#harvest or pm<br>
|
44 |
+
opt_path=sys.argv[5]<br>
|
45 |
+
model_path=sys.argv[6]<br>
|
46 |
+
index_rate=float(sys.argv[7])<br>
|
47 |
+
device=sys.argv[8]<br>
|
48 |
+
is_half=bool(sys.argv[9])<br>
|
49 |
+
|
50 |
+
## Q8:Cuda error/Cuda out of memory.
|
51 |
+
There is a small chance that there is a problem with the CUDA configuration or the device is not supported; more likely, there is not enough memory (out of memory).<br>
|
52 |
+
|
53 |
+
For training, reduce the batch size (if reducing to 1 is still not enough, you may need to change the graphics card); for inference, adjust the x_pad, x_query, x_center, and x_max settings in the config.py file as needed. 4G or lower memory cards (e.g. 1060(3G) and various 2G cards) can be abandoned, while 4G memory cards still have a chance.<br>
|
54 |
+
|
55 |
+
## Q9:How many total_epoch are optimal?
|
56 |
+
If the training dataset's audio quality is poor and the noise floor is high, 20-30 epochs are sufficient. Setting it too high won't improve the audio quality of your low-quality training set.<br>
|
57 |
+
|
58 |
+
If the training set audio quality is high, the noise floor is low, and there is sufficient duration, you can increase it. 200 is acceptable (since training is fast, and if you're able to prepare a high-quality training set, your GPU likely can handle a longer training duration without issue).<br>
|
59 |
+
|
60 |
+
## Q10:How much training set duration is needed?
|
61 |
+
|
62 |
+
A dataset of around 10min to 50min is recommended.<br>
|
63 |
+
|
64 |
+
With guaranteed high sound quality and low bottom noise, more can be added if the dataset's timbre is uniform.<br>
|
65 |
+
|
66 |
+
For a high-level training set (lean + distinctive tone), 5min to 10min is fine.<br>
|
67 |
+
|
68 |
+
There are some people who have trained successfully with 1min to 2min data, but the success is not reproducible by others and is not very informative. <br>This requires that the training set has a very distinctive timbre (e.g. a high-frequency airy anime girl sound) and the quality of the audio is high;
|
69 |
+
Data of less than 1min duration has not been successfully attempted so far. This is not recommended.<br>
|
70 |
+
|
71 |
+
|
72 |
+
## Q11:What is the index rate for and how to adjust it?
|
73 |
+
If the tone quality of the pre-trained model and inference source is higher than that of the training set, they can bring up the tone quality of the inference result, but at the cost of a possible tone bias towards the tone of the underlying model/inference source rather than the tone of the training set, which is generally referred to as "tone leakage".<br>
|
74 |
+
|
75 |
+
The index rate is used to reduce/resolve the timbre leakage problem. If the index rate is set to 1, theoretically there is no timbre leakage from the inference source and the timbre quality is more biased towards the training set. If the training set has a lower sound quality than the inference source, then a higher index rate may reduce the sound quality. Turning it down to 0 does not have the effect of using retrieval blending to protect the training set tones.<br>
|
76 |
+
|
77 |
+
If the training set has good audio quality and long duration, turn up the total_epoch, when the model itself is less likely to refer to the inferred source and the pretrained underlying model, and there is little "tone leakage", the index_rate is not important and you can even not create/share the index file.<br>
|
78 |
+
|
79 |
+
## Q12:How to choose the gpu when inferring?
|
80 |
+
In the config.py file, select the card number after "device cuda:".<br>
|
81 |
+
|
82 |
+
The mapping between card number and graphics card can be seen in the graphics card information section of the training tab.<br>
|
83 |
+
|
84 |
+
## Q13:How to use the model saved in the middle of training?
|
85 |
+
Save via model extraction at the bottom of the ckpt processing tab.
|
86 |
+
|
87 |
+
## Q14:File/memory error(when training)?
|
88 |
+
Too many processes and your memory is not enough. You may fix it by:
|
89 |
+
|
90 |
+
1、decrease the input in field "Threads of CPU".
|
91 |
+
|
92 |
+
2、pre-cut trainset to shorter audio files.
|
93 |
+
|
94 |
+
|
95 |
+
|
docs/training_tips_en.md
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Instructions and tips for RVC training
|
2 |
+
======================================
|
3 |
+
This TIPS explains how data training is done.
|
4 |
+
|
5 |
+
# Training flow
|
6 |
+
I will explain along the steps in the training tab of the GUI.
|
7 |
+
|
8 |
+
## step1
|
9 |
+
Set the experiment name here.
|
10 |
+
|
11 |
+
You can also set here whether the model should take pitch into account.
|
12 |
+
If the model doesn't consider pitch, the model will be lighter, but not suitable for singing.
|
13 |
+
|
14 |
+
Data for each experiment is placed in `/logs/your-experiment-name/`.
|
15 |
+
|
16 |
+
## step2a
|
17 |
+
Loads and preprocesses audio.
|
18 |
+
|
19 |
+
### load audio
|
20 |
+
If you specify a folder with audio, the audio files in that folder will be read automatically.
|
21 |
+
For example, if you specify `C:Users\hoge\voices`, `C:Users\hoge\voices\voice.mp3` will be loaded, but `C:Users\hoge\voices\dir\voice.mp3` will Not loaded.
|
22 |
+
|
23 |
+
Since ffmpeg is used internally for reading audio, if the extension is supported by ffmpeg, it will be read automatically.
|
24 |
+
After converting to int16 with ffmpeg, convert to float32 and normalize between -1 to 1.
|
25 |
+
|
26 |
+
### denoising
|
27 |
+
The audio is smoothed by scipy's filtfilt.
|
28 |
+
|
29 |
+
### Audio Split
|
30 |
+
First, the input audio is divided by detecting parts of silence that last longer than a certain period (max_sil_kept=5 seconds?). After splitting the audio on silence, split the audio every 4 seconds with an overlap of 0.3 seconds. For audio separated within 4 seconds, after normalizing the volume, convert the wav file to `/logs/your-experiment-name/0_gt_wavs` and then convert it to 16k sampling rate to `/logs/your-experiment-name/1_16k_wavs ` as a wav file.
|
31 |
+
|
32 |
+
## step2b
|
33 |
+
### Extract pitch
|
34 |
+
Extract pitch information from wav files. Extract the pitch information (=f0) using the method built into parselmouth or pyworld and save it in `/logs/your-experiment-name/2a_f0`. Then logarithmically convert the pitch information to an integer between 1 and 255 and save it in `/logs/your-experiment-name/2b-f0nsf`.
|
35 |
+
|
36 |
+
### Extract feature_print
|
37 |
+
Convert the wav file to embedding in advance using HuBERT. Read the wav file saved in `/logs/your-experiment-name/1_16k_wavs`, convert the wav file to 256-dimensional features with HuBERT, and save in npy format in `/logs/your-experiment-name/3_feature256`.
|
38 |
+
|
39 |
+
## step3
|
40 |
+
train the model.
|
41 |
+
### Glossary for Beginners
|
42 |
+
In deep learning, the data set is divided and the learning proceeds little by little. In one model update (step), batch_size data are retrieved and predictions and error corrections are performed. Doing this once for a dataset counts as one epoch.
|
43 |
+
|
44 |
+
Therefore, the learning time is the learning time per step x (the number of data in the dataset / batch size) x the number of epochs. In general, the larger the batch size, the more stable the learning becomes (learning time per step ÷ batch size) becomes smaller, but it uses more GPU memory. GPU RAM can be checked with the nvidia-smi command. Learning can be done in a short time by increasing the batch size as much as possible according to the machine of the execution environment.
|
45 |
+
|
46 |
+
### Specify pretrained model
|
47 |
+
RVC starts training the model from pretrained weights instead of from 0, so it can be trained with a small dataset.
|
48 |
+
|
49 |
+
By default
|
50 |
+
|
51 |
+
- If you consider pitch, it loads `rvc-location/pretrained/f0G40k.pth` and `rvc-location/pretrained/f0D40k.pth`.
|
52 |
+
- If you don't consider pitch, it loads `rvc-location/pretrained/f0G40k.pth` and `rvc-location/pretrained/f0D40k.pth`.
|
53 |
+
|
54 |
+
When learning, model parameters are saved in `logs/your-experiment-name/G_{}.pth` and `logs/your-experiment-name/D_{}.pth` for each save_every_epoch, but by specifying this path, you can start learning. You can restart or start training from model weights learned in a different experiment.
|
55 |
+
|
56 |
+
### learning index
|
57 |
+
RVC saves the HuBERT feature values used during training, and during inference, searches for feature values that are similar to the feature values used during learning to perform inference. In order to perform this search at high speed, the index is learned in advance.
|
58 |
+
For index learning, we use the approximate neighborhood search library faiss. Read the feature value of `logs/your-experiment-name/3_feature256` and use it to learn the index, and save it as `logs/your-experiment-name/add_XXX.index`.
|
59 |
+
|
60 |
+
(From the 20230428update version, it is read from the index, and saving / specifying is no longer necessary.)
|
61 |
+
|
62 |
+
### Button description
|
63 |
+
- Train model: After executing step2b, press this button to train the model.
|
64 |
+
- Train feature index: After training the model, perform index learning.
|
65 |
+
- One-click training: step2b, model training and feature index training all at once.
|
docs/training_tips_ja.md
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
RVCの訓練における説明、およびTIPS
|
2 |
+
===============================
|
3 |
+
本TIPSではどのようにデータの訓練が行われているかを説明します。
|
4 |
+
|
5 |
+
# 訓練の流れ
|
6 |
+
GUIの訓練タブのstepに沿って説明します。
|
7 |
+
|
8 |
+
## step1
|
9 |
+
実験名の設定を行います。
|
10 |
+
|
11 |
+
また、モデルに音高ガイド(ピッチ)を考慮させるかもここで設定できます。考慮させない場合はモデルは軽量になりますが、歌唱には向かなくなります。
|
12 |
+
|
13 |
+
各実験のデータは`/logs/実験名/`に配置されます。
|
14 |
+
|
15 |
+
## step2a
|
16 |
+
音声の読み込みと前処理を行います。
|
17 |
+
|
18 |
+
### load audio
|
19 |
+
音声のあるフォルダを指定すると、そのフォルダ内にある音声ファイルを自動で読み込みます。
|
20 |
+
例えば`C:Users\hoge\voices`を指定した場合、`C:Users\hoge\voices\voice.mp3`は読み込まれますが、`C:Users\hoge\voices\dir\voice.mp3`は読み込まれません。
|
21 |
+
|
22 |
+
音声の読み込みには内部でffmpegを利用しているので、ffmpegで対応している拡張子であれば自動的に読み込まれます。
|
23 |
+
ffmpegでint16に変換した後、float32に変換し、-1 ~ 1の間に正規化されます。
|
24 |
+
|
25 |
+
### denoising
|
26 |
+
音声についてscipyのfiltfiltによる平滑化を行います。
|
27 |
+
|
28 |
+
### 音声の分割
|
29 |
+
入力した音声はまず、一定期間(max_sil_kept=5秒?)より長く無音が続く部分を検知して音声を分割します。無音で音声を分割した後は、0.3秒のoverlapを含む4秒ごとに音声を分割します。4秒以内に区切られた音声は、音量の正規化を行った後wavファイルを`/logs/実験名/0_gt_wavs`に、そこから16kのサンプリングレートに変換して`/logs/実験名/1_16k_wavs`にwavファイルで保存します。
|
30 |
+
|
31 |
+
## step2b
|
32 |
+
### ピッチの抽出
|
33 |
+
wavファイルからピッチ(音の高低)の情報を抽出します。parselmouthやpyworldに内蔵されている手法でピッチ情報(=f0)を抽出し、`/logs/実験名/2a_f0`に保存します。その後、ピッチ情報を対数で変換して1~255の整数に変換し、`/logs/実験名/2b-f0nsf`に保存します。
|
34 |
+
|
35 |
+
### feature_printの抽出
|
36 |
+
HuBERTを用いてwavファイルを事前にembeddingに変換します。`/logs/実験名/1_16k_wavs`に保存したwavファイルを読み込み、HuBERTでwavファイルを256次元の特徴量に変換し、npy形式で`/logs/実験名/3_feature256`に保存します。
|
37 |
+
|
38 |
+
## step3
|
39 |
+
モデルのトレーニングを行います。
|
40 |
+
### 初心者向け用語解説
|
41 |
+
深層学習ではデータセットを分割し、少しずつ学習を進めていきます。一回のモデルの更新(step)では、batch_size個のデータを取り出し予測と誤差の修正を行います。これをデータセットに対して一通り行うと一epochと数えます。
|
42 |
+
|
43 |
+
そのため、学習時間は 1step当たりの学習時間 x (データセット内のデータ数 ÷ バッチサイズ) x epoch数 かかります。一般にバッチサイズを大きくするほど学習は安定し、(1step当たりの学習時間÷バッチサイズ)は小さくなりますが、その分GPUのメモリを多く使用します。GPUのRAMはnvidia-smiコマンド等で確認できます。実行環境のマシンに合わせてバッチサイズをできるだけ大きくするとより短時間で学習が可能です。
|
44 |
+
|
45 |
+
### pretrained modelの指定
|
46 |
+
RVCではモデルの訓練を0からではなく、事前学習済みの重みから開始するため、少ないデータセットで学習を行えます。
|
47 |
+
|
48 |
+
デフォルトでは
|
49 |
+
|
50 |
+
- 音高ガイドを考慮する場合、`RVCのある場所/pretrained/f0G40k.pth`と`RVCのある場所/pretrained/f0D40k.pth`を読み込みます。
|
51 |
+
- 音高ガイドを考慮しない場合、`RVCのある場所/pretrained/G40k.pth`と`RVCのある場所/pretrained/D40k.pth`を読み込みます。
|
52 |
+
|
53 |
+
学習時はsave_every_epochごとにモデルのパラメータが`logs/実験名/G_{}.pth`と`logs/実験名/D_{}.pth`に保存されますが、このパスを指定することで学習を再開したり、もしくは違う実験で学習したモデルの重みから学習を開始できます。
|
54 |
+
|
55 |
+
### indexの学習
|
56 |
+
RVCでは学習時に使われたHuBERTの特徴量を保存し、推論時は学習時の特徴量から近い特徴量を探してきて推論を行います。この検索を高速に行うために事前にindexの学習を行います。
|
57 |
+
indexの学習には近似近傍探索ライブラリのfaissを用います。`/logs/実験名/3_feature256`の特徴量を読み込み、それを用いて学習したindexを`/logs/実験名/add_XXX.index`として保存します。
|
58 |
+
(20230428updateよりtotal_fea.npyはindexから読み込むので不要になりました。)
|
59 |
+
|
60 |
+
### ボタンの説明
|
61 |
+
- モデルのトレーニング: step2bまでを実行した後、このボタンを押すとモデルの学習を行います。
|
62 |
+
- 特徴インデックスのトレーニング: モデルのトレーニング後、indexの学習を行います。
|
63 |
+
- ワンクリックトレーニング: step2bまでとモデルのトレーニング、特徴インデックスのトレーニングを一括で行います。
|
64 |
+
|
docs/training_tips_ko.md
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
RVC 훈련에 대한 설명과 팁들
|
2 |
+
======================================
|
3 |
+
본 팁에서는 어떻게 데이터 훈련이 이루어지고 있는지 설명합니다.
|
4 |
+
|
5 |
+
# 훈련의 흐름
|
6 |
+
GUI의 훈련 탭의 단계를 따라 설명합니다.
|
7 |
+
|
8 |
+
## step1
|
9 |
+
실험 이름을 지정합니다. 또한, 모델이 피치(소리의 높낮이)를 고려해야 하는지 여부를 여기에서 설정할 수도 있습니다..
|
10 |
+
각 실험을 위한 데이터는 `/logs/experiment name/`에 배치됩니다..
|
11 |
+
|
12 |
+
## step2a
|
13 |
+
음성 파일을 불러오고 전처리합니다.
|
14 |
+
|
15 |
+
### 음성 파일 불러오기
|
16 |
+
음성 파일이 있는 폴더를 지정하면 해당 폴더에 있는 음성 파일이 자동으로 가져와집니다.
|
17 |
+
예를 들어 `C:Users\hoge\voices`를 지정하면 `C:Users\hoge\voices\voice.mp3`가 읽히지만 `C:Users\hoge\voices\dir\voice.mp3`는 읽히지 않습니다.
|
18 |
+
|
19 |
+
음성 로드에는 내부적으로 ffmpeg를 이용하고 있으므로, ffmpeg로 대응하고 있는 확장자라면 자동적으로 읽힙니다.
|
20 |
+
ffmpeg에서 int16으로 변환한 후 float32로 변환하고 -1과 1 사이에 정규화됩니다.
|
21 |
+
|
22 |
+
### 잡음 제거
|
23 |
+
음성 파일에 대해 scipy의 filtfilt를 이용하여 잡음을 처리합니다.
|
24 |
+
|
25 |
+
### 음성 분할
|
26 |
+
입력한 음성 파일은 먼저 일정 기간(max_sil_kept=5초?)보다 길게 무음이 지속되는 부분을 감지하여 음성을 분할합니다.무음으로 음성을 분할한 후에는 0.3초의 overlap을 포함하여 4초마다 음성을 분할합니다.4초 이내에 구분된 음성은 음량의 정규화를 실시한 후 wav 파일을 `/logs/실험명/0_gt_wavs`로, 거기에서 16k의 샘플링 레이트로 변환해 `/logs/실험명/1_16k_wavs`에 wav 파일로 저장합니다.
|
27 |
+
|
28 |
+
## step2b
|
29 |
+
### 피치 추출
|
30 |
+
wav 파일에서 피치(소리의 높낮이) 정보를 추출합니다. parselmouth나 pyworld에 내장되어 있는 메서드으로 피치 정보(=f0)를 추출해, `/logs/실험명/2a_f0`에 저장합니다. 그 후 피치 정보를 로그로 변환하여 1~255 정수로 변환하고 `/logs/실험명/2b-f0nsf`에 저장합니다.
|
31 |
+
|
32 |
+
### feature_print 추출
|
33 |
+
HuBERT를 이용하여 wav 파일을 미리 embedding으로 변환합니다. `/logs/실험명/1_16k_wavs`에 저장한 wav 파일을 읽고 HuBERT에서 wav 파일을 256차원 feature들로 변환한 후 npy 형식으로 `/logs/실험명/3_feature256`에 저장합니다.
|
34 |
+
|
35 |
+
## step3
|
36 |
+
모델의 훈련을 진행합니다.
|
37 |
+
|
38 |
+
### 초보자용 용어 해설
|
39 |
+
심층학습(딥러닝)에서는 데이터셋을 분할하여 조금씩 학습을 진행합니다.한 번의 모델 업데이트(step) 단계 당 batch_size개의 데이터를 탐색하여 예측과 오차를 수정합니다. 데이터셋 전부에 대해 이 작업을 한 번 수행하는 이를 하나의 epoch라고 계산합니다.
|
40 |
+
|
41 |
+
따라서 학습 시간은 단계당 학습 시간 x (데이터셋 내 데이터의 수 / batch size) x epoch 수가 소요됩니다. 일반적으로 batch size가 클수록 학습이 안정적이게 됩니다. (step당 학습 시간 ÷ batch size)는 작아지지만 GPU 메모리를 더 많이 사용합니다. GPU RAM은 nvidia-smi 명령어를 통해 확인할 수 있습니다. 실행 환경에 따라 배치 크기를 최대한 늘리면 짧은 시간 내에 학습이 가능합니다.
|
42 |
+
|
43 |
+
### 사전 학습된 모델 지정
|
44 |
+
RVC는 적은 데이터셋으로도 훈련이 가능하도록 사전 훈련된 가중치에서 모델 훈련을 시작합니다. 기본적으로 `rvc-location/pretrained/f0G40k.pth` 및 `rvc-location/pretrained/f0D40k.pth`를 불러옵니다. 학습을 할 시에, 모델 파라미터는 각 save_every_epoch별로 `logs/experiment name/G_{}.pth` 와 `logs/experiment name/D_{}.pth`로 저장이 되는데, 이 경로를 지정함으로써 학습을 재개하거나, 다른 실험에서 학습한 모델의 가중치에서 학습을 시작할 수 있습니다.
|
45 |
+
|
46 |
+
### index의 학습
|
47 |
+
RVC에서는 학습시에 사용된 HuBERT의 feature값을 저장하고, 추론 시에는 학습 시 사용한 feature값과 유사한 feature 값을 탐색해 추론을 진행합니다. 이 탐색을 고속으로 수행하기 위해 사전에 index을 학습하게 됩니다.
|
48 |
+
Index 학습에는 근사 근접 탐색법 라이브러리인 Faiss를 사용하게 됩니다. `/logs/실험명/3_feature256`의 feature값을 불러와, 이를 모두 결합시킨 feature값을 `/logs/실험명/total_fea.npy`로서 저장, 그것을 사용해 학습한 index를`/logs/실험명/add_XXX.index`로 저장합니다.
|
49 |
+
|
50 |
+
### 버튼 설명
|
51 |
+
- モデルのトレーニング (모델 학습): step2b까지 실행한 후, 이 버튼을 눌러 모델을 학습합니다.
|
52 |
+
- 特徴インデックスのトレーニング (특징 지수 훈련): 모델의 훈련 후, index를 학습합니다.
|
53 |
+
- ワンクリックトレーニング (원클릭 트레이닝): step2b까지의 모델 훈련, feature index 훈련을 일괄로 실시합니다.
|
envfilescheck.bat
ADDED
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@echo off && chcp 65001
|
2 |
+
|
3 |
+
echo working dir is %cd%
|
4 |
+
echo downloading requirement aria2 check.
|
5 |
+
echo=
|
6 |
+
dir /a:d/b | findstr "aria2" > flag.txt
|
7 |
+
findstr "aria2" flag.txt >nul
|
8 |
+
if %errorlevel% ==0 (
|
9 |
+
echo aria2 checked.
|
10 |
+
echo=
|
11 |
+
) else (
|
12 |
+
echo failed. please downloading aria2 from webpage!
|
13 |
+
echo unzip it and put in this directory!
|
14 |
+
timeout /T 5
|
15 |
+
start https://github.com/aria2/aria2/releases/tag/release-1.36.0
|
16 |
+
echo=
|
17 |
+
goto end
|
18 |
+
)
|
19 |
+
|
20 |
+
echo envfiles checking start.
|
21 |
+
echo=
|
22 |
+
|
23 |
+
for /f %%x in ('findstr /i /c:"aria2" "flag.txt"') do (set aria2=%%x)&goto endSch
|
24 |
+
:endSch
|
25 |
+
|
26 |
+
set d32=f0D32k.pth
|
27 |
+
set d40=f0D40k.pth
|
28 |
+
set d48=f0D48k.pth
|
29 |
+
set g32=f0G32k.pth
|
30 |
+
set g40=f0G40k.pth
|
31 |
+
set g48=f0G48k.pth
|
32 |
+
|
33 |
+
set d40v2=f0D40k.pth
|
34 |
+
set g40v2=f0G40k.pth
|
35 |
+
|
36 |
+
set dld32=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D32k.pth
|
37 |
+
set dld40=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D40k.pth
|
38 |
+
set dld48=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D48k.pth
|
39 |
+
set dlg32=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G32k.pth
|
40 |
+
set dlg40=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G40k.pth
|
41 |
+
set dlg48=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G48k.pth
|
42 |
+
|
43 |
+
set dld40v2=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D40k.pth
|
44 |
+
set dlg40v2=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G40k.pth
|
45 |
+
|
46 |
+
set hp2_all=HP2_all_vocals.pth
|
47 |
+
set hp3_all=HP3_all_vocals.pth
|
48 |
+
set hp5_only=HP5_only_main_vocal.pth
|
49 |
+
set VR_DeEchoAggressive=VR-DeEchoAggressive.pth
|
50 |
+
set VR_DeEchoDeReverb=VR-DeEchoDeReverb.pth
|
51 |
+
set VR_DeEchoNormal=VR-DeEchoNormal.pth
|
52 |
+
set onnx_dereverb=vocals.onnx
|
53 |
+
|
54 |
+
set dlhp2_all=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2_all_vocals.pth
|
55 |
+
set dlhp3_all=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP3_all_vocals.pth
|
56 |
+
set dlhp5_only=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5_only_main_vocal.pth
|
57 |
+
set dlVR_DeEchoAggressive=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoAggressive.pth
|
58 |
+
set dlVR_DeEchoDeReverb=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoDeReverb.pth
|
59 |
+
set dlVR_DeEchoNormal=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoNormal.pth
|
60 |
+
set dlonnx_dereverb=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/onnx_dereverb_By_FoxJoy/vocals.onnx
|
61 |
+
|
62 |
+
set hb=hubert_base.pt
|
63 |
+
|
64 |
+
set dlhb=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt
|
65 |
+
|
66 |
+
echo dir check start.
|
67 |
+
echo=
|
68 |
+
|
69 |
+
if exist "%~dp0pretrained" (
|
70 |
+
echo dir .\pretrained checked.
|
71 |
+
) else (
|
72 |
+
echo failed. generating dir .\pretrained.
|
73 |
+
mkdir pretrained
|
74 |
+
)
|
75 |
+
if exist "%~dp0pretrained_v2" (
|
76 |
+
echo dir .\pretrained_v2 checked.
|
77 |
+
) else (
|
78 |
+
echo failed. generating dir .\pretrained_v2.
|
79 |
+
mkdir pretrained_v2
|
80 |
+
)
|
81 |
+
if exist "%~dp0uvr5_weights" (
|
82 |
+
echo dir .\uvr5_weights checked.
|
83 |
+
) else (
|
84 |
+
echo failed. generating dir .\uvr5_weights.
|
85 |
+
mkdir uvr5_weights
|
86 |
+
)
|
87 |
+
if exist "%~dp0uvr5_weights\onnx_dereverb_By_FoxJoy" (
|
88 |
+
echo dir .\uvr5_weights\onnx_dereverb_By_FoxJoy checked.
|
89 |
+
) else (
|
90 |
+
echo failed. generating dir .\uvr5_weights\onnx_dereverb_By_FoxJoy.
|
91 |
+
mkdir uvr5_weights\onnx_dereverb_By_FoxJoy
|
92 |
+
)
|
93 |
+
|
94 |
+
echo=
|
95 |
+
echo dir check finished.
|
96 |
+
|
97 |
+
echo=
|
98 |
+
echo required files check start.
|
99 |
+
|
100 |
+
echo checking D32k.pth
|
101 |
+
if exist "%~dp0pretrained\D32k.pth" (
|
102 |
+
echo D32k.pth in .\pretrained checked.
|
103 |
+
echo=
|
104 |
+
) else (
|
105 |
+
echo failed. starting download from huggingface.
|
106 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d %~dp0pretrained -o D32k.pth
|
107 |
+
if exist "%~dp0pretrained\D32k.pth" (echo download successful.) else (echo please try again!
|
108 |
+
echo=)
|
109 |
+
)
|
110 |
+
echo checking D40k.pth
|
111 |
+
if exist "%~dp0pretrained\D40k.pth" (
|
112 |
+
echo D40k.pth in .\pretrained checked.
|
113 |
+
echo=
|
114 |
+
) else (
|
115 |
+
echo failed. starting download from huggingface.
|
116 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d %~dp0pretrained -o D40k.pth
|
117 |
+
if exist "%~dp0pretrained\D40k.pth" (echo download successful.) else (echo please try again!
|
118 |
+
echo=)
|
119 |
+
)
|
120 |
+
echo checking D40k.pth
|
121 |
+
if exist "%~dp0pretrained_v2\D40k.pth" (
|
122 |
+
echo D40k.pth in .\pretrained_v2 checked.
|
123 |
+
echo=
|
124 |
+
) else (
|
125 |
+
echo failed. starting download from huggingface.
|
126 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/D40k.pth -d %~dp0pretrained_v2 -o D40k.pth
|
127 |
+
if exist "%~dp0pretrained_v2\D40k.pth" (echo download successful.) else (echo please try again!
|
128 |
+
echo=)
|
129 |
+
)
|
130 |
+
echo checking D48k.pth
|
131 |
+
if exist "%~dp0pretrained\D48k.pth" (
|
132 |
+
echo D48k.pth in .\pretrained checked.
|
133 |
+
echo=
|
134 |
+
) else (
|
135 |
+
echo failed. starting download from huggingface.
|
136 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d %~dp0pretrained -o D48k.pth
|
137 |
+
if exist "%~dp0pretrained\D48k.pth" (echo download successful.) else (echo please try again!
|
138 |
+
echo=)
|
139 |
+
)
|
140 |
+
echo checking G32k.pth
|
141 |
+
if exist "%~dp0pretrained\G32k.pth" (
|
142 |
+
echo G32k.pth in .\pretrained checked.
|
143 |
+
echo=
|
144 |
+
) else (
|
145 |
+
echo failed. starting download from huggingface.
|
146 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G32k.pth -d %~dp0pretrained -o G32k.pth
|
147 |
+
if exist "%~dp0pretrained\G32k.pth" (echo download successful.) else (echo please try again!
|
148 |
+
echo=)
|
149 |
+
)
|
150 |
+
echo checking G40k.pth
|
151 |
+
if exist "%~dp0pretrained\G40k.pth" (
|
152 |
+
echo G40k.pth in .\pretrained checked.
|
153 |
+
echo=
|
154 |
+
) else (
|
155 |
+
echo failed. starting download from huggingface.
|
156 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G40k.pth -d %~dp0pretrained -o G40k.pth
|
157 |
+
if exist "%~dp0pretrained\G40k.pth" (echo download successful.) else (echo please try again!
|
158 |
+
echo=)
|
159 |
+
)
|
160 |
+
echo checking G40k.pth
|
161 |
+
if exist "%~dp0pretrained_v2\G40k.pth" (
|
162 |
+
echo G40k.pth in .\pretrained_v2 checked.
|
163 |
+
echo=
|
164 |
+
) else (
|
165 |
+
echo failed. starting download from huggingface.
|
166 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/G40k.pth -d %~dp0pretrained_v2 -o G40k.pth
|
167 |
+
if exist "%~dp0pretrained_v2\G40k.pth" (echo download successful.) else (echo please try again!
|
168 |
+
echo=)
|
169 |
+
)
|
170 |
+
echo checking G48k.pth
|
171 |
+
if exist "%~dp0pretrained\G48k.pth" (
|
172 |
+
echo G48k.pth in .\pretrained checked.
|
173 |
+
echo=
|
174 |
+
) else (
|
175 |
+
echo failed. starting download from huggingface.
|
176 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G48k.pth -d %~dp0pretrained -o G48k.pth
|
177 |
+
if exist "%~dp0pretrained\G48k.pth" (echo download successful.) else (echo please try again!
|
178 |
+
echo=)
|
179 |
+
)
|
180 |
+
|
181 |
+
echo checking %d32%
|
182 |
+
if exist "%~dp0pretrained\%d32%" (
|
183 |
+
echo %d32% in .\pretrained checked.
|
184 |
+
echo=
|
185 |
+
) else (
|
186 |
+
echo failed. starting download from huggingface.
|
187 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld32% -d %~dp0pretrained -o %d32%
|
188 |
+
if exist "%~dp0pretrained\%d32%" (echo download successful.) else (echo please try again!
|
189 |
+
echo=)
|
190 |
+
)
|
191 |
+
echo checking %d40%
|
192 |
+
if exist "%~dp0pretrained\%d40%" (
|
193 |
+
echo %d40% in .\pretrained checked.
|
194 |
+
echo=
|
195 |
+
) else (
|
196 |
+
echo failed. starting download from huggingface.
|
197 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld40% -d %~dp0pretrained -o %d40%
|
198 |
+
if exist "%~dp0pretrained\%d40%" (echo download successful.) else (echo please try again!
|
199 |
+
echo=)
|
200 |
+
)
|
201 |
+
echo checking %d40v2%
|
202 |
+
if exist "%~dp0pretrained_v2\%d40v2%" (
|
203 |
+
echo %d40v2% in .\pretrained_v2 checked.
|
204 |
+
echo=
|
205 |
+
) else (
|
206 |
+
echo failed. starting download from huggingface.
|
207 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld40v2% -d %~dp0pretrained_v2 -o %d40v2%
|
208 |
+
if exist "%~dp0pretrained_v2\%d40v2%" (echo download successful.) else (echo please try again!
|
209 |
+
echo=)
|
210 |
+
)
|
211 |
+
echo checking %d48%
|
212 |
+
if exist "%~dp0pretrained\%d48%" (
|
213 |
+
echo %d48% in .\pretrained checked.
|
214 |
+
echo=
|
215 |
+
) else (
|
216 |
+
echo failed. starting download from huggingface.
|
217 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld48% -d %~dp0pretrained -o %d48%
|
218 |
+
if exist "%~dp0pretrained\%d48%" (echo download successful.) else (echo please try again!
|
219 |
+
echo=)
|
220 |
+
)
|
221 |
+
echo checking %g32%
|
222 |
+
if exist "%~dp0pretrained\%g32%" (
|
223 |
+
echo %g32% in .\pretrained checked.
|
224 |
+
echo=
|
225 |
+
) else (
|
226 |
+
echo failed. starting download from huggingface.
|
227 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg32% -d %~dp0pretrained -o %g32%
|
228 |
+
if exist "%~dp0pretrained\%g32%" (echo download successful.) else (echo please try again!
|
229 |
+
echo=)
|
230 |
+
)
|
231 |
+
echo checking %g40%
|
232 |
+
if exist "%~dp0pretrained\%g40%" (
|
233 |
+
echo %g40% in .\pretrained checked.
|
234 |
+
echo=
|
235 |
+
) else (
|
236 |
+
echo failed. starting download from huggingface.
|
237 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg40% -d %~dp0pretrained -o %g40%
|
238 |
+
if exist "%~dp0pretrained\%g40%" (echo download successful.) else (echo please try again!
|
239 |
+
echo=)
|
240 |
+
)
|
241 |
+
echo checking %g40v2%
|
242 |
+
if exist "%~dp0pretrained_v2\%g40v2%" (
|
243 |
+
echo %g40v2% in .\pretrained_v2 checked.
|
244 |
+
echo=
|
245 |
+
) else (
|
246 |
+
echo failed. starting download from huggingface.
|
247 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg40v2% -d %~dp0pretrained_v2 -o %g40v2%
|
248 |
+
if exist "%~dp0pretrained_v2\%g40v2%" (echo download successful.) else (echo please try again!
|
249 |
+
echo=)
|
250 |
+
)
|
251 |
+
echo checking %g48%
|
252 |
+
if exist "%~dp0pretrained\%g48%" (
|
253 |
+
echo %g48% in .\pretrained checked.
|
254 |
+
echo=
|
255 |
+
) else (
|
256 |
+
echo failed. starting download from huggingface.
|
257 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg48% -d %~dp0\pretrained -o %g48%
|
258 |
+
if exist "%~dp0pretrained\%g48%" (echo download successful.) else (echo please try again!
|
259 |
+
echo=)
|
260 |
+
)
|
261 |
+
|
262 |
+
echo checking %hp2_all%
|
263 |
+
if exist "%~dp0uvr5_weights\%hp2_all%" (
|
264 |
+
echo %hp2_all% in .\uvr5_weights checked.
|
265 |
+
echo=
|
266 |
+
) else (
|
267 |
+
echo failed. starting download from huggingface.
|
268 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhp2_all% -d %~dp0\uvr5_weights -o %hp2_all%
|
269 |
+
if exist "%~dp0uvr5_weights\%hp2_all%" (echo download successful.) else (echo please try again!
|
270 |
+
echo=)
|
271 |
+
)
|
272 |
+
echo checking %hp3_all%
|
273 |
+
if exist "%~dp0uvr5_weights\%hp3_all%" (
|
274 |
+
echo %hp3_all% in .\uvr5_weights checked.
|
275 |
+
echo=
|
276 |
+
) else (
|
277 |
+
echo failed. starting download from huggingface.
|
278 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhp3_all% -d %~dp0\uvr5_weights -o %hp3_all%
|
279 |
+
if exist "%~dp0uvr5_weights\%hp3_all%" (echo download successful.) else (echo please try again!
|
280 |
+
echo=)
|
281 |
+
)
|
282 |
+
echo checking %hp5_only%
|
283 |
+
if exist "%~dp0uvr5_weights\%hp5_only%" (
|
284 |
+
echo %hp5_only% in .\uvr5_weights checked.
|
285 |
+
echo=
|
286 |
+
) else (
|
287 |
+
echo failed. starting download from huggingface.
|
288 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhp5_only% -d %~dp0\uvr5_weights -o %hp5_only%
|
289 |
+
if exist "%~dp0uvr5_weights\%hp5_only%" (echo download successful.) else (echo please try again!
|
290 |
+
echo=)
|
291 |
+
)
|
292 |
+
echo checking %VR_DeEchoAggressive%
|
293 |
+
if exist "%~dp0uvr5_weights\%VR_DeEchoAggressive%" (
|
294 |
+
echo %VR_DeEchoAggressive% in .\uvr5_weights checked.
|
295 |
+
echo=
|
296 |
+
) else (
|
297 |
+
echo failed. starting download from huggingface.
|
298 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlVR_DeEchoAggressive% -d %~dp0\uvr5_weights -o %VR_DeEchoAggressive%
|
299 |
+
if exist "%~dp0uvr5_weights\%VR_DeEchoAggressive%" (echo download successful.) else (echo please try again!
|
300 |
+
echo=)
|
301 |
+
)
|
302 |
+
echo checking %VR_DeEchoDeReverb%
|
303 |
+
if exist "%~dp0uvr5_weights\%VR_DeEchoDeReverb%" (
|
304 |
+
echo %VR_DeEchoDeReverb% in .\uvr5_weights checked.
|
305 |
+
echo=
|
306 |
+
) else (
|
307 |
+
echo failed. starting download from huggingface.
|
308 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlVR_DeEchoDeReverb% -d %~dp0\uvr5_weights -o %VR_DeEchoDeReverb%
|
309 |
+
if exist "%~dp0uvr5_weights\%VR_DeEchoDeReverb%" (echo download successful.) else (echo please try again!
|
310 |
+
echo=)
|
311 |
+
)
|
312 |
+
echo checking %VR_DeEchoNormal%
|
313 |
+
if exist "%~dp0uvr5_weights\%VR_DeEchoNormal%" (
|
314 |
+
echo %VR_DeEchoNormal% in .\uvr5_weights checked.
|
315 |
+
echo=
|
316 |
+
) else (
|
317 |
+
echo failed. starting download from huggingface.
|
318 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlVR_DeEchoNormal% -d %~dp0\uvr5_weights -o %VR_DeEchoNormal%
|
319 |
+
if exist "%~dp0uvr5_weights\%VR_DeEchoNormal%" (echo download successful.) else (echo please try again!
|
320 |
+
echo=)
|
321 |
+
)
|
322 |
+
echo checking %onnx_dereverb%
|
323 |
+
if exist "%~dp0uvr5_weights\onnx_dereverb_By_FoxJoy\%onnx_dereverb%" (
|
324 |
+
echo %onnx_dereverb% in .\uvr5_weights\onnx_dereverb_By_FoxJoy checked.
|
325 |
+
echo=
|
326 |
+
) else (
|
327 |
+
echo failed. starting download from huggingface.
|
328 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlonnx_dereverb% -d %~dp0\uvr5_weights\onnx_dereverb_By_FoxJoy -o %onnx_dereverb%
|
329 |
+
if exist "%~dp0uvr5_weights\onnx_dereverb_By_FoxJoy\%onnx_dereverb%" (echo download successful.) else (echo please try again!
|
330 |
+
echo=)
|
331 |
+
)
|
332 |
+
|
333 |
+
echo checking %hb%
|
334 |
+
if exist "%~dp0%hb%" (
|
335 |
+
echo %hb% in .\pretrained checked.
|
336 |
+
echo=
|
337 |
+
) else (
|
338 |
+
echo failed. starting download from huggingface.
|
339 |
+
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhb% -d %~dp0 -o %hb%
|
340 |
+
if exist "%~dp0%hb%" (echo download successful.) else (echo please try again!
|
341 |
+
echo=)
|
342 |
+
)
|
343 |
+
|
344 |
+
echo required files check finished.
|
345 |
+
echo envfiles check complete.
|
346 |
+
pause
|
347 |
+
:end
|
348 |
+
del flag.txt
|
export_onnx.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
|
2 |
+
import torch
|
3 |
+
|
4 |
+
if __name__ == "__main__":
|
5 |
+
MoeVS = True # 模型是否为MoeVoiceStudio(原MoeSS)使用
|
6 |
+
|
7 |
+
ModelPath = "Shiroha/shiroha.pth" # 模型路径
|
8 |
+
ExportedPath = "model.onnx" # 输出路径
|
9 |
+
hidden_channels = 256 # hidden_channels,为768Vec做准备
|
10 |
+
cpt = torch.load(ModelPath, map_location="cpu")
|
11 |
+
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0] # n_spk
|
12 |
+
print(*cpt["config"])
|
13 |
+
|
14 |
+
test_phone = torch.rand(1, 200, hidden_channels) # hidden unit
|
15 |
+
test_phone_lengths = torch.tensor([200]).long() # hidden unit 长度(貌似没啥用)
|
16 |
+
test_pitch = torch.randint(size=(1, 200), low=5, high=255) # 基频(单位赫兹)
|
17 |
+
test_pitchf = torch.rand(1, 200) # nsf基频
|
18 |
+
test_ds = torch.LongTensor([0]) # 说话人ID
|
19 |
+
test_rnd = torch.rand(1, 192, 200) # 噪声(加入随机因子)
|
20 |
+
|
21 |
+
device = "cpu" # 导出时设备(不影响使用模型)
|
22 |
+
|
23 |
+
net_g = SynthesizerTrnMsNSFsidM(
|
24 |
+
*cpt["config"], is_half=False
|
25 |
+
) # fp32导出(C++要支持fp16必须手动将内存重新排列所以暂时不用fp16)
|
26 |
+
net_g.load_state_dict(cpt["weight"], strict=False)
|
27 |
+
input_names = ["phone", "phone_lengths", "pitch", "pitchf", "ds", "rnd"]
|
28 |
+
output_names = [
|
29 |
+
"audio",
|
30 |
+
]
|
31 |
+
# net_g.construct_spkmixmap(n_speaker) 多角色混合轨道导出
|
32 |
+
torch.onnx.export(
|
33 |
+
net_g,
|
34 |
+
(
|
35 |
+
test_phone.to(device),
|
36 |
+
test_phone_lengths.to(device),
|
37 |
+
test_pitch.to(device),
|
38 |
+
test_pitchf.to(device),
|
39 |
+
test_ds.to(device),
|
40 |
+
test_rnd.to(device),
|
41 |
+
),
|
42 |
+
ExportedPath,
|
43 |
+
dynamic_axes={
|
44 |
+
"phone": [1],
|
45 |
+
"pitch": [1],
|
46 |
+
"pitchf": [1],
|
47 |
+
"rnd": [2],
|
48 |
+
},
|
49 |
+
do_constant_folding=False,
|
50 |
+
opset_version=16,
|
51 |
+
verbose=False,
|
52 |
+
input_names=input_names,
|
53 |
+
output_names=output_names,
|
54 |
+
)
|
extract_f0_print.py
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os, traceback, sys, parselmouth
|
2 |
+
|
3 |
+
now_dir = os.getcwd()
|
4 |
+
sys.path.append(now_dir)
|
5 |
+
from my_utils import load_audio
|
6 |
+
import pyworld
|
7 |
+
from scipy.io import wavfile
|
8 |
+
import numpy as np, logging
|
9 |
+
|
10 |
+
logging.getLogger("numba").setLevel(logging.WARNING)
|
11 |
+
from multiprocessing import Process
|
12 |
+
|
13 |
+
exp_dir = sys.argv[1]
|
14 |
+
f = open("%s/extract_f0_feature.log" % exp_dir, "a+")
|
15 |
+
|
16 |
+
|
17 |
+
def printt(strr):
|
18 |
+
print(strr)
|
19 |
+
f.write("%s\n" % strr)
|
20 |
+
f.flush()
|
21 |
+
|
22 |
+
|
23 |
+
n_p = int(sys.argv[2])
|
24 |
+
f0method = sys.argv[3]
|
25 |
+
|
26 |
+
|
27 |
+
class FeatureInput(object):
|
28 |
+
def __init__(self, samplerate=16000, hop_size=160):
|
29 |
+
self.fs = samplerate
|
30 |
+
self.hop = hop_size
|
31 |
+
|
32 |
+
self.f0_bin = 256
|
33 |
+
self.f0_max = 1100.0
|
34 |
+
self.f0_min = 50.0
|
35 |
+
self.f0_mel_min = 1127 * np.log(1 + self.f0_min / 700)
|
36 |
+
self.f0_mel_max = 1127 * np.log(1 + self.f0_max / 700)
|
37 |
+
|
38 |
+
def compute_f0(self, path, f0_method):
|
39 |
+
x = load_audio(path, self.fs)
|
40 |
+
p_len = x.shape[0] // self.hop
|
41 |
+
if f0_method == "pm":
|
42 |
+
time_step = 160 / 16000 * 1000
|
43 |
+
f0_min = 50
|
44 |
+
f0_max = 1100
|
45 |
+
f0 = (
|
46 |
+
parselmouth.Sound(x, self.fs)
|
47 |
+
.to_pitch_ac(
|
48 |
+
time_step=time_step / 1000,
|
49 |
+
voicing_threshold=0.6,
|
50 |
+
pitch_floor=f0_min,
|
51 |
+
pitch_ceiling=f0_max,
|
52 |
+
)
|
53 |
+
.selected_array["frequency"]
|
54 |
+
)
|
55 |
+
pad_size = (p_len - len(f0) + 1) // 2
|
56 |
+
if pad_size > 0 or p_len - len(f0) - pad_size > 0:
|
57 |
+
f0 = np.pad(
|
58 |
+
f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant"
|
59 |
+
)
|
60 |
+
elif f0_method == "harvest":
|
61 |
+
f0, t = pyworld.harvest(
|
62 |
+
x.astype(np.double),
|
63 |
+
fs=self.fs,
|
64 |
+
f0_ceil=self.f0_max,
|
65 |
+
f0_floor=self.f0_min,
|
66 |
+
frame_period=1000 * self.hop / self.fs,
|
67 |
+
)
|
68 |
+
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.fs)
|
69 |
+
elif f0_method == "dio":
|
70 |
+
f0, t = pyworld.dio(
|
71 |
+
x.astype(np.double),
|
72 |
+
fs=self.fs,
|
73 |
+
f0_ceil=self.f0_max,
|
74 |
+
f0_floor=self.f0_min,
|
75 |
+
frame_period=1000 * self.hop / self.fs,
|
76 |
+
)
|
77 |
+
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.fs)
|
78 |
+
return f0
|
79 |
+
|
80 |
+
def coarse_f0(self, f0):
|
81 |
+
f0_mel = 1127 * np.log(1 + f0 / 700)
|
82 |
+
f0_mel[f0_mel > 0] = (f0_mel[f0_mel > 0] - self.f0_mel_min) * (
|
83 |
+
self.f0_bin - 2
|
84 |
+
) / (self.f0_mel_max - self.f0_mel_min) + 1
|
85 |
+
|
86 |
+
# use 0 or 1
|
87 |
+
f0_mel[f0_mel <= 1] = 1
|
88 |
+
f0_mel[f0_mel > self.f0_bin - 1] = self.f0_bin - 1
|
89 |
+
f0_coarse = np.rint(f0_mel).astype(int)
|
90 |
+
assert f0_coarse.max() <= 255 and f0_coarse.min() >= 1, (
|
91 |
+
f0_coarse.max(),
|
92 |
+
f0_coarse.min(),
|
93 |
+
)
|
94 |
+
return f0_coarse
|
95 |
+
|
96 |
+
def go(self, paths, f0_method):
|
97 |
+
if len(paths) == 0:
|
98 |
+
printt("no-f0-todo")
|
99 |
+
else:
|
100 |
+
printt("todo-f0-%s" % len(paths))
|
101 |
+
n = max(len(paths) // 5, 1) # 每个进程最多打印5条
|
102 |
+
for idx, (inp_path, opt_path1, opt_path2) in enumerate(paths):
|
103 |
+
try:
|
104 |
+
if idx % n == 0:
|
105 |
+
printt("f0ing,now-%s,all-%s,-%s" % (idx, len(paths), inp_path))
|
106 |
+
if (
|
107 |
+
os.path.exists(opt_path1 + ".npy") == True
|
108 |
+
and os.path.exists(opt_path2 + ".npy") == True
|
109 |
+
):
|
110 |
+
continue
|
111 |
+
featur_pit = self.compute_f0(inp_path, f0_method)
|
112 |
+
np.save(
|
113 |
+
opt_path2,
|
114 |
+
featur_pit,
|
115 |
+
allow_pickle=False,
|
116 |
+
) # nsf
|
117 |
+
coarse_pit = self.coarse_f0(featur_pit)
|
118 |
+
np.save(
|
119 |
+
opt_path1,
|
120 |
+
coarse_pit,
|
121 |
+
allow_pickle=False,
|
122 |
+
) # ori
|
123 |
+
except:
|
124 |
+
printt("f0fail-%s-%s-%s" % (idx, inp_path, traceback.format_exc()))
|
125 |
+
|
126 |
+
|
127 |
+
if __name__ == "__main__":
|
128 |
+
# exp_dir=r"E:\codes\py39\dataset\mi-test"
|
129 |
+
# n_p=16
|
130 |
+
# f = open("%s/log_extract_f0.log"%exp_dir, "w")
|
131 |
+
printt(sys.argv)
|
132 |
+
featureInput = FeatureInput()
|
133 |
+
paths = []
|
134 |
+
inp_root = "%s/1_16k_wavs" % (exp_dir)
|
135 |
+
opt_root1 = "%s/2a_f0" % (exp_dir)
|
136 |
+
opt_root2 = "%s/2b-f0nsf" % (exp_dir)
|
137 |
+
|
138 |
+
os.makedirs(opt_root1, exist_ok=True)
|
139 |
+
os.makedirs(opt_root2, exist_ok=True)
|
140 |
+
for name in sorted(list(os.listdir(inp_root))):
|
141 |
+
inp_path = "%s/%s" % (inp_root, name)
|
142 |
+
if "spec" in inp_path:
|
143 |
+
continue
|
144 |
+
opt_path1 = "%s/%s" % (opt_root1, name)
|
145 |
+
opt_path2 = "%s/%s" % (opt_root2, name)
|
146 |
+
paths.append([inp_path, opt_path1, opt_path2])
|
147 |
+
|
148 |
+
ps = []
|
149 |
+
for i in range(n_p):
|
150 |
+
p = Process(
|
151 |
+
target=featureInput.go,
|
152 |
+
args=(
|
153 |
+
paths[i::n_p],
|
154 |
+
f0method,
|
155 |
+
),
|
156 |
+
)
|
157 |
+
ps.append(p)
|
158 |
+
p.start()
|
159 |
+
for i in range(n_p):
|
160 |
+
ps[i].join()
|
extract_feature_print.py
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os, sys, traceback
|
2 |
+
|
3 |
+
# device=sys.argv[1]
|
4 |
+
n_part = int(sys.argv[2])
|
5 |
+
i_part = int(sys.argv[3])
|
6 |
+
if len(sys.argv) == 5:
|
7 |
+
exp_dir = sys.argv[4]
|
8 |
+
version = sys.argv[5]
|
9 |
+
else:
|
10 |
+
i_gpu = sys.argv[4]
|
11 |
+
exp_dir = sys.argv[5]
|
12 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = str(i_gpu)
|
13 |
+
version = sys.argv[6]
|
14 |
+
import torch
|
15 |
+
import torch.nn.functional as F
|
16 |
+
import soundfile as sf
|
17 |
+
import numpy as np
|
18 |
+
from fairseq import checkpoint_utils
|
19 |
+
|
20 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
21 |
+
|
22 |
+
if torch.cuda.is_available():
|
23 |
+
device = "cuda"
|
24 |
+
elif torch.backends.mps.is_available():
|
25 |
+
device = "mps"
|
26 |
+
else:
|
27 |
+
device = "cpu"
|
28 |
+
|
29 |
+
f = open("%s/extract_f0_feature.log" % exp_dir, "a+")
|
30 |
+
|
31 |
+
|
32 |
+
def printt(strr):
|
33 |
+
print(strr)
|
34 |
+
f.write("%s\n" % strr)
|
35 |
+
f.flush()
|
36 |
+
|
37 |
+
|
38 |
+
printt(sys.argv)
|
39 |
+
model_path = "hubert_base.pt"
|
40 |
+
|
41 |
+
printt(exp_dir)
|
42 |
+
wavPath = "%s/1_16k_wavs" % exp_dir
|
43 |
+
outPath = (
|
44 |
+
"%s/3_feature256" % exp_dir if version == "v1" else "%s/3_feature768" % exp_dir
|
45 |
+
)
|
46 |
+
os.makedirs(outPath, exist_ok=True)
|
47 |
+
|
48 |
+
|
49 |
+
# wave must be 16k, hop_size=320
|
50 |
+
def readwave(wav_path, normalize=False):
|
51 |
+
wav, sr = sf.read(wav_path)
|
52 |
+
assert sr == 16000
|
53 |
+
feats = torch.from_numpy(wav).float()
|
54 |
+
if feats.dim() == 2: # double channels
|
55 |
+
feats = feats.mean(-1)
|
56 |
+
assert feats.dim() == 1, feats.dim()
|
57 |
+
if normalize:
|
58 |
+
with torch.no_grad():
|
59 |
+
feats = F.layer_norm(feats, feats.shape)
|
60 |
+
feats = feats.view(1, -1)
|
61 |
+
return feats
|
62 |
+
|
63 |
+
|
64 |
+
# HuBERT model
|
65 |
+
printt("load model(s) from {}".format(model_path))
|
66 |
+
models, saved_cfg, task = checkpoint_utils.load_model_ensemble_and_task(
|
67 |
+
[model_path],
|
68 |
+
suffix="",
|
69 |
+
)
|
70 |
+
model = models[0]
|
71 |
+
model = model.to(device)
|
72 |
+
printt("move model to %s" % device)
|
73 |
+
if device not in ["mps", "cpu"]:
|
74 |
+
model = model.half()
|
75 |
+
model.eval()
|
76 |
+
|
77 |
+
todo = sorted(list(os.listdir(wavPath)))[i_part::n_part]
|
78 |
+
n = max(1, len(todo) // 10) # 最多打印十条
|
79 |
+
if len(todo) == 0:
|
80 |
+
printt("no-feature-todo")
|
81 |
+
else:
|
82 |
+
printt("all-feature-%s" % len(todo))
|
83 |
+
for idx, file in enumerate(todo):
|
84 |
+
try:
|
85 |
+
if file.endswith(".wav"):
|
86 |
+
wav_path = "%s/%s" % (wavPath, file)
|
87 |
+
out_path = "%s/%s" % (outPath, file.replace("wav", "npy"))
|
88 |
+
|
89 |
+
if os.path.exists(out_path):
|
90 |
+
continue
|
91 |
+
|
92 |
+
feats = readwave(wav_path, normalize=saved_cfg.task.normalize)
|
93 |
+
padding_mask = torch.BoolTensor(feats.shape).fill_(False)
|
94 |
+
inputs = {
|
95 |
+
"source": feats.half().to(device)
|
96 |
+
if device not in ["mps", "cpu"]
|
97 |
+
else feats.to(device),
|
98 |
+
"padding_mask": padding_mask.to(device),
|
99 |
+
"output_layer": 9 if version == "v1" else 12, # layer 9
|
100 |
+
}
|
101 |
+
with torch.no_grad():
|
102 |
+
logits = model.extract_features(**inputs)
|
103 |
+
feats = (
|
104 |
+
model.final_proj(logits[0]) if version == "v1" else logits[0]
|
105 |
+
)
|
106 |
+
|
107 |
+
feats = feats.squeeze(0).float().cpu().numpy()
|
108 |
+
if np.isnan(feats).sum() == 0:
|
109 |
+
np.save(out_path, feats, allow_pickle=False)
|
110 |
+
else:
|
111 |
+
printt("%s-contains nan" % file)
|
112 |
+
if idx % n == 0:
|
113 |
+
printt("now-%s,all-%s,%s,%s" % (len(todo), idx, file, feats.shape))
|
114 |
+
except:
|
115 |
+
printt(traceback.format_exc())
|
116 |
+
printt("all-feature-done")
|
extract_locale.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import re
|
3 |
+
|
4 |
+
# Define regular expression patterns
|
5 |
+
pattern = r"""i18n\([\s\n\t]*(["'][^"']+["'])[\s\n\t]*\)"""
|
6 |
+
|
7 |
+
# Initialize the dictionary to store key-value pairs
|
8 |
+
data = {}
|
9 |
+
|
10 |
+
|
11 |
+
def process(fn: str):
|
12 |
+
global data
|
13 |
+
with open(fn, "r", encoding="utf-8") as f:
|
14 |
+
contents = f.read()
|
15 |
+
matches = re.findall(pattern, contents)
|
16 |
+
for key in matches:
|
17 |
+
key = eval(key)
|
18 |
+
print("extract:", key)
|
19 |
+
data[key] = key
|
20 |
+
|
21 |
+
|
22 |
+
print("processing infer-web.py")
|
23 |
+
process("infer-web.py")
|
24 |
+
|
25 |
+
print("processing gui.py")
|
26 |
+
process("gui.py")
|
27 |
+
|
28 |
+
# Save as a JSON file
|
29 |
+
with open("./i18n/zh_CN.json", "w", encoding="utf-8") as f:
|
30 |
+
json.dump(data, f, ensure_ascii=False, indent=4)
|
31 |
+
f.write("\n")
|
ffmpeg
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89e8c9eb308f6161d33e16ecf6fa09884f36bdf5ca1bd4abbbcf20a0fb3145eb
|
3 |
+
size 91584056
|
go-realtime-gui.bat
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
runtime\python.exe gui.py
|
2 |
+
pause
|
go-web.bat
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
runtime\python.exe infer-web.py --pycmd runtime\python.exe --port 7897
|
2 |
+
pause
|
gui.py
ADDED
@@ -0,0 +1,681 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
0416后的更新:
|
3 |
+
引入config中half
|
4 |
+
重建npy而不用填写
|
5 |
+
v2支持
|
6 |
+
无f0模型支持
|
7 |
+
修复
|
8 |
+
|
9 |
+
int16:
|
10 |
+
增加无索引支持
|
11 |
+
f0算法改harvest(怎么看就只有这个会影响CPU占用),但是不这么改效果不好
|
12 |
+
"""
|
13 |
+
import os, sys, traceback
|
14 |
+
|
15 |
+
import json
|
16 |
+
|
17 |
+
now_dir = os.getcwd()
|
18 |
+
sys.path.append(now_dir)
|
19 |
+
from config import Config
|
20 |
+
|
21 |
+
Config = Config()
|
22 |
+
import PySimpleGUI as sg
|
23 |
+
import sounddevice as sd
|
24 |
+
import noisereduce as nr
|
25 |
+
import numpy as np
|
26 |
+
from fairseq import checkpoint_utils
|
27 |
+
import librosa, torch, pyworld, faiss, time, threading
|
28 |
+
import torch.nn.functional as F
|
29 |
+
import torchaudio.transforms as tat
|
30 |
+
import scipy.signal as signal
|
31 |
+
|
32 |
+
|
33 |
+
# import matplotlib.pyplot as plt
|
34 |
+
from infer_pack.models import (
|
35 |
+
SynthesizerTrnMs256NSFsid,
|
36 |
+
SynthesizerTrnMs256NSFsid_nono,
|
37 |
+
SynthesizerTrnMs768NSFsid,
|
38 |
+
SynthesizerTrnMs768NSFsid_nono,
|
39 |
+
)
|
40 |
+
from i18n import I18nAuto
|
41 |
+
|
42 |
+
i18n = I18nAuto()
|
43 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
44 |
+
current_dir = os.getcwd()
|
45 |
+
|
46 |
+
|
47 |
+
class RVC:
|
48 |
+
def __init__(
|
49 |
+
self, key, hubert_path, pth_path, index_path, npy_path, index_rate
|
50 |
+
) -> None:
|
51 |
+
"""
|
52 |
+
初始化
|
53 |
+
"""
|
54 |
+
try:
|
55 |
+
self.f0_up_key = key
|
56 |
+
self.time_step = 160 / 16000 * 1000
|
57 |
+
self.f0_min = 50
|
58 |
+
self.f0_max = 1100
|
59 |
+
self.f0_mel_min = 1127 * np.log(1 + self.f0_min / 700)
|
60 |
+
self.f0_mel_max = 1127 * np.log(1 + self.f0_max / 700)
|
61 |
+
self.sr = 16000
|
62 |
+
self.window = 160
|
63 |
+
if index_rate != 0:
|
64 |
+
self.index = faiss.read_index(index_path)
|
65 |
+
# self.big_npy = np.load(npy_path)
|
66 |
+
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
|
67 |
+
print("index search enabled")
|
68 |
+
self.index_rate = index_rate
|
69 |
+
model_path = hubert_path
|
70 |
+
print("load model(s) from {}".format(model_path))
|
71 |
+
models, saved_cfg, task = checkpoint_utils.load_model_ensemble_and_task(
|
72 |
+
[model_path],
|
73 |
+
suffix="",
|
74 |
+
)
|
75 |
+
self.model = models[0]
|
76 |
+
self.model = self.model.to(device)
|
77 |
+
if Config.is_half:
|
78 |
+
self.model = self.model.half()
|
79 |
+
else:
|
80 |
+
self.model = self.model.float()
|
81 |
+
self.model.eval()
|
82 |
+
cpt = torch.load(pth_path, map_location="cpu")
|
83 |
+
self.tgt_sr = cpt["config"][-1]
|
84 |
+
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0] # n_spk
|
85 |
+
self.if_f0 = cpt.get("f0", 1)
|
86 |
+
self.version = cpt.get("version", "v1")
|
87 |
+
if self.version == "v1":
|
88 |
+
if self.if_f0 == 1:
|
89 |
+
self.net_g = SynthesizerTrnMs256NSFsid(
|
90 |
+
*cpt["config"], is_half=Config.is_half
|
91 |
+
)
|
92 |
+
else:
|
93 |
+
self.net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
|
94 |
+
elif self.version == "v2":
|
95 |
+
if self.if_f0 == 1:
|
96 |
+
self.net_g = SynthesizerTrnMs768NSFsid(
|
97 |
+
*cpt["config"], is_half=Config.is_half
|
98 |
+
)
|
99 |
+
else:
|
100 |
+
self.net_g = SynthesizerTrnMs768NSFsid_nono(*cpt["config"])
|
101 |
+
del self.net_g.enc_q
|
102 |
+
print(self.net_g.load_state_dict(cpt["weight"], strict=False))
|
103 |
+
self.net_g.eval().to(device)
|
104 |
+
if Config.is_half:
|
105 |
+
self.net_g = self.net_g.half()
|
106 |
+
else:
|
107 |
+
self.net_g = self.net_g.float()
|
108 |
+
except:
|
109 |
+
print(traceback.format_exc())
|
110 |
+
|
111 |
+
def get_f0(self, x, f0_up_key, inp_f0=None):
|
112 |
+
x_pad = 1
|
113 |
+
f0_min = 50
|
114 |
+
f0_max = 1100
|
115 |
+
f0_mel_min = 1127 * np.log(1 + f0_min / 700)
|
116 |
+
f0_mel_max = 1127 * np.log(1 + f0_max / 700)
|
117 |
+
f0, t = pyworld.harvest(
|
118 |
+
x.astype(np.double),
|
119 |
+
fs=self.sr,
|
120 |
+
f0_ceil=f0_max,
|
121 |
+
f0_floor=f0_min,
|
122 |
+
frame_period=10,
|
123 |
+
)
|
124 |
+
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.sr)
|
125 |
+
f0 = signal.medfilt(f0, 3)
|
126 |
+
f0 *= pow(2, f0_up_key / 12)
|
127 |
+
# with open("test.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
|
128 |
+
tf0 = self.sr // self.window # 每秒f0点数
|
129 |
+
if inp_f0 is not None:
|
130 |
+
delta_t = np.round(
|
131 |
+
(inp_f0[:, 0].max() - inp_f0[:, 0].min()) * tf0 + 1
|
132 |
+
).astype("int16")
|
133 |
+
replace_f0 = np.interp(
|
134 |
+
list(range(delta_t)), inp_f0[:, 0] * 100, inp_f0[:, 1]
|
135 |
+
)
|
136 |
+
shape = f0[x_pad * tf0 : x_pad * tf0 + len(replace_f0)].shape[0]
|
137 |
+
f0[x_pad * tf0 : x_pad * tf0 + len(replace_f0)] = replace_f0[:shape]
|
138 |
+
# with open("test_opt.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
|
139 |
+
f0bak = f0.copy()
|
140 |
+
f0_mel = 1127 * np.log(1 + f0 / 700)
|
141 |
+
f0_mel[f0_mel > 0] = (f0_mel[f0_mel > 0] - f0_mel_min) * 254 / (
|
142 |
+
f0_mel_max - f0_mel_min
|
143 |
+
) + 1
|
144 |
+
f0_mel[f0_mel <= 1] = 1
|
145 |
+
f0_mel[f0_mel > 255] = 255
|
146 |
+
f0_coarse = np.rint(f0_mel).astype(np.int)
|
147 |
+
return f0_coarse, f0bak # 1-0
|
148 |
+
|
149 |
+
def infer(self, feats: torch.Tensor) -> np.ndarray:
|
150 |
+
"""
|
151 |
+
推理函数
|
152 |
+
"""
|
153 |
+
audio = feats.clone().cpu().numpy()
|
154 |
+
assert feats.dim() == 1, feats.dim()
|
155 |
+
feats = feats.view(1, -1)
|
156 |
+
padding_mask = torch.BoolTensor(feats.shape).fill_(False)
|
157 |
+
if Config.is_half:
|
158 |
+
feats = feats.half()
|
159 |
+
else:
|
160 |
+
feats = feats.float()
|
161 |
+
inputs = {
|
162 |
+
"source": feats.to(device),
|
163 |
+
"padding_mask": padding_mask.to(device),
|
164 |
+
"output_layer": 9 if self.version == "v1" else 12,
|
165 |
+
}
|
166 |
+
torch.cuda.synchronize()
|
167 |
+
with torch.no_grad():
|
168 |
+
logits = self.model.extract_features(**inputs)
|
169 |
+
feats = (
|
170 |
+
self.model.final_proj(logits[0]) if self.version == "v1" else logits[0]
|
171 |
+
)
|
172 |
+
|
173 |
+
####索引优化
|
174 |
+
try:
|
175 |
+
if (
|
176 |
+
hasattr(self, "index")
|
177 |
+
and hasattr(self, "big_npy")
|
178 |
+
and self.index_rate != 0
|
179 |
+
):
|
180 |
+
npy = feats[0].cpu().numpy().astype("float32")
|
181 |
+
score, ix = self.index.search(npy, k=8)
|
182 |
+
weight = np.square(1 / score)
|
183 |
+
weight /= weight.sum(axis=1, keepdims=True)
|
184 |
+
npy = np.sum(self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1)
|
185 |
+
if Config.is_half:
|
186 |
+
npy = npy.astype("float16")
|
187 |
+
feats = (
|
188 |
+
torch.from_numpy(npy).unsqueeze(0).to(device) * self.index_rate
|
189 |
+
+ (1 - self.index_rate) * feats
|
190 |
+
)
|
191 |
+
else:
|
192 |
+
print("index search FAIL or disabled")
|
193 |
+
except:
|
194 |
+
traceback.print_exc()
|
195 |
+
print("index search FAIL")
|
196 |
+
feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
|
197 |
+
torch.cuda.synchronize()
|
198 |
+
print(feats.shape)
|
199 |
+
if self.if_f0 == 1:
|
200 |
+
pitch, pitchf = self.get_f0(audio, self.f0_up_key)
|
201 |
+
p_len = min(feats.shape[1], 13000, pitch.shape[0]) # 太大了爆显存
|
202 |
+
else:
|
203 |
+
pitch, pitchf = None, None
|
204 |
+
p_len = min(feats.shape[1], 13000) # 太大了爆显存
|
205 |
+
torch.cuda.synchronize()
|
206 |
+
# print(feats.shape,pitch.shape)
|
207 |
+
feats = feats[:, :p_len, :]
|
208 |
+
if self.if_f0 == 1:
|
209 |
+
pitch = pitch[:p_len]
|
210 |
+
pitchf = pitchf[:p_len]
|
211 |
+
pitch = torch.LongTensor(pitch).unsqueeze(0).to(device)
|
212 |
+
pitchf = torch.FloatTensor(pitchf).unsqueeze(0).to(device)
|
213 |
+
p_len = torch.LongTensor([p_len]).to(device)
|
214 |
+
ii = 0 # sid
|
215 |
+
sid = torch.LongTensor([ii]).to(device)
|
216 |
+
with torch.no_grad():
|
217 |
+
if self.if_f0 == 1:
|
218 |
+
infered_audio = (
|
219 |
+
self.net_g.infer(feats, p_len, pitch, pitchf, sid)[0][0, 0]
|
220 |
+
.data.cpu()
|
221 |
+
.float()
|
222 |
+
)
|
223 |
+
else:
|
224 |
+
infered_audio = (
|
225 |
+
self.net_g.infer(feats, p_len, sid)[0][0, 0].data.cpu().float()
|
226 |
+
)
|
227 |
+
torch.cuda.synchronize()
|
228 |
+
return infered_audio
|
229 |
+
|
230 |
+
|
231 |
+
class GUIConfig:
|
232 |
+
def __init__(self) -> None:
|
233 |
+
self.hubert_path: str = ""
|
234 |
+
self.pth_path: str = ""
|
235 |
+
self.index_path: str = ""
|
236 |
+
self.npy_path: str = ""
|
237 |
+
self.pitch: int = 12
|
238 |
+
self.samplerate: int = 44100
|
239 |
+
self.block_time: float = 1.0 # s
|
240 |
+
self.buffer_num: int = 1
|
241 |
+
self.threhold: int = -30
|
242 |
+
self.crossfade_time: float = 0.08
|
243 |
+
self.extra_time: float = 0.04
|
244 |
+
self.I_noise_reduce = False
|
245 |
+
self.O_noise_reduce = False
|
246 |
+
self.index_rate = 0.3
|
247 |
+
|
248 |
+
|
249 |
+
class GUI:
|
250 |
+
def __init__(self) -> None:
|
251 |
+
self.config = GUIConfig()
|
252 |
+
self.flag_vc = False
|
253 |
+
|
254 |
+
self.launcher()
|
255 |
+
|
256 |
+
def load(self):
|
257 |
+
input_devices, output_devices, _, _ = self.get_devices()
|
258 |
+
try:
|
259 |
+
with open("values1.json", "r") as j:
|
260 |
+
data = json.load(j)
|
261 |
+
except:
|
262 |
+
with open("values1.json", "w") as j:
|
263 |
+
data = {
|
264 |
+
"pth_path": " ",
|
265 |
+
"index_path": " ",
|
266 |
+
"sg_input_device": input_devices[sd.default.device[0]],
|
267 |
+
"sg_output_device": output_devices[sd.default.device[1]],
|
268 |
+
"threhold": "-45",
|
269 |
+
"pitch": "0",
|
270 |
+
"index_rate": "0",
|
271 |
+
"block_time": "1",
|
272 |
+
"crossfade_length": "0.04",
|
273 |
+
"extra_time": "1",
|
274 |
+
}
|
275 |
+
return data
|
276 |
+
|
277 |
+
def launcher(self):
|
278 |
+
data = self.load()
|
279 |
+
sg.theme("LightBlue3")
|
280 |
+
input_devices, output_devices, _, _ = self.get_devices()
|
281 |
+
layout = [
|
282 |
+
[
|
283 |
+
sg.Frame(
|
284 |
+
title=i18n("加载模型"),
|
285 |
+
layout=[
|
286 |
+
[
|
287 |
+
sg.Input(
|
288 |
+
default_text="hubert_base.pt",
|
289 |
+
key="hubert_path",
|
290 |
+
disabled=True,
|
291 |
+
),
|
292 |
+
sg.FileBrowse(
|
293 |
+
i18n("Hubert模型"),
|
294 |
+
initial_folder=os.path.join(os.getcwd()),
|
295 |
+
file_types=((". pt"),),
|
296 |
+
),
|
297 |
+
],
|
298 |
+
[
|
299 |
+
sg.Input(
|
300 |
+
default_text=data.get("pth_path", ""),
|
301 |
+
key="pth_path",
|
302 |
+
),
|
303 |
+
sg.FileBrowse(
|
304 |
+
i18n("选择.pth文件"),
|
305 |
+
initial_folder=os.path.join(os.getcwd(), "weights"),
|
306 |
+
file_types=((". pth"),),
|
307 |
+
),
|
308 |
+
],
|
309 |
+
[
|
310 |
+
sg.Input(
|
311 |
+
default_text=data.get("index_path", ""),
|
312 |
+
key="index_path",
|
313 |
+
),
|
314 |
+
sg.FileBrowse(
|
315 |
+
i18n("选择.index文件"),
|
316 |
+
initial_folder=os.path.join(os.getcwd(), "logs"),
|
317 |
+
file_types=((". index"),),
|
318 |
+
),
|
319 |
+
],
|
320 |
+
[
|
321 |
+
sg.Input(
|
322 |
+
default_text="你不需要填写这个You don't need write this.",
|
323 |
+
key="npy_path",
|
324 |
+
disabled=True,
|
325 |
+
),
|
326 |
+
sg.FileBrowse(
|
327 |
+
i18n("选择.npy文件"),
|
328 |
+
initial_folder=os.path.join(os.getcwd(), "logs"),
|
329 |
+
file_types=((". npy"),),
|
330 |
+
),
|
331 |
+
],
|
332 |
+
],
|
333 |
+
)
|
334 |
+
],
|
335 |
+
[
|
336 |
+
sg.Frame(
|
337 |
+
layout=[
|
338 |
+
[
|
339 |
+
sg.Text(i18n("输入设备")),
|
340 |
+
sg.Combo(
|
341 |
+
input_devices,
|
342 |
+
key="sg_input_device",
|
343 |
+
default_value=data.get("sg_input_device", ""),
|
344 |
+
),
|
345 |
+
],
|
346 |
+
[
|
347 |
+
sg.Text(i18n("输出设备")),
|
348 |
+
sg.Combo(
|
349 |
+
output_devices,
|
350 |
+
key="sg_output_device",
|
351 |
+
default_value=data.get("sg_output_device", ""),
|
352 |
+
),
|
353 |
+
],
|
354 |
+
],
|
355 |
+
title=i18n("音频设备(请使用同种类驱动)"),
|
356 |
+
)
|
357 |
+
],
|
358 |
+
[
|
359 |
+
sg.Frame(
|
360 |
+
layout=[
|
361 |
+
[
|
362 |
+
sg.Text(i18n("响应阈值")),
|
363 |
+
sg.Slider(
|
364 |
+
range=(-60, 0),
|
365 |
+
key="threhold",
|
366 |
+
resolution=1,
|
367 |
+
orientation="h",
|
368 |
+
default_value=data.get("threhold", ""),
|
369 |
+
),
|
370 |
+
],
|
371 |
+
[
|
372 |
+
sg.Text(i18n("音调设置")),
|
373 |
+
sg.Slider(
|
374 |
+
range=(-24, 24),
|
375 |
+
key="pitch",
|
376 |
+
resolution=1,
|
377 |
+
orientation="h",
|
378 |
+
default_value=data.get("pitch", ""),
|
379 |
+
),
|
380 |
+
],
|
381 |
+
[
|
382 |
+
sg.Text(i18n("Index Rate")),
|
383 |
+
sg.Slider(
|
384 |
+
range=(0.0, 1.0),
|
385 |
+
key="index_rate",
|
386 |
+
resolution=0.01,
|
387 |
+
orientation="h",
|
388 |
+
default_value=data.get("index_rate", ""),
|
389 |
+
),
|
390 |
+
],
|
391 |
+
],
|
392 |
+
title=i18n("常规设置"),
|
393 |
+
),
|
394 |
+
sg.Frame(
|
395 |
+
layout=[
|
396 |
+
[
|
397 |
+
sg.Text(i18n("采样长度")),
|
398 |
+
sg.Slider(
|
399 |
+
range=(0.1, 3.0),
|
400 |
+
key="block_time",
|
401 |
+
resolution=0.1,
|
402 |
+
orientation="h",
|
403 |
+
default_value=data.get("block_time", ""),
|
404 |
+
),
|
405 |
+
],
|
406 |
+
[
|
407 |
+
sg.Text(i18n("淡入淡出长度")),
|
408 |
+
sg.Slider(
|
409 |
+
range=(0.01, 0.15),
|
410 |
+
key="crossfade_length",
|
411 |
+
resolution=0.01,
|
412 |
+
orientation="h",
|
413 |
+
default_value=data.get("crossfade_length", ""),
|
414 |
+
),
|
415 |
+
],
|
416 |
+
[
|
417 |
+
sg.Text(i18n("额外推理时长")),
|
418 |
+
sg.Slider(
|
419 |
+
range=(0.05, 3.00),
|
420 |
+
key="extra_time",
|
421 |
+
resolution=0.01,
|
422 |
+
orientation="h",
|
423 |
+
default_value=data.get("extra_time", ""),
|
424 |
+
),
|
425 |
+
],
|
426 |
+
[
|
427 |
+
sg.Checkbox(i18n("输入降噪"), key="I_noise_reduce"),
|
428 |
+
sg.Checkbox(i18n("输出降噪"), key="O_noise_reduce"),
|
429 |
+
],
|
430 |
+
],
|
431 |
+
title=i18n("性能设置"),
|
432 |
+
),
|
433 |
+
],
|
434 |
+
[
|
435 |
+
sg.Button(i18n("开始音频转换"), key="start_vc"),
|
436 |
+
sg.Button(i18n("停止音频转换"), key="stop_vc"),
|
437 |
+
sg.Text(i18n("推理时间(ms):")),
|
438 |
+
sg.Text("0", key="infer_time"),
|
439 |
+
],
|
440 |
+
]
|
441 |
+
self.window = sg.Window("RVC - GUI", layout=layout)
|
442 |
+
self.event_handler()
|
443 |
+
|
444 |
+
def event_handler(self):
|
445 |
+
while True:
|
446 |
+
event, values = self.window.read()
|
447 |
+
if event == sg.WINDOW_CLOSED:
|
448 |
+
self.flag_vc = False
|
449 |
+
exit()
|
450 |
+
if event == "start_vc" and self.flag_vc == False:
|
451 |
+
self.set_values(values)
|
452 |
+
print("using_cuda:" + str(torch.cuda.is_available()))
|
453 |
+
self.start_vc()
|
454 |
+
settings = {
|
455 |
+
"pth_path": values["pth_path"],
|
456 |
+
"index_path": values["index_path"],
|
457 |
+
"sg_input_device": values["sg_input_device"],
|
458 |
+
"sg_output_device": values["sg_output_device"],
|
459 |
+
"threhold": values["threhold"],
|
460 |
+
"pitch": values["pitch"],
|
461 |
+
"index_rate": values["index_rate"],
|
462 |
+
"block_time": values["block_time"],
|
463 |
+
"crossfade_length": values["crossfade_length"],
|
464 |
+
"extra_time": values["extra_time"],
|
465 |
+
}
|
466 |
+
with open("values1.json", "w") as j:
|
467 |
+
json.dump(settings, j)
|
468 |
+
if event == "stop_vc" and self.flag_vc == True:
|
469 |
+
self.flag_vc = False
|
470 |
+
|
471 |
+
def set_values(self, values):
|
472 |
+
self.set_devices(values["sg_input_device"], values["sg_output_device"])
|
473 |
+
self.config.hubert_path = os.path.join(current_dir, "hubert_base.pt")
|
474 |
+
self.config.pth_path = values["pth_path"]
|
475 |
+
self.config.index_path = values["index_path"]
|
476 |
+
self.config.npy_path = values["npy_path"]
|
477 |
+
self.config.threhold = values["threhold"]
|
478 |
+
self.config.pitch = values["pitch"]
|
479 |
+
self.config.block_time = values["block_time"]
|
480 |
+
self.config.crossfade_time = values["crossfade_length"]
|
481 |
+
self.config.extra_time = values["extra_time"]
|
482 |
+
self.config.I_noise_reduce = values["I_noise_reduce"]
|
483 |
+
self.config.O_noise_reduce = values["O_noise_reduce"]
|
484 |
+
self.config.index_rate = values["index_rate"]
|
485 |
+
|
486 |
+
def start_vc(self):
|
487 |
+
torch.cuda.empty_cache()
|
488 |
+
self.flag_vc = True
|
489 |
+
self.block_frame = int(self.config.block_time * self.config.samplerate)
|
490 |
+
self.crossfade_frame = int(self.config.crossfade_time * self.config.samplerate)
|
491 |
+
self.sola_search_frame = int(0.012 * self.config.samplerate)
|
492 |
+
self.delay_frame = int(0.01 * self.config.samplerate) # 往前预留0.02s
|
493 |
+
self.extra_frame = int(self.config.extra_time * self.config.samplerate)
|
494 |
+
self.rvc = None
|
495 |
+
self.rvc = RVC(
|
496 |
+
self.config.pitch,
|
497 |
+
self.config.hubert_path,
|
498 |
+
self.config.pth_path,
|
499 |
+
self.config.index_path,
|
500 |
+
self.config.npy_path,
|
501 |
+
self.config.index_rate,
|
502 |
+
)
|
503 |
+
self.input_wav: np.ndarray = np.zeros(
|
504 |
+
self.extra_frame
|
505 |
+
+ self.crossfade_frame
|
506 |
+
+ self.sola_search_frame
|
507 |
+
+ self.block_frame,
|
508 |
+
dtype="float32",
|
509 |
+
)
|
510 |
+
self.output_wav: torch.Tensor = torch.zeros(
|
511 |
+
self.block_frame, device=device, dtype=torch.float32
|
512 |
+
)
|
513 |
+
self.sola_buffer: torch.Tensor = torch.zeros(
|
514 |
+
self.crossfade_frame, device=device, dtype=torch.float32
|
515 |
+
)
|
516 |
+
self.fade_in_window: torch.Tensor = torch.linspace(
|
517 |
+
0.0, 1.0, steps=self.crossfade_frame, device=device, dtype=torch.float32
|
518 |
+
)
|
519 |
+
self.fade_out_window: torch.Tensor = 1 - self.fade_in_window
|
520 |
+
self.resampler1 = tat.Resample(
|
521 |
+
orig_freq=self.config.samplerate, new_freq=16000, dtype=torch.float32
|
522 |
+
)
|
523 |
+
self.resampler2 = tat.Resample(
|
524 |
+
orig_freq=self.rvc.tgt_sr,
|
525 |
+
new_freq=self.config.samplerate,
|
526 |
+
dtype=torch.float32,
|
527 |
+
)
|
528 |
+
thread_vc = threading.Thread(target=self.soundinput)
|
529 |
+
thread_vc.start()
|
530 |
+
|
531 |
+
def soundinput(self):
|
532 |
+
"""
|
533 |
+
接受音频输入
|
534 |
+
"""
|
535 |
+
with sd.Stream(
|
536 |
+
callback=self.audio_callback,
|
537 |
+
blocksize=self.block_frame,
|
538 |
+
samplerate=self.config.samplerate,
|
539 |
+
dtype="float32",
|
540 |
+
):
|
541 |
+
while self.flag_vc:
|
542 |
+
time.sleep(self.config.block_time)
|
543 |
+
print("Audio block passed.")
|
544 |
+
print("ENDing VC")
|
545 |
+
|
546 |
+
def audio_callback(
|
547 |
+
self, indata: np.ndarray, outdata: np.ndarray, frames, times, status
|
548 |
+
):
|
549 |
+
"""
|
550 |
+
音频处理
|
551 |
+
"""
|
552 |
+
start_time = time.perf_counter()
|
553 |
+
indata = librosa.to_mono(indata.T)
|
554 |
+
if self.config.I_noise_reduce:
|
555 |
+
indata[:] = nr.reduce_noise(y=indata, sr=self.config.samplerate)
|
556 |
+
|
557 |
+
"""noise gate"""
|
558 |
+
frame_length = 2048
|
559 |
+
hop_length = 1024
|
560 |
+
rms = librosa.feature.rms(
|
561 |
+
y=indata, frame_length=frame_length, hop_length=hop_length
|
562 |
+
)
|
563 |
+
db_threhold = librosa.amplitude_to_db(rms, ref=1.0)[0] < self.config.threhold
|
564 |
+
# print(rms.shape,db.shape,db)
|
565 |
+
for i in range(db_threhold.shape[0]):
|
566 |
+
if db_threhold[i]:
|
567 |
+
indata[i * hop_length : (i + 1) * hop_length] = 0
|
568 |
+
self.input_wav[:] = np.append(self.input_wav[self.block_frame :], indata)
|
569 |
+
|
570 |
+
# infer
|
571 |
+
print("input_wav:" + str(self.input_wav.shape))
|
572 |
+
# print('infered_wav:'+str(infer_wav.shape))
|
573 |
+
infer_wav: torch.Tensor = self.resampler2(
|
574 |
+
self.rvc.infer(self.resampler1(torch.from_numpy(self.input_wav)))
|
575 |
+
)[-self.crossfade_frame - self.sola_search_frame - self.block_frame :].to(
|
576 |
+
device
|
577 |
+
)
|
578 |
+
print("infer_wav:" + str(infer_wav.shape))
|
579 |
+
|
580 |
+
# SOLA algorithm from https://github.com/yxlllc/DDSP-SVC
|
581 |
+
cor_nom = F.conv1d(
|
582 |
+
infer_wav[None, None, : self.crossfade_frame + self.sola_search_frame],
|
583 |
+
self.sola_buffer[None, None, :],
|
584 |
+
)
|
585 |
+
cor_den = torch.sqrt(
|
586 |
+
F.conv1d(
|
587 |
+
infer_wav[None, None, : self.crossfade_frame + self.sola_search_frame]
|
588 |
+
** 2,
|
589 |
+
torch.ones(1, 1, self.crossfade_frame, device=device),
|
590 |
+
)
|
591 |
+
+ 1e-8
|
592 |
+
)
|
593 |
+
sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
|
594 |
+
print("sola offset: " + str(int(sola_offset)))
|
595 |
+
|
596 |
+
# crossfade
|
597 |
+
self.output_wav[:] = infer_wav[sola_offset : sola_offset + self.block_frame]
|
598 |
+
self.output_wav[: self.crossfade_frame] *= self.fade_in_window
|
599 |
+
self.output_wav[: self.crossfade_frame] += self.sola_buffer[:]
|
600 |
+
if sola_offset < self.sola_search_frame:
|
601 |
+
self.sola_buffer[:] = (
|
602 |
+
infer_wav[
|
603 |
+
-self.sola_search_frame
|
604 |
+
- self.crossfade_frame
|
605 |
+
+ sola_offset : -self.sola_search_frame
|
606 |
+
+ sola_offset
|
607 |
+
]
|
608 |
+
* self.fade_out_window
|
609 |
+
)
|
610 |
+
else:
|
611 |
+
self.sola_buffer[:] = (
|
612 |
+
infer_wav[-self.crossfade_frame :] * self.fade_out_window
|
613 |
+
)
|
614 |
+
|
615 |
+
if self.config.O_noise_reduce:
|
616 |
+
outdata[:] = np.tile(
|
617 |
+
nr.reduce_noise(
|
618 |
+
y=self.output_wav[:].cpu().numpy(), sr=self.config.samplerate
|
619 |
+
),
|
620 |
+
(2, 1),
|
621 |
+
).T
|
622 |
+
else:
|
623 |
+
outdata[:] = self.output_wav[:].repeat(2, 1).t().cpu().numpy()
|
624 |
+
total_time = time.perf_counter() - start_time
|
625 |
+
self.window["infer_time"].update(int(total_time * 1000))
|
626 |
+
print("infer time:" + str(total_time))
|
627 |
+
|
628 |
+
def get_devices(self, update: bool = True):
|
629 |
+
"""获取设备列表"""
|
630 |
+
if update:
|
631 |
+
sd._terminate()
|
632 |
+
sd._initialize()
|
633 |
+
devices = sd.query_devices()
|
634 |
+
hostapis = sd.query_hostapis()
|
635 |
+
for hostapi in hostapis:
|
636 |
+
for device_idx in hostapi["devices"]:
|
637 |
+
devices[device_idx]["hostapi_name"] = hostapi["name"]
|
638 |
+
input_devices = [
|
639 |
+
f"{d['name']} ({d['hostapi_name']})"
|
640 |
+
for d in devices
|
641 |
+
if d["max_input_channels"] > 0
|
642 |
+
]
|
643 |
+
output_devices = [
|
644 |
+
f"{d['name']} ({d['hostapi_name']})"
|
645 |
+
for d in devices
|
646 |
+
if d["max_output_channels"] > 0
|
647 |
+
]
|
648 |
+
input_devices_indices = [
|
649 |
+
d["index"] if "index" in d else d["name"]
|
650 |
+
for d in devices
|
651 |
+
if d["max_input_channels"] > 0
|
652 |
+
]
|
653 |
+
output_devices_indices = [
|
654 |
+
d["index"] if "index" in d else d["name"]
|
655 |
+
for d in devices
|
656 |
+
if d["max_output_channels"] > 0
|
657 |
+
]
|
658 |
+
return (
|
659 |
+
input_devices,
|
660 |
+
output_devices,
|
661 |
+
input_devices_indices,
|
662 |
+
output_devices_indices,
|
663 |
+
)
|
664 |
+
|
665 |
+
def set_devices(self, input_device, output_device):
|
666 |
+
"""设置输出设备"""
|
667 |
+
(
|
668 |
+
input_devices,
|
669 |
+
output_devices,
|
670 |
+
input_device_indices,
|
671 |
+
output_device_indices,
|
672 |
+
) = self.get_devices()
|
673 |
+
sd.default.device[0] = input_device_indices[input_devices.index(input_device)]
|
674 |
+
sd.default.device[1] = output_device_indices[
|
675 |
+
output_devices.index(output_device)
|
676 |
+
]
|
677 |
+
print("input device:" + str(sd.default.device[0]) + ":" + str(input_device))
|
678 |
+
print("output device:" + str(sd.default.device[1]) + ":" + str(output_device))
|
679 |
+
|
680 |
+
|
681 |
+
gui = GUI()
|
hubert_base.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f54b40fd2802423a5643779c4861af1e9ee9c1564dc9d32f54f20b5ffba7db96
|
3 |
+
size 189507909
|
i18n.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import locale
|
2 |
+
import json
|
3 |
+
import os
|
4 |
+
|
5 |
+
|
6 |
+
def load_language_list(language):
|
7 |
+
with open(f"./i18n/{language}.json", "r", encoding="utf-8") as f:
|
8 |
+
language_list = json.load(f)
|
9 |
+
return language_list
|
10 |
+
|
11 |
+
|
12 |
+
class I18nAuto:
|
13 |
+
def __init__(self, language=None):
|
14 |
+
if language in ["Auto", None]:
|
15 |
+
language = locale.getdefaultlocale()[
|
16 |
+
0
|
17 |
+
] # getlocale can't identify the system's language ((None, None))
|
18 |
+
if not os.path.exists(f"./i18n/{language}.json"):
|
19 |
+
language = "en_US"
|
20 |
+
self.language = language
|
21 |
+
# print("Use Language:", language)
|
22 |
+
self.language_map = load_language_list(language)
|
23 |
+
|
24 |
+
def __call__(self, key):
|
25 |
+
return self.language_map.get(key, key)
|
26 |
+
|
27 |
+
def print(self):
|
28 |
+
print("Use Language:", self.language)
|
i18n/en_US.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{}
|
i18n/es_ES.json
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
|
3 |
+
"是": "是",
|
4 |
+
"step1:正在处理数据": "step1:正在处理数据",
|
5 |
+
"step2a:无需提取音高": "step2a:无需提取音高",
|
6 |
+
"step2b:正在提取特征": "step2b:正在提取特征",
|
7 |
+
"step3a:正在训练模型": "step3a:正在训练模型",
|
8 |
+
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
|
9 |
+
"全流程结束!": "全流程结束!",
|
10 |
+
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "Este software es de código abierto bajo la licencia MIT, el autor no tiene ningún control sobre el software, y aquellos que usan el software y difunden los sonidos exportados por el software son los únicos responsables.<br>Si no está de acuerdo con esta cláusula , no puede utilizar ni citar ningún código ni archivo del paquete de software Consulte el directorio raíz <b>Agreement-LICENSE.txt</b> para obtener más información.",
|
11 |
+
"模型推理": "inferencia del modelo",
|
12 |
+
"推理音色": "inferencia de voz",
|
13 |
+
"刷新音色列表和索引路径": "刷新音色列表和索引路径",
|
14 |
+
"卸载音色省显存": "Descargue la voz para ahorrar memoria GPU",
|
15 |
+
"请选择说话人id": "seleccione una identificación de altavoz",
|
16 |
+
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Tecla +12 recomendada para conversión de voz de hombre a mujer, tecla -12 para conversión de voz de mujer a hombre. Si el rango de tono es demasiado amplio y causa distorsión, ajústelo usted mismo a un rango adecuado.",
|
17 |
+
"变调(整数, 半音数量, 升八度12降八度-12)": "Cambio de tono (entero, número de semitonos, subir una octava +12 o bajar una octava -12)",
|
18 |
+
"输入待处理音频文件路径(默认是正确格式示例)": "Ingrese la ruta del archivo del audio que se procesará (el formato predeterminado es el ejemplo correcto)",
|
19 |
+
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
|
20 |
+
">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音",
|
21 |
+
"特征检索库文件路径,为空则使用下拉的选择结果": "特征检索库文件路径,为空则使用下拉的选择结果",
|
22 |
+
"自动检测index路径,下拉式选择(dropdown)": "自动检测index路径,下拉式选择(dropdown)",
|
23 |
+
"特征文件路径": "Ruta del archivo de características",
|
24 |
+
"检索特征占比": "Proporción de función de búsqueda",
|
25 |
+
"后处理重采样至最终采样率,0为不进行重采样": "后处理重采样至最终采样率,0为不进行重采样",
|
26 |
+
"输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络",
|
27 |
+
"保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果",
|
28 |
+
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Archivo de curva F0, opcional, un tono por línea, en lugar de F0 predeterminado y cambio de tono",
|
29 |
+
"转换": "Conversión",
|
30 |
+
"输出信息": "Información de salida",
|
31 |
+
"输出音频(右下角三个点,点了可以下载)": "Salida de audio (haga clic en los tres puntos en la esquina inferior derecha para descargar)",
|
32 |
+
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "Conversión por lotes, ingrese la carpeta que contiene los archivos de audio para convertir o cargue varios archivos de audio. El audio convertido se emitirá en la carpeta especificada (opción predeterminada).",
|
33 |
+
"指定输出文件夹": "Especificar carpeta de salida",
|
34 |
+
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Ingrese la ruta a la carpeta de audio que se procesará (simplemente cópiela desde la barra de direcciones del administrador de archivos)",
|
35 |
+
"也可批量输入音频文件, 二选一, 优先读文件夹": "También se pueden ingresar múltiples archivos de audio, cualquiera de las dos opciones, con prioridad dada a la carpeta",
|
36 |
+
"导出文件格式": "导出文��格式",
|
37 |
+
"伴奏人声分离&去混响&去回声": "伴奏人声分离&去混响&去回声",
|
38 |
+
"输入待处理音频文件夹路径": "Ingrese la ruta a la carpeta de audio que se procesará",
|
39 |
+
"模型": "Modelo",
|
40 |
+
"指定输出主人声文件夹": "指定输出主人声文件夹",
|
41 |
+
"指定输出非主人声文件夹": "指定输出非主人声文件夹",
|
42 |
+
"训练": "Entrenamiento",
|
43 |
+
"step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "paso 1: Complete la configuración del experimento. Los datos del experimento se almacenan en el directorio 'logs', con cada experimento en una carpeta separada. La ruta del nombre del experimento debe ingresarse manualmente y debe contener la configuración del experimento, los registros y los archivos del modelo entrenado.",
|
44 |
+
"输入实验名": "Ingrese el nombre del modelo",
|
45 |
+
"目标采样率": "Tasa de muestreo objetivo",
|
46 |
+
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "Si el modelo tiene guía de tono (necesaria para cantar, pero no para hablar)",
|
47 |
+
"版本(目前仅40k支持了v2)": "版本(目前仅40k支持了v2)",
|
48 |
+
"提取音高和处理数据使用的CPU进程数": "提取音高和处理数据使用的CPU进程数",
|
49 |
+
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "paso 2a: recorra automáticamente la carpeta de capacitación y corte y normalice todos los archivos de audio que se pueden decodificar en audio. Se generarán dos carpetas 'wav' en el directorio del experimento. Actualmente, solo se admite la capacitación de una sola persona.",
|
50 |
+
"输入训练文件夹路径": "Introduzca la ruta de la carpeta de entrenamiento",
|
51 |
+
"请指定说话人id": "Especifique el ID del hablante",
|
52 |
+
"处理数据": "Procesar datos",
|
53 |
+
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "paso 2b: use la CPU para extraer el tono (si el modelo tiene guía de tono) y la GPU para extraer características (seleccione el número de tarjeta).",
|
54 |
+
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Separe los números de identificación de la GPU con '-' al ingresarlos. Por ejemplo, '0-1-2' significa usar GPU 0, GPU 1 y GPU 2.",
|
55 |
+
"显卡信息": "información de la GPU",
|
56 |
+
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "Seleccione el algoritmo de extracción de tono: utilice 'pm' para un procesamiento más rápido de la voz cantada, 'dio' para un discurso de alta calidad pero un procesamiento más lento y 'cosecha' para obtener la mejor calidad pero un procesamiento más lento.",
|
57 |
+
"特征提取": "Extracción de características",
|
58 |
+
"step3: 填写训练设置, 开始训练模型和索引": "Paso 3: complete la configuración de entrenamiento y comience a entrenar el modelo y el índice.",
|
59 |
+
"保存频率save_every_epoch": "Frecuencia de guardado (save_every_epoch)",
|
60 |
+
"总训练轮数total_epoch": "Total de épocas de entrenamiento (total_epoch)",
|
61 |
+
"每张显卡的batch_size": "每张显卡的batch_size",
|
62 |
+
"是否仅保存最新的ckpt文件以节省硬盘空间": "Si guardar solo el archivo ckpt más reciente para ahorrar espacio en disco",
|
63 |
+
"否": "否",
|
64 |
+
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "Si almacenar en caché todos los conjuntos de entrenamiento en la memoria de la GPU. Los conjuntos de datos pequeños (menos de 10 minutos) se pueden almacenar en caché para acelerar el entrenamiento, pero el almacenamiento en caché de conjuntos de datos grandes puede causar errores de memoria en la GPU y no aumenta la velocidad de manera significativa.",
|
65 |
+
"是否在每次保存时间点将最终小模型保存至weights文件夹": "是否在每次保存时间点将最终小模型保存至weights文件夹",
|
66 |
+
"加载预训练底模G路径": "Cargue la ruta G del modelo base preentrenada.",
|
67 |
+
"加载预训练底模D路径": "Cargue la ruta del modelo D base preentrenada.",
|
68 |
+
"训练模型": "Entrenar Modelo",
|
69 |
+
"训练特征索引": "Índice de características del Entrenamiento",
|
70 |
+
"一键训练": "Entrenamiento con un clic.",
|
71 |
+
"ckpt处理": "Procesamiento de recibos",
|
72 |
+
"模型融合, 可用于测试音色融合": "Fusión de modelos, se puede utilizar para fusionar diferentes voces",
|
73 |
+
"A模型路径": "Modelo A ruta.",
|
74 |
+
"B模型路径": "Modelo B ruta.",
|
75 |
+
"A模型权重": "Un peso modelo para el modelo A.",
|
76 |
+
"模型是否带音高指导": "Si el modelo tiene guía de tono.",
|
77 |
+
"要置入的模型信息": "Información del modelo a colocar.",
|
78 |
+
"保存的模型名不带后缀": "Nombre del modelo guardado sin extensión.",
|
79 |
+
"模型版本型号": "模型版本���号",
|
80 |
+
"融合": "Fusión.",
|
81 |
+
"修改模型信息(仅支持weights文件夹下提取的小模型文件)": "Modificar la información del modelo (solo admite archivos de modelos pequeños extraídos en la carpeta de pesos).",
|
82 |
+
"模型路径": "Ruta del modelo",
|
83 |
+
"要改的模型信息": "Información del modelo a modificar",
|
84 |
+
"保存的文件名, 默认空为和源文件同名": "Nombre del archivo que se guardará, el valor predeterminado es el mismo que el nombre del archivo de origen",
|
85 |
+
"修改": "Modificar",
|
86 |
+
"查看模型信息(仅支持weights文件夹下提取的小模型文件)": "Ver información del modelo (solo aplicable a archivos de modelos pequeños extraídos de la carpeta 'pesos')",
|
87 |
+
"查看": "Ver",
|
88 |
+
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "Extracción de modelo (ingrese la ruta de un archivo de modelo grande en la carpeta 'logs'), aplicable cuando desea extraer un archivo de modelo pequeño después de entrenar a mitad de camino y no se guardó automáticamente, o cuando desea probar un modelo intermedio",
|
89 |
+
"保存名": "Guardar nombre",
|
90 |
+
"模型是否带音高指导,1是0否": "Si el modelo tiene guía de tono, 1 para sí, 0 para no",
|
91 |
+
"提取": "Extracter",
|
92 |
+
"Onnx导出": "Onnx导出",
|
93 |
+
"RVC模型路径": "RVC模型路径",
|
94 |
+
"Onnx输出路径": "Onnx输出路径",
|
95 |
+
"MoeVS模型": "MoeVS模型",
|
96 |
+
"导出Onnx模型": "导出Onnx模型",
|
97 |
+
"常见问题解答": "常见问题解答",
|
98 |
+
"招募音高曲线前端编辑器": "Reclutar editores front-end para curvas de tono",
|
99 |
+
"加开发群联系我xxxxx": "Únase al grupo de desarrollo para contactarme en xxxxx",
|
100 |
+
"点击查看交流、问题反馈群号": "Haga clic para ver el número de grupo de comunicación y comentarios sobre problemas",
|
101 |
+
"xxxxx": "xxxxx",
|
102 |
+
"加载模型": "Cargar modelo",
|
103 |
+
"Hubert模型": "Modelo de Hubert ",
|
104 |
+
"选择.pth文件": "Seleccionar archivo .pth",
|
105 |
+
"选择.index文件": "Select .index file",
|
106 |
+
"选择.npy文件": "Seleccionar archivo .npy",
|
107 |
+
"输入设备": "Dispositivo de entrada",
|
108 |
+
"输出设备": "Dispositivo de salida",
|
109 |
+
"音频设备(请使用同种类驱动)": "Dispositivo de audio (utilice el mismo tipo de controlador)",
|
110 |
+
"响应阈值": "Umbral de respuesta",
|
111 |
+
"音调设置": "Ajuste de tono",
|
112 |
+
"Index Rate": "Tasa de índice",
|
113 |
+
"常规设置": "Configuración general",
|
114 |
+
"采样长度": "Longitud de muestreo",
|
115 |
+
"淡入淡出长度": "Duración del fundido de entrada/salida",
|
116 |
+
"额外推理时长": "Tiempo de inferencia adicional",
|
117 |
+
"输入降噪": "Reducción de ruido de entrada",
|
118 |
+
"输出降噪": "Reducción de ruido de salida",
|
119 |
+
"性能设置": "Configuración de rendimiento",
|
120 |
+
"开始音频转换": "Iniciar conversión de audio",
|
121 |
+
"停止音频转换": "Detener la conversión de audio",
|
122 |
+
"推理时间(ms):": "Inferir tiempo (ms):"
|
123 |
+
}
|
i18n/ja_JP.json
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"很遗憾您这没有能用的显卡来支持您训练": "トレーニングに対応したGPUが動作しないのは残念です。",
|
3 |
+
"是": "はい",
|
4 |
+
"step1:正在处理数据": "step1:処理中のデータ",
|
5 |
+
"step2a:无需提取音高": "step2a:ピッチの抽出は不要",
|
6 |
+
"step2b:正在提取特征": "step2b:抽出される特徴量",
|
7 |
+
"step3a:正在训练模型": "step3a:トレーニング中のモデル",
|
8 |
+
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "トレーニング終了時に、トレーニングログやフォルダ内のtrain.logを確認することができます",
|
9 |
+
"全流程结束!": "全工程が完了!",
|
10 |
+
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本ソフトウェアはMITライセンスに基づくオープンソースであり、作者は本ソフトウェアに対していかなる強制力も持ちません。本ソフトウェアの利用者および本ソフトウェアから派生した音源(成果物)を配布する者は、本ソフトウェアに対して自身で責任を負うものとします。 <br>この条項に同意しない場合、パッケージ内のコードやファイルを使用や参照を禁じます。詳しくは<b>使用需遵守的协议-LICENSE.txt</b>をご覧ください.",
|
11 |
+
"模型推理": "モデル推論",
|
12 |
+
"推理音色": "音源推論",
|
13 |
+
"刷新音色列表和索引路径": "音源リストとインデックスパスの更新",
|
14 |
+
"卸载音色省显存": "音源を削除してメモリを節約",
|
15 |
+
"请选择说话人id": "話者IDを選択してください",
|
16 |
+
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性から女性へは+12キーをお勧めします。女性から男性へは-12キーをお勧めします。音域が広すぎて音質が劣化した場合は、適切な音域に自分で調整することもできます。",
|
17 |
+
"变调(整数, 半音数量, 升八度12降八度-12)": "ピッチ変更(整数、半音数、上下オクターブ12-12)",
|
18 |
+
"输入待处理音频文件路径(默认是正确格式示例)": "処理対象音声ファイルのパスを入力してください(デフォルトは正しいフォーマットの例です)",
|
19 |
+
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
|
20 |
+
">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": ">=3 次に、harvestピッチの認識結果に対してメディアンフィルタを使用します。値はフィルター半径で、ミュートを減衰させるために使用します。",
|
21 |
+
"特征检索库文件路径,为空则使用下拉的选择结果": "特徴検索ライブラリへのパス 空の場合はドロップダウンで選択",
|
22 |
+
"自动检测index路径,下拉式选择(dropdown)": "インデックスパスの自動検出 ドロップダウンで選択",
|
23 |
+
"特征文件路径": "特徴量ファイルのパス",
|
24 |
+
"检索特征占比": "検索特徴率",
|
25 |
+
"后处理重采样至最终采样率,0为不进行重采样": "最終的なサンプリングレートへのポストプロセッシングのリサンプリング リサンプリングしない場合は0",
|
26 |
+
"输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "入力ソースの音量エンベロープと出力音量エンベロープの融合率 1に近づくほど、出力音量エンベロープの割合が高くなる",
|
27 |
+
"保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果",
|
28 |
+
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0(最低共振周波数)カーブファイル(オプション、1行に1ピッチ、デフォルトのF0(最低共振周波数)とエレベーションを置き換えます。)",
|
29 |
+
"转换": "変換",
|
30 |
+
"输出信息": "出力情報",
|
31 |
+
"输出音频(右下角三个点,点了可以下载)": "出力音声(右下の三点をクリックしてダウンロードできます)",
|
32 |
+
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "一括変換、変換する音声フォルダを入力、または複数の音声ファイルをアップロードし、指定したフォルダ(デフォルトのopt)に変換した音声を出��します。",
|
33 |
+
"指定输出文件夹": "出力フォルダを指定してください",
|
34 |
+
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "処理対象音声フォルダーのパスを入力してください(ファイルマネージャのアドレスバーからコピーしてください)",
|
35 |
+
"也可批量输入音频文件, 二选一, 优先读文件夹": "複数の音声ファイルを一括で入力することもできますが、フォルダーを優先して読み込みます",
|
36 |
+
"导出文件格式": "导出文件格式",
|
37 |
+
"伴奏人声分离&去混响&去回声": "伴奏人声分离&去混响&去回声",
|
38 |
+
"输入待处理音频文件夹路径": "処理するオーディオファイルのフォルダパスを入力してください",
|
39 |
+
"模型": "モデル",
|
40 |
+
"指定输出主人声文件夹": "指定输出主人声文件夹",
|
41 |
+
"指定输出非主人声文件夹": "指定输出非主人声文件夹",
|
42 |
+
"训练": "トレーニング",
|
43 |
+
"step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "ステップ1:実験設定を入力します。実験データはlogsに保存され、各実験にはフォルダーがあります。実験名のパスを手動で入力する必要があり、実験設定、ログ、トレーニングされたモデルファイルが含まれます。",
|
44 |
+
"输入实验名": "モデル名",
|
45 |
+
"目标采样率": "目標サンプリングレート",
|
46 |
+
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "モデルに音高ガイドがあるかどうか(歌唱には必要ですが、音声には必要ありません)",
|
47 |
+
"版本(目前仅40k支持了v2)": "バージョン(現在v2をサポートしているのは40kのみ)",
|
48 |
+
"提取音高和处理数据使用的CPU进程数": "ピッチの抽出やデータ処理に使用するCPUスレッド数",
|
49 |
+
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "ステップ2a: 訓練フォルダー内のすべての音声ファイルを自動的に探索し、スライスと正規化を行い、2つのwavフォルダーを実験ディレクトリに生成します。現在は一人でのトレーニングのみをサポートしています。",
|
50 |
+
"输入训练文件夹路径": "トレーニング用フォルダのパスを入力してください",
|
51 |
+
"请指定说话人id": "話者IDを指定してください",
|
52 |
+
"处理数据": "データ処理",
|
53 |
+
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "ステップ2b: CPUを使用して音高を抽出する(モデルに音高がある場合)、GPUを使用して特徴を抽出する(GPUの番号を選択する)",
|
54 |
+
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "ハイフンで区切って使用するGPUの番号を入力します。例えば0-1-2はGPU0、GPU1、GPU2を使用します",
|
55 |
+
"显卡信息": "GPU情報",
|
56 |
+
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "音高抽出アルゴリズムの選択:歌声を入力する場合は、pmを使用して速度を上げることができます。CPUが低い場合はdioを使用して速度を上げることができます。harvestは品質が高く、精度が高いですが、遅いです。",
|
57 |
+
"特征提取": "特徴抽出",
|
58 |
+
"step3: 填写训练设置, 开始训练模型和索引": "ステップ3: トレーニング設定を入力して、モデルとインデックスのトレーニングを開始します",
|
59 |
+
"保存频率save_every_epoch": "エポックごとの保存頻度",
|
60 |
+
"总训练轮数total_epoch": "総エポック数",
|
61 |
+
"每张显卡的batch_size": "GPUごとのバッチサイズ",
|
62 |
+
"是否仅保存最新的ckpt文件以节省硬盘空间": "ハードディスク容量を節約するため、最新のckptファイルのみを保存するかどうか",
|
63 |
+
"否": "いいえ",
|
64 |
+
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "すべてのトレーニングデータをメモリにキャッシュするかどうか。10分以下の小さなデータはキャッシュしてトレーニングを高速化できますが、大きなデータをキャッシュするとメモリが破裂し、あまり速度が上がりません。",
|
65 |
+
"是否在每次保存时间点将最终小模型保存至weights文件夹": "各保存時点の小モデルを全部weightsフォルダに保存するかどうか",
|
66 |
+
"加载预训练底模G路径": "事前学習済みのGモデルのパス",
|
67 |
+
"加载预训练底模D路径": "事前学習済みのDモデルのパス",
|
68 |
+
"训练模型": "モデルのトレーニング",
|
69 |
+
"训���特征索引": "特徴インデックスのトレーニング",
|
70 |
+
"一键训练": "ワンクリックトレーニング",
|
71 |
+
"ckpt处理": "ckptファイルの処理",
|
72 |
+
"模型融合, 可用于测试音色融合": "モデルのマージ、音源のマージテストに使用できます",
|
73 |
+
"A模型路径": "Aモデルのパス",
|
74 |
+
"B模型路径": "Bモデルのパス",
|
75 |
+
"A模型权重": "Aモデルの重み",
|
76 |
+
"模型是否带音高指导": "モデルに音高ガイドを付けるかどうか",
|
77 |
+
"要置入的模型信息": "挿入するモデル情報",
|
78 |
+
"保存的模型名不带后缀": "拡張子のない保存するモデル名",
|
79 |
+
"模型版本型号": "モデルのバージョン",
|
80 |
+
"融合": "フュージョン",
|
81 |
+
"修改模型信息(仅支持weights文件夹下提取的小模型文件)": "モデル情報の修正(weightsフォルダから抽出された小さなモデルファイルのみ対応)",
|
82 |
+
"模型路径": "モデルパス",
|
83 |
+
"要改的模型信息": "変更するモデル情報",
|
84 |
+
"保存的文件名, 默认空为和源文件同名": "保存するファイル名、デフォルトでは空欄で元のファイル名と同じ名前になります",
|
85 |
+
"修改": "変更",
|
86 |
+
"查看模型信息(仅支持weights文件夹下提取的小模型文件)": "モデル情報を表示する(小さいモデルファイルはweightsフォルダーからのみサポートされています)",
|
87 |
+
"查看": "表示",
|
88 |
+
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "モデル抽出(ログフォルダー内の大きなファイルのモデルパスを入力)、モデルを半分までトレーニングし、自動的に小さいファイルモデルを保存しなかったり、中間モデルをテストしたい場合に適用されます。",
|
89 |
+
"保存名": "保存ファイル名",
|
90 |
+
"模型是否带音高指导,1是0否": "モデルに音高ガイドを付けるかどうか、1は付ける、0は付けない",
|
91 |
+
"提取": "抽出",
|
92 |
+
"Onnx导出": "Onnx",
|
93 |
+
"RVC模型路径": "RVCモデルパス",
|
94 |
+
"Onnx输出路径": "Onnx出力パス",
|
95 |
+
"MoeVS模型": "MoeSS?",
|
96 |
+
"导出Onnx模型": "Onnxに変換",
|
97 |
+
"常见问题解答": "よくある質問",
|
98 |
+
"招募音高曲线前端编辑器": "音高曲線フロントエンドエディターを募集",
|
99 |
+
"加开发群联系我xxxxx": "開発グループに参加して私に連絡してくださいxxxxx",
|
100 |
+
"点击查看交流、问题反馈群号": "クリックして交流、問題フィードバックグループ番号を表示",
|
101 |
+
"xxxxx": "xxxxx",
|
102 |
+
"加载模型": "モデルをロード",
|
103 |
+
"Hubert模型": "Hubertモデル",
|
104 |
+
"选择.pth文件": ".pthファイルを選択",
|
105 |
+
"选择.index文件": ".indexファイルを選択",
|
106 |
+
"选择.npy文件": ".npyファイルを選択",
|
107 |
+
"输入设备": "入力デバイス",
|
108 |
+
"输出设备": "出力デバイス",
|
109 |
+
"音频设备(请使用同种类驱动)": "オーディオデバイス(同じ種類のドライバーを使用してください)",
|
110 |
+
"响应阈值": "反応閾値",
|
111 |
+
"音调设置": "音程設定",
|
112 |
+
"Index Rate": "Index Rate",
|
113 |
+
"常规设置": "一般設定",
|
114 |
+
"采样长度": "サンプル長",
|
115 |
+
"淡入淡出长度": "フェードイン/フェードアウト長",
|
116 |
+
"额外推理时长": "追加推論時間",
|
117 |
+
"输入降噪": "入力ノイズの低減",
|
118 |
+
"输出降噪": "出力ノイズの低減",
|
119 |
+
"性能设置": "パフォーマンス設定",
|
120 |
+
"开始音频转换": "音声変換を開始",
|
121 |
+
"停止音频转换": "音声変換を停止",
|
122 |
+
"推理时间(ms):": "推論時間(ms):"
|
123 |
+
}
|
i18n/locale_diff.py
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os
|
3 |
+
from collections import OrderedDict
|
4 |
+
|
5 |
+
# Define the standard file name
|
6 |
+
standard_file = "zh_CN.json"
|
7 |
+
|
8 |
+
# Find all JSON files in the directory
|
9 |
+
dir_path = "./"
|
10 |
+
languages = [
|
11 |
+
f for f in os.listdir(dir_path) if f.endswith(".json") and f != standard_file
|
12 |
+
]
|
13 |
+
|
14 |
+
# Load the standard file
|
15 |
+
with open(standard_file, "r", encoding="utf-8") as f:
|
16 |
+
standard_data = json.load(f, object_pairs_hook=OrderedDict)
|
17 |
+
|
18 |
+
# Loop through each language file
|
19 |
+
for lang_file in languages:
|
20 |
+
# Load the language file
|
21 |
+
with open(lang_file, "r", encoding="utf-8") as f:
|
22 |
+
lang_data = json.load(f, object_pairs_hook=OrderedDict)
|
23 |
+
|
24 |
+
# Find the difference between the language file and the standard file
|
25 |
+
diff = set(standard_data.keys()) - set(lang_data.keys())
|
26 |
+
|
27 |
+
miss = set(lang_data.keys()) - set(standard_data.keys())
|
28 |
+
|
29 |
+
# Add any missing keys to the language file
|
30 |
+
for key in diff:
|
31 |
+
lang_data[key] = key
|
32 |
+
|
33 |
+
# Del any extra keys to the language file
|
34 |
+
for key in miss:
|
35 |
+
del lang_data[key]
|
36 |
+
|
37 |
+
# Sort the keys of the language file to match the order of the standard file
|
38 |
+
lang_data = OrderedDict(
|
39 |
+
sorted(lang_data.items(), key=lambda x: list(standard_data.keys()).index(x[0]))
|
40 |
+
)
|
41 |
+
|
42 |
+
# Save the updated language file
|
43 |
+
with open(lang_file, "w", encoding="utf-8") as f:
|
44 |
+
json.dump(lang_data, f, ensure_ascii=False, indent=4)
|
45 |
+
f.write("\n")
|
i18n/zh_CN.json
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
|
3 |
+
"是": "是",
|
4 |
+
"step1:正在处理数据": "step1:正在处理数据",
|
5 |
+
"step2a:无需提取音高": "step2a:无需提取音高",
|
6 |
+
"step2b:正在提取特征": "step2b:正在提取特征",
|
7 |
+
"step3a:正在训练模型": "step3a:正在训练模型",
|
8 |
+
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
|
9 |
+
"全流程结束!": "全流程结束!",
|
10 |
+
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.",
|
11 |
+
"模型推理": "模型推理",
|
12 |
+
"推理音色": "推理音色",
|
13 |
+
"刷新音色列表和索引路径": "刷新音色列表和索引路径",
|
14 |
+
"卸载音色省显存": "卸载音色省显存",
|
15 |
+
"请选择说话人id": "请选择说话人id",
|
16 |
+
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ",
|
17 |
+
"变调(整数, 半音数量, 升八度12降八度-12)": "变调(整数, 半音数量, 升八度12降八度-12)",
|
18 |
+
"输入待处理音频文件路径(默认是正确格式示例)": "输入待处理音频文件路径(默认是正确格式示例)",
|
19 |
+
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
|
20 |
+
">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音",
|
21 |
+
"特征检索库文件路径,为空则使用下拉的选择结果": "特征检索库文件路径,为空则使用下拉的选择结果",
|
22 |
+
"自动检测index路径,下拉式选择(dropdown)": "自动检测index路径,下拉式选择(dropdown)",
|
23 |
+
"特征文件路径": "特征文件路径",
|
24 |
+
"检索特征占比": "检索特征占比",
|
25 |
+
"后处理重采样至最终采样率,0为不进行重采样": "后处理重采样至最终采样率,0为不进行重采样",
|
26 |
+
"输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络",
|
27 |
+
"保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果",
|
28 |
+
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调",
|
29 |
+
"转换": "转换",
|
30 |
+
"输出信息": "输出信息",
|
31 |
+
"输出音频(右下角三个点,点了可以下载)": "输出音频(右下角三个点,点了可以下载)",
|
32 |
+
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ",
|
33 |
+
"指定输出文件夹": "指定输出文件夹",
|
34 |
+
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)",
|
35 |
+
"也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量输入音频文件, 二选一, 优先读文件夹",
|
36 |
+
"导出文件格式": "导出文件格式",
|
37 |
+
"伴奏人声分离&去混响&去回声": "伴奏人声分离&去混响&去回声",
|
38 |
+
"输入待处理音频文件夹路径": "输入待处理音频文件夹路径",
|
39 |
+
"模型": "模型",
|
40 |
+
"指定输出主人声文件夹": "指定输出主人声文件夹",
|
41 |
+
"指定输出非主人声文件夹": "指定输出非主人声文件夹",
|
42 |
+
"训练": "训练",
|
43 |
+
"step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ",
|
44 |
+
"输入实验名": "输入实验名",
|
45 |
+
"目标采样率": "目标采样率",
|
46 |
+
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "模型是否带音高指导(唱歌一定要, 语音可以不要)",
|
47 |
+
"版本(目前仅40k支持了v2)": "版本(目前仅40k支持了v2)",
|
48 |
+
"提取音高和处理数据使用的CPU进程数": "提取音高和处理数据使用的CPU进程数",
|
49 |
+
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ",
|
50 |
+
"输入训练文件夹路径": "输入训练文件夹路径",
|
51 |
+
"请指定说话人id": "请指定说话人id",
|
52 |
+
"处理数据": "处理数据",
|
53 |
+
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)",
|
54 |
+
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2",
|
55 |
+
"显卡信息": "显卡信息",
|
56 |
+
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢",
|
57 |
+
"特征提取": "特征提取",
|
58 |
+
"step3: 填写训练设置, 开始训练模型和索引": "step3: 填写训练设置, 开始训练模型和索引",
|
59 |
+
"保存频率save_every_epoch": "保存频率save_every_epoch",
|
60 |
+
"总训练轮数total_epoch": "总训练轮数total_epoch",
|
61 |
+
"每张显卡的batch_size": "每张显卡的batch_size",
|
62 |
+
"是否仅保存最新的ckpt文件以节省硬盘空间": "是否仅保存最新的ckpt文件以节省硬盘空间",
|
63 |
+
"否": "否",
|
64 |
+
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速",
|
65 |
+
"是否在每次保存时间点将最终小模型保存至weights文件夹": "是否在每次保存时间点将最终小模型保存至weights文件夹",
|
66 |
+
"加载预训练底模G路径": "加载预训练底模G路径",
|
67 |
+
"加载预训练底模D路径": "加载预训练底模D路径",
|
68 |
+
"训练模型": "训练模型",
|
69 |
+
"训练特征索引": "训练特征索引",
|
70 |
+
"一键训练": "一键训练",
|
71 |
+
"ckpt处理": "ckpt处理",
|
72 |
+
"模型融合, 可用于测试音色融合": "模型融合, 可用于测试音色融合",
|
73 |
+
"A模型路径": "A模型路径",
|
74 |
+
"B模型路径": "B模型路径",
|
75 |
+
"A模型权重": "A模型权重",
|
76 |
+
"模型是否带音高指导": "模型是否带音高指导",
|
77 |
+
"要置入的模型信息": "要置入的模型信息",
|
78 |
+
"保存的模型名不带后缀": "保存的模型名不带后缀",
|
79 |
+
"模型版本型号": "模型版本型号",
|
80 |
+
"融合": "融合",
|
81 |
+
"修改模型信息(仅支持weights文件夹下提取的小模型文件)": "修改模型信息(仅支持weights文件夹下提取的小模型文件)",
|
82 |
+
"模型路径": "模型路径",
|
83 |
+
"要改的模型信息": "要改的模型信息",
|
84 |
+
"保存的文件名, 默认空为和源文件同名": "保存的文件名, 默认空为和源文件同名",
|
85 |
+
"修改": "修改",
|
86 |
+
"查看模型信息(仅支持weights文件夹下提取的小模型文件)": "查看模型信息(仅支持weights文件夹下提取的小模型文件)",
|
87 |
+
"查看": "查看",
|
88 |
+
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况",
|
89 |
+
"保存名": "保存名",
|
90 |
+
"模型是否带音高指导,1是0否": "模型是否带音高指导,1是0否",
|
91 |
+
"提取": "提取",
|
92 |
+
"Onnx导出": "Onnx导出",
|
93 |
+
"RVC模型路径": "RVC模型路径",
|
94 |
+
"Onnx输出路径": "Onnx输出路径",
|
95 |
+
"MoeVS模型": "MoeVS模型",
|
96 |
+
"导出Onnx模型": "导出Onnx模型",
|
97 |
+
"常见问题解答": "常见问题解答",
|
98 |
+
"招募音高曲线前端编辑器": "招募音高曲线前端编辑器",
|
99 |
+
"加开发群联系我xxxxx": "加开发群联系我xxxxx",
|
100 |
+
"点击查看交流、问题反馈群号": "点击查看交流、问题反馈群号",
|
101 |
+
"xxxxx": "xxxxx",
|
102 |
+
"加载模型": "加载模型",
|
103 |
+
"Hubert模型": "Hubert模型",
|
104 |
+
"选择.pth文件": "选择.pth文件",
|
105 |
+
"选择.index文件": "选择.index文件",
|
106 |
+
"选择.npy文件": "选择.npy文件",
|
107 |
+
"输入设备": "输入设备",
|
108 |
+
"输出设备": "输出设备",
|
109 |
+
"音频设备(请使用同种类驱动)": "音频设备(请使用同种类驱动)",
|
110 |
+
"响应阈值": "响应阈值",
|
111 |
+
"音调设置": "音调设置",
|
112 |
+
"Index Rate": "Index Rate",
|
113 |
+
"常规设置": "常规设置",
|
114 |
+
"采样长度": "采样长度",
|
115 |
+
"淡入淡出长度": "淡入淡出长度",
|
116 |
+
"额外推理时长": "额外推理时长",
|
117 |
+
"输入降噪": "输入降噪",
|
118 |
+
"输出降噪": "输出降噪",
|
119 |
+
"性能设置": "性能设置",
|
120 |
+
"开始音频转换": "开始音频转换",
|
121 |
+
"停止音频转换": "停止音频转换",
|
122 |
+
"推理时间(ms):": "推理时间(ms):"
|
123 |
+
}
|
i18n/zh_HK.json
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
|
3 |
+
"是": "是",
|
4 |
+
"step1:正在处理数据": "step1:正在处理数据",
|
5 |
+
"step2a:无需提取音高": "step2a:无需提取音高",
|
6 |
+
"step2b:正在提取特征": "step2b:正在提取特征",
|
7 |
+
"step3a:正在训练模型": "step3a:正在训练模型",
|
8 |
+
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
|
9 |
+
"全流程结束!": "全流程结束!",
|
10 |
+
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本軟體以MIT協議開源,作者不對軟體具備任何控制力,使用軟體者、傳播軟體導出的聲音者自負全責。<br>如不認可該條款,則不能使用或引用軟體包內任何程式碼和檔案。詳見根目錄<b>使用需遵守的協議-LICENSE.txt</b>。",
|
11 |
+
"模型推理": "模型推理",
|
12 |
+
"推理音色": "推理音色",
|
13 |
+
"刷新音色列表和索引路径": "刷新音色列表和索引路徑",
|
14 |
+
"卸载音色省显存": "卸載音色節省 VRAM",
|
15 |
+
"请选择说话人id": "請選擇說話人ID",
|
16 |
+
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key,女性轉男性推薦-12key,如果音域爆炸導致音色失真也可以自己調整到合適音域。",
|
17 |
+
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
|
18 |
+
"输入待处理音频文件路径(默认是正确格式示例)": "輸入待處理音頻檔案路徑(預設是正確格式示例)",
|
19 |
+
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "選擇音高提取演算法,輸入歌聲可用pm提速,harvest低音好但巨慢無比,crepe效果好但吃GPU",
|
20 |
+
">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": ">=3則使用對harvest音高識別的結果使用中值濾波,數值為濾波半徑,使用可以削弱啞音",
|
21 |
+
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
|
22 |
+
"自动检测index路径,下拉式选择(dropdown)": "自動檢測index路徑,下拉式選擇(dropdown)",
|
23 |
+
"特征文件路径": "特徵檔案路徑",
|
24 |
+
"检索特征占比": "檢索特徵佔比",
|
25 |
+
"后处理重采样至最终采样率,0为不进行重采样": "後處理重採樣至最終採樣率,0為不進行重採樣",
|
26 |
+
"输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "輸入源音量包絡替換輸出音量包絡融合比例,越靠近1越使用輸出包絡",
|
27 |
+
"保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "保護清輔音和呼吸聲,防止電音撕裂等artifact,拉滿0.5不開啟,調低加大保護力度但可能降低索引效果",
|
28 |
+
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案,可選,一行一個音高,代替預設的F0及升降調",
|
29 |
+
"转换": "轉換",
|
30 |
+
"输出信息": "輸出訊息",
|
31 |
+
"输出音频(右下角三个点,点了可以下载)": "輸出音頻(右下角三個點,點了可以下載)",
|
32 |
+
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "批量轉換,輸入待轉換音頻資料夾,或上傳多個音頻檔案,在指定資料夾(默認opt)下輸出轉換的音頻。",
|
33 |
+
"指定输出文件夹": "指定輸出資料夾",
|
34 |
+
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "輸入待處理音頻資料夾路徑(去檔案管理器地址欄拷貝即可)",
|
35 |
+
"也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量輸入音頻檔案,二選一,優先讀資料夾",
|
36 |
+
"导出文件格式": "導出檔格式",
|
37 |
+
"伴奏人声分离&去混响&去回声": "伴奏人声分离&去混响&去回声",
|
38 |
+
"输入待处理音频文件夹路径": "輸入待處理音頻資料夾路徑",
|
39 |
+
"模型": "模型",
|
40 |
+
"指定输出主人声文件夹": "指定输出主人声文件夹",
|
41 |
+
"指定输出非主人声文件夹": "指定输出非主人声文件夹",
|
42 |
+
"训练": "訓練",
|
43 |
+
"step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "step1:填寫實驗配置。實驗數據放在logs下,每個實驗一個資料夾,需手動輸入實驗名路徑,內含實驗配置、日誌、訓練得到的模型檔案。",
|
44 |
+
"输入实验名": "輸入實驗名稱",
|
45 |
+
"目标采样率": "目標取樣率",
|
46 |
+
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "模型是否帶音高指導(唱歌一定要,語音可以不要)",
|
47 |
+
"版本(目前仅40k支持了v2)": "版本(目前僅40k支持了v2)",
|
48 |
+
"提取音高和处理数据使用的CPU进程数": "提取音高和處理數據使用的CPU進程數",
|
49 |
+
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a:自動遍歷訓練資料夾下所有可解碼成音頻的檔案並進行切片歸一化,在實驗目錄下生成2個wav資料夾;暫時只支援單人訓練。",
|
50 |
+
"输入训练文件夹路径": "輸入訓練檔案夾路徑",
|
51 |
+
"请指定说话人id": "請指定說話人id",
|
52 |
+
"处理数据": "處理資料",
|
53 |
+
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "步驟2b: 使用CPU提取音高(如果模型帶音高), 使用GPU提取特徵(選擇卡號)",
|
54 |
+
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
|
55 |
+
"显卡信息": "顯示卡資訊",
|
56 |
+
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "選擇音高提取算法:輸入歌聲可用pm提速,高品質語音但CPU差可用dio提速,harvest品質更好但較慢",
|
57 |
+
"特征提取": "特徵提取",
|
58 |
+
"step3: 填写训练设置, 开始训练模型和索引": "步驟3: 填寫訓練設定, 開始訓練模型和索引",
|
59 |
+
"保存频率save_every_epoch": "保存頻率save_every_epoch",
|
60 |
+
"总训练轮数total_epoch": "總訓練輪數total_epoch",
|
61 |
+
"每张显卡的batch_size": "每张显卡的batch_size",
|
62 |
+
"是否仅保存最新的ckpt文件以节省硬盘空间": "是否僅保存最新的ckpt檔案以節省硬碟空間",
|
63 |
+
"否": "否",
|
64 |
+
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "是否緩存所有訓練集至 VRAM。小於10分鐘的小數據可緩存以加速訓練,大數據緩存會爆 VRAM 也加不了多少速度",
|
65 |
+
"是否在每次保存时间点将最终小模型保存至weights文件夹": "是否在每次保存時間點將最終小模型保存至weights檔夾",
|
66 |
+
"加载预训练底模G路径": "加載預訓練底模G路徑",
|
67 |
+
"加载预训练底模D路径": "加載預訓練底模D路徑",
|
68 |
+
"训练模型": "訓練模型",
|
69 |
+
"训练特征索引": "訓練特徵索引",
|
70 |
+
"一键训练": "一鍵訓練",
|
71 |
+
"ckpt处理": "ckpt處理",
|
72 |
+
"模型融合, 可用于测试音色融合": "模型融合,可用於測試音色融合",
|
73 |
+
"A模型路径": "A模型路徑",
|
74 |
+
"B模型路径": "B模型路徑",
|
75 |
+
"A模型权重": "A模型權重",
|
76 |
+
"模型是否带音高指导": "模型是否帶音高指導",
|
77 |
+
"要置入的模型信息": "要置入的模型資訊",
|
78 |
+
"保存的模型名不带后缀": "儲存的模型名不帶副檔名",
|
79 |
+
"模型版本型号": "模型版本型號",
|
80 |
+
"融合": "融合",
|
81 |
+
"修改模型信息(仅支持weights文件夹下提取的小模型文件)": "修改模型資訊(僅支援weights資料夾下提取的小模型檔案)",
|
82 |
+
"模型路径": "模型路徑",
|
83 |
+
"要改的模型信息": "要改的模型資訊",
|
84 |
+
"保存的文件名, 默认空为和源文件同名": "儲存的檔案名,預設空為與來源檔案同名",
|
85 |
+
"修改": "修改",
|
86 |
+
"查看模型信息(仅支持weights文件夹下提取的小模型文件)": "查看模型資訊(僅支援weights資料夾下提取的小模型檔案)",
|
87 |
+
"查看": "查看",
|
88 |
+
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "模型提取(輸入logs資料夾下大檔案模型路徑),適用於訓一半不想訓了模型沒有自動提取儲存小檔案模型,或者想測試中間模型的情況",
|
89 |
+
"保存名": "儲存名",
|
90 |
+
"模型是否带音高指导,1是0否": "模型是否帶音高指導,1是0否",
|
91 |
+
"提取": "提取",
|
92 |
+
"Onnx导出": "Onnx导出",
|
93 |
+
"RVC模型路径": "RVC模型路径",
|
94 |
+
"Onnx输出路径": "Onnx输出路径",
|
95 |
+
"MoeVS模型": "MoeSS模型",
|
96 |
+
"导出Onnx模型": "导出Onnx模型",
|
97 |
+
"常见问题解答": "常見問題解答",
|
98 |
+
"招募音高曲线前端编辑器": "招募音高曲線前端編輯器",
|
99 |
+
"加开发群联系我xxxxx": "加開發群聯繫我xxxxx",
|
100 |
+
"点击查看交流、问题反馈群号": "點擊查看交流、問題反饋群號",
|
101 |
+
"xxxxx": "xxxxx",
|
102 |
+
"加载模型": "載入模型",
|
103 |
+
"Hubert模型": "Hubert 模型",
|
104 |
+
"选择.pth文件": "選擇 .pth 檔案",
|
105 |
+
"选择.index文件": "選擇 .index 檔案",
|
106 |
+
"选择.npy文件": "選擇 .npy 檔案",
|
107 |
+
"输入设备": "輸入設備",
|
108 |
+
"输出设备": "輸出設備",
|
109 |
+
"音频设备(请使用同种类驱动)": "音訊設備 (請使用同種類驅動)",
|
110 |
+
"响应阈值": "響應閾值",
|
111 |
+
"音调设置": "音調設定",
|
112 |
+
"Index Rate": "Index Rate",
|
113 |
+
"常规设置": "一般設定",
|
114 |
+
"采样长度": "取樣長度",
|
115 |
+
"淡入淡出长度": "淡入淡出長度",
|
116 |
+
"额外推理时长": "額外推理時長",
|
117 |
+
"输入降噪": "輸入降噪",
|
118 |
+
"输出降噪": "輸出降噪",
|
119 |
+
"性能设置": "效能設定",
|
120 |
+
"开始音频转换": "開始音訊轉換",
|
121 |
+
"停止音频转换": "停止音訊轉換",
|
122 |
+
"推理时间(ms):": "推理時間(ms):"
|
123 |
+
}
|