62 Commits

Author SHA1 Message Date
源文雨
97943739c2 backport: madewithlove sheild 2023-08-27 00:23:01 +08:00
源文雨
b5aa85d315 add v1 suffix 2023-07-23 02:13:33 +08:00
源文雨
415173dc94 add v1 suffix 2023-07-23 02:10:58 +08:00
源文雨
178a4b9829 fix push format 2023-07-23 01:59:07 +08:00
github-actions[bot]
cd0dd26ad1 🎨 同步 locale (#826)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-23 01:46:49 +08:00
源文雨
aff93d8bb5 backup v1 2023-07-23 01:44:12 +08:00
RVC-Boss
3909ce4a7b Add files via upload 2023-05-13 03:49:38 +08:00
RVC-Boss
0d2212c8ea Add files via upload 2023-05-13 03:47:56 +08:00
github-actions[bot]
af41184320 Format code (#274)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-12 19:43:05 +00:00
RVC-Boss
568378761b Update Changelog_CN.md 2023-05-12 19:41:06 +00:00
RVC-Boss
44449efc2e Add files via upload 2023-05-13 03:29:30 +08:00
github-actions[bot]
0bc1ea782e Format code (#270)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-12 19:27:59 +00:00
Ftps
3d8d0957e4 remove Unnecessary elif (#259) 2023-05-12 19:27:44 +00:00
RVC-Boss
ef016ae6a0 Update gui.py 2023-05-11 14:29:56 +00:00
RVC-Boss
c84371844a default sr->40k is the best; unload weight debug []->""
default sr->40k is the best; unload weight debug []->""
2023-05-11 03:07:02 +08:00
源文雨
339a116074 Update README.md 2023-05-10 23:39:04 +08:00
github-actions[bot]
2f8179fa32 🎨 同步 locale (#266)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-10 23:36:36 +08:00
Sebastian Gabriel Savu
2086a7dab4 [maintenance] change f0 choice to boolean instead of string yes/no + default sample rate for training to 48k (#265) 2023-05-10 23:30:19 +08:00
源文雨
9bab76741e Update README.md 2023-05-10 23:27:33 +08:00
Ftps
769cf352a0 update faiss (#261) 2023-05-10 23:24:03 +08:00
RVC-Boss
c7f6a181a0 Update config.py 2023-05-10 13:19:09 +00:00
Ftps
6cc2279fb9 Support mps generate (#263) 2023-05-10 13:17:13 +00:00
RVC-Boss
5b0ff12163 Update README.md 2023-05-09 11:49:05 +08:00
RVC-Boss
1782a6332e Update requirements.txt 2023-05-08 15:40:06 +00:00
RVC-Boss
28dd13420c Update requirements.txt 2023-05-08 15:34:45 +00:00
github-actions[bot]
75d31f1022 Format code (#254)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-08 15:16:19 +00:00
liu biao
eba9b05b28 增加在macos下安装swig说明 (#253) 2023-05-08 15:16:09 +00:00
RVC-Boss
2c4ec6db93 Update trainset_preprocess_pipeline_print.py 2023-05-08 15:04:21 +00:00
RVC-Boss
4a2c9c062f Update gui.py 2023-05-07 17:42:30 +00:00
RVC-Boss
5928d5358c Update gui.py 2023-05-07 17:40:09 +00:00
Scott
f695fe60f6 Add English CHANGELOG (#243) 2023-05-07 16:24:13 +00:00
源文雨
5d7b649175 Update README.md 2023-05-07 13:46:23 +08:00
源文雨
73992be783 增加发行时自动构建docker镜像 2023-05-07 13:43:27 +08:00
Sebastian Gabriel Savu
d43c1d3cdd add ability to containerize with Docker (add Dockerfile) (#240)
Co-authored-by: Sebastian Savu <sebastian.savu@bidfx.com>
2023-05-07 13:32:16 +08:00
github-actions[bot]
b5b9af0255 🎨 同步 locale (#239)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-07 13:30:57 +08:00
RVC-Boss
aabbcb70c1 Update README.en.md 2023-05-06 18:42:08 +08:00
RVC-Boss
ddec7b713f Update README.md 2023-05-06 18:40:42 +08:00
R0w9h
e76654e634 Update ja_JP.json (#238) 2023-05-06 10:45:39 +09:00
github-actions[bot]
eb7caaa064 Format code (#228)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-06 00:14:11 +08:00
Ftps
e3cb0485ce staticmethod (#232) 2023-05-06 00:13:27 +08:00
Sebastian Gabriel Savu
4abd0bd680 [maintenance] cleanup one click training and related (#219)
- remove unused imports
- remove unused gpus6 param from train1key fn
- improve readability and reusability for various pathing strings
 main
2023-05-05 23:48:39 +08:00
github-actions[bot]
4027928a8e Format code (#227)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-05 14:18:51 +08:00
RVC-Boss
15519de5e5 Update i18n.py 2023-05-05 14:14:31 +08:00
github-actions[bot]
6726af00cf Format code (#221)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-05 13:13:41 +08:00
RVC-Boss
ccf6e6bbd2 batch_add_faiss_index
batch_add_faiss_index
2023-05-05 00:26:52 +08:00
RVC-Boss
da34d75ec9 Add files via upload 2023-05-04 22:22:46 +08:00
nadare
b18f921a50 big_npy should be shuffled (#218) 2023-05-04 14:03:52 +00:00
RVC-Boss
c4a18107dc Update config.py 2023-05-02 12:31:05 +00:00
github-actions[bot]
951989117b Format code (#214)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-02 20:22:08 +08:00
RVC-Boss
71427575c4 Update infer-web.py 2023-05-02 12:17:09 +00:00
RVC-Boss
8370356d95 Update config.py 2023-05-02 12:07:03 +00:00
nadare
69ea94609b update training tips and faiss tips (#208) 2023-04-30 22:26:25 +08:00
Ftps
6d0ec4b00c Escaping when device does not match (#203) 2023-04-29 04:18:06 +00:00
Ftps
b12e33891c fix open (#200) 2023-04-29 12:11:13 +08:00
github-actions[bot]
4cb010bac6 🎨 同步 locale (#196)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-28 20:46:39 +08:00
github-actions[bot]
e9301d7a08 Format code (#195)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-28 20:45:21 +08:00
bycloud
bbe333552f added some more zh to en_US translation (#194)
* Add files via upload

* updated i18n() translation for en_US

expanded the dict for other languages

* added more i18n()

---------

Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com>
2023-04-28 20:44:46 +08:00
Ftps
f391ac1763 Config class (#192)
* update config.py

* class

* class

* fix
2023-04-28 20:43:02 +08:00
源文雨
b1134d9f64 add 韓國語 2023-04-28 15:54:12 +08:00
RVC-Boss
211a842e88 Update infer-web.py 2023-04-28 11:31:13 +08:00
github-actions[bot]
9068d5283e Format code (#188)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-28 11:25:20 +08:00
RVC-Boss
9976df7045 Update Changelog_CN.md 2023-04-27 16:30:45 +00:00
36 changed files with 1259 additions and 661 deletions

View File

@@ -1,11 +1,11 @@
name: genlocale
name: genlocale_v1
on:
push:
branches:
- main
- v1
jobs:
golangci:
name: genlocale
genlocale_v1:
name: genlocale_v1
runs-on: ubuntu-latest
steps:
- name: Check out

View File

@@ -1,11 +1,14 @@
name: pull format
name: pull format v1
on: [pull_request]
on:
pull_request:
branches:
- v1
permissions:
contents: write
jobs:
pull_format:
pull_format_v1:
runs-on: ubuntu-latest
continue-on-error: true
steps:

View File

@@ -1,20 +1,20 @@
name: push format
name: push format v1
on:
push:
branches:
- main
- v1
permissions:
contents: write
pull-requests: write
jobs:
push_format:
push_format_v1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{github.ref_name}}
ref: v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
@@ -44,3 +44,5 @@ jobs:
with:
body: Apply Code Formatter Change
commit-message: Automatic code format
branch: create-pull-request/patchv1
delete-branch: true

View File

@@ -1,7 +1,15 @@
name: unitest
on: [ push, pull_request ]
name: unitest_v1
on:
push:
branches:
- v1
pull_request:
branches:
- v1
jobs:
build:
build_v1:
runs-on: ${{ matrix.os }}
strategy:
matrix:

2
.gitignore vendored
View File

@@ -4,3 +4,5 @@ __pycache__
*.pyd
hubert_base.pt
/logs
.venv
/pretrained_v2

View File

@@ -1,4 +1,21 @@
### 20230409
### 20230513更新
功能更新:
- 清除一键包内部老版本runtime内残留的infer_pack和uvr5_pack
- 修复训练集预处理伪多进程的bug
- 增加harvest识别音高可选通过中值滤波削弱哑音现象可调整中值滤波半径
- 导出音频增加后处理重采样
- 训练n_cpu进程数从"仅调整f0提取"改为"调整数据预处理和f0提取"
- 自动检测logs文件夹下的index路径提供下拉列表功能
- tab页增加"常见问题解答"也可参考github-rvc-wiki
待完成:
- 推理音量预处理归一化
- 推理后处理音量包络融合输入音频的音量包络
- 增加选项:每次epoch保存的小模型均进行提取
RVC很快会陆续更新v2版的新底模先发40k采样率的32k和48k的仍在训练中大幅改善呼吸、清辅音唇齿音的电音和撕裂伪影请期待
### 20230409更新
- 修正训练参数提升显卡平均利用率A100最高从25%提升至90%左右V100:50%->90%左右2060S:60%->85%左右P40:25%->95%左右,训练速度显著提升
- 修正参数总batch_size改为每张卡的batch_size
- 修正total_epoch最大限制100解锁至1000默认10提升至默认20
@@ -21,14 +38,14 @@
- 修复部分音频格式下UVR5人声伴奏分离的bug
- 实时变声迷你gui增加对非40k与不懈怠音高模型的支持
### 后续计划:
功能
- 增加选项:每次epoch保存的小模型均进行提取
- 增加选项:推理额外导出mp3至填写的路径
- 增加选项:推理额外导出mp3至填写的路径批量推理
- 支持多人训练选项卡至多4人
底模
- 收集呼吸wav加入训练集修正呼吸变声电音的问题
- 我们正在训练增加了歌声训练集的底模未来会公开
- 升级鉴别器
- 升级鉴别器尝试MRD
- 升级自监督特征结构

34
Changelog_EN.md Normal file
View File

@@ -0,0 +1,34 @@
### 2023-04-09
- 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
- Changed parameter: total batch_size is now per GPU batch_size
- Changed total_epoch: maximum limit increased from 100 to 1000; default increased from 10 to 20
- Fixed issue of ckpt extraction recognizing pitch incorrectly, causing abnormal inference
- Fixed issue of distributed training saving ckpt for each rank
- Applied nan feature filtering for feature extraction
- Fixed issue with silent input/output producing random consonants or noise (old models need to retrain with a new dataset)
### 2023-04-16 Update
- Added local real-time voice changing mini-GUI, start by double-clicking go-realtime-gui.bat
- Applied filtering for frequency bands below 50Hz during training and inference
- 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
- 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)
- Fixed recognition of some GPUs (e.g., V100-16G recognition failure, P4 recognition failure)
### 2023-04-28 Update
- Upgraded faiss index settings for faster speed and higher quality
- Removed dependency on total_npy; future model sharing will not require total_npy input
- Unlocked restrictions for the 16-series GPUs, providing 4GB inference settings for 4GB VRAM GPUs
- Fixed bug in UVR5 vocal accompaniment separation for certain audio formats
- Real-time voice changing mini-GUI now supports non-40k and non-lazy pitch models
### Future Plans:
Features:
- Add option: extract small models for each epoch save
- Add option: export additional mp3 to the specified path during inference
- Support multi-person training tab (up to 4 people)
Base model:
- Collect breathing wav files to add to the training dataset to fix the issue of distorted breath sounds
- We are currently training a base model with an extended singing dataset, which will be released in the future
- Upgrade discriminator
- Upgrade self-supervised feature structure

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
# syntax=docker/dockerfile:1
FROM python:3.10-bullseye
EXPOSE 7865
WORKDIR /app
COPY . .
RUN pip3 install -r requirements.txt
CMD ["python3", "infer-web.py"]

View File

@@ -3,7 +3,7 @@
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
一个基于VITS的简单易用的语音转换变声器框架<br><br>
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
[![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
@@ -13,13 +13,13 @@
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
[**更新日志**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md) | [**常见问题解答**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E7%AD%94) | [**AutoDL·5毛钱训练AI歌手**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/Autodl%E8%AE%AD%E7%BB%83RVC%C2%B7AI%E6%AD%8C%E6%89%8B%E6%95%99%E7%A8%8B) | [**对照实验记录**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/Autodl%E8%AE%AD%E7%BB%83RVC%C2%B7AI%E6%AD%8C%E6%89%8B%E6%95%99%E7%A8%8B](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/%E5%AF%B9%E7%85%A7%E5%AE%9E%E9%AA%8C%C2%B7%E5%AE%9E%E9%AA%8C%E8%AE%B0%E5%BD%95))
</div>
------
[**更新日志**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
[**English**](./docs/README.en.md) | [**中文简体**](./README.md) | [**日本語**](./docs/README.ja.md) | [**한국어**](./docs/README.ko.md)
[**English**](./docs/README.en.md) | [**中文简体**](./README.md) | [**日本語**](./docs/README.ja.md) | [**한국어**](./docs/README.ko.md) ([**韓國語**](./docs/README.ko.han.md))
> 点此查看我们的[演示视频](https://www.bilibili.com/video/BV1pm4y1z7Gm/) !
@@ -60,13 +60,18 @@ poetry install
```
你也可以通过pip来安装依赖
**注意**: `MacOS``faiss 1.7.2`版本会导致抛出段错误,在手动安装时请使用命令`pip install faiss-cpu==1.7.0`指定使用`1.7.0`版本
```bash
pip install -r requirements.txt
```
**注意**
1. 英特尔`MacOS`下使用pip安装`faiss 1.7.0`以上版本会导致抛出段错误,在手动安装时,如需安装最新版,请使用`conda`;如只能使用`pip`,请指定使用`1.7.0`版本。
2. `MacOS`下如`faiss`安装失败,可尝试通过`brew`安装`Swig`
```bash
brew install swig
```
## 其他预模型准备
RVC需要其他一些预模型来推理和训练。

215
config.py
View File

@@ -1,106 +1,117 @@
########################硬件参数########################
# 填写cuda:x, cpu 或 mps, x指代第几张卡只支持 N卡 / Apple Silicon 加速
device = "cuda:0"
# 9-10-20-30-40系显卡无脑True不影响质量>=20显卡开启有加速
is_half = True
# 默认0用上所有线程写数字限制CPU资源使用
n_cpu = 0
########################硬件参数########################
##################下为参数处理逻辑,勿动##################
########################命令行参数########################
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--port", type=int, default=7865, help="Listen port")
parser.add_argument("--pycmd", type=str, default="python", help="Python command")
parser.add_argument("--colab", action="store_true", help="Launch in colab")
parser.add_argument(
"--noparallel", action="store_true", help="Disable parallel processing"
)
parser.add_argument(
"--noautoopen", action="store_true", help="Do not open in browser automatically"
)
cmd_opts = parser.parse_args()
python_cmd = cmd_opts.pycmd
listen_port = cmd_opts.port if 0 <= cmd_opts.port <= 65535 else 7865
iscolab = cmd_opts.colab
noparallel = cmd_opts.noparallel
noautoopen = cmd_opts.noautoopen
########################命令行参数########################
import sys
import torch
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
# check `getattr` and try it for compatibility
def has_mps() -> bool:
if sys.platform != "darwin":
return False
else:
if not getattr(torch, "has_mps", False):
return False
try:
torch.zeros(1).to(torch.device("mps"))
return True
except Exception:
return False
if not torch.cuda.is_available():
if has_mps():
print("没有发现支持的N卡, 使用MPS进行推理")
device = "mps"
else:
print("没有发现支持的N卡, 使用CPU进行推理")
device = "cpu"
is_half = False
gpu_mem=None
if device not in ["cpu", "mps"]:
i_device=int(device.split(":")[-1])
gpu_name = torch.cuda.get_device_name(i_device)
if "16" in gpu_name or "P40"in gpu_name.upper() or "1070"in gpu_name or "1080"in gpu_name:
print("16系显卡强制单精度")
is_half = False
with open("configs/32k.json","r")as f:strr=f.read().replace("true","false")
with open("configs/32k.json","w")as f:f.write(strr)
with open("configs/40k.json","r")as f:strr=f.read().replace("true","false")
with open("configs/40k.json","w")as f:f.write(strr)
with open("configs/48k.json","r")as f:strr=f.read().replace("true","false")
with open("configs/48k.json","w")as f:f.write(strr)
with open("trainset_preprocess_pipeline_print.py","r")as f:strr=f.read().replace("3.7","3.0")
with open("trainset_preprocess_pipeline_print.py","w")as f:f.write(strr)
gpu_mem=int(torch.cuda.get_device_properties(i_device).total_memory/1024/1024/1024+0.4)
if(gpu_mem<=4):
with open("trainset_preprocess_pipeline_print.py","r")as f:strr=f.read().replace("3.7","3.0")
with open("trainset_preprocess_pipeline_print.py","w")as f:f.write(strr)
from multiprocessing import cpu_count
if n_cpu == 0:
n_cpu = cpu_count()
if is_half:
# 6G显存配置
x_pad = 3
x_query = 10
x_center = 60
x_max = 65
else:
# 5G显存配置
x_pad = 1
x_query = 6
x_center = 38
x_max = 41
if(gpu_mem!=None and gpu_mem<=4):
x_pad = 1
x_query = 5
x_center = 30
x_max = 32
class Config:
def __init__(self):
self.device = "cuda:0"
self.is_half = True
self.n_cpu = 0
self.gpu_name = None
self.gpu_mem = None
(
self.python_cmd,
self.listen_port,
self.iscolab,
self.noparallel,
self.noautoopen,
) = self.arg_parse()
self.x_pad, self.x_query, self.x_center, self.x_max = self.device_config()
@staticmethod
def arg_parse() -> tuple:
parser = argparse.ArgumentParser()
parser.add_argument("--port", type=int, default=7865, help="Listen port")
parser.add_argument(
"--pycmd", type=str, default="python", help="Python command"
)
parser.add_argument("--colab", action="store_true", help="Launch in colab")
parser.add_argument(
"--noparallel", action="store_true", help="Disable parallel processing"
)
parser.add_argument(
"--noautoopen",
action="store_true",
help="Do not open in browser automatically",
)
cmd_opts = parser.parse_args()
cmd_opts.port = cmd_opts.port if 0 <= cmd_opts.port <= 65535 else 7865
return (
cmd_opts.pycmd,
cmd_opts.port,
cmd_opts.colab,
cmd_opts.noparallel,
cmd_opts.noautoopen,
)
def device_config(self) -> tuple:
if torch.cuda.is_available():
i_device = int(self.device.split(":")[-1])
self.gpu_name = torch.cuda.get_device_name(i_device)
if (
("16" in self.gpu_name and "V100" not in self.gpu_name.upper())
or "P40" in self.gpu_name.upper()
or "1060" in self.gpu_name
or "1070" in self.gpu_name
or "1080" in self.gpu_name
):
print("16系/10系显卡和P40强制单精度")
self.is_half = False
for config_file in ["32k.json", "40k.json", "48k.json"]:
with open(f"configs/{config_file}", "r") as f:
strr = f.read().replace("true", "false")
with open(f"configs/{config_file}", "w") as f:
f.write(strr)
with open("trainset_preprocess_pipeline_print.py", "r") as f:
strr = f.read().replace("3.7", "3.0")
with open("trainset_preprocess_pipeline_print.py", "w") as f:
f.write(strr)
else:
self.gpu_name = None
self.gpu_mem = int(
torch.cuda.get_device_properties(i_device).total_memory
/ 1024
/ 1024
/ 1024
+ 0.4
)
if self.gpu_mem <= 4:
with open("trainset_preprocess_pipeline_print.py", "r") as f:
strr = f.read().replace("3.7", "3.0")
with open("trainset_preprocess_pipeline_print.py", "w") as f:
f.write(strr)
elif torch.backends.mps.is_available():
print("没有发现支持的N卡, 使用MPS进行推理")
self.device = "mps"
self.is_half = False
else:
print("没有发现支持的N卡, 使用CPU进行推理")
self.device = "cpu"
self.is_half = False
if self.n_cpu == 0:
self.n_cpu = cpu_count()
if self.is_half:
# 6G显存配置
x_pad = 3
x_query = 10
x_center = 60
x_max = 65
else:
# 5G显存配置
x_pad = 1
x_query = 6
x_center = 38
x_max = 41
if self.gpu_mem != None and self.gpu_mem <= 4:
x_pad = 1
x_query = 5
x_center = 30
x_max = 32
return x_pad, x_query, x_center, x_max

View File

@@ -1,7 +1,7 @@
<div align="center">
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
An easy-to-use SVC framework based on VITS.<br><br>
An easy-to-use Voice Conversion framework based on VITS.<br><br>
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
@@ -16,9 +16,9 @@ An easy-to-use SVC framework based on VITS.<br><br>
</div>
------
[**Changelog**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
[**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))
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md)
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
> Check our [Demo Video](https://www.bilibili.com/video/BV1pm4y1z7Gm/) here!

View File

@@ -19,7 +19,7 @@ VITSに基づく使いやすい音声変換voice changerframework<br><br>
[**更新日誌**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md)
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
> デモ動画は[こちら](https://www.bilibili.com/video/BV1pm4y1z7Gm/)でご覧ください。

102
docs/README.ko.han.md Normal file
View File

@@ -0,0 +1,102 @@
<div align="center">
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
VITS基盤의 簡單하고使用하기 쉬운音聲變換틀<br><br>
[![madewithlove](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI)
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
[![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)
[![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)
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
</div>
------
[**更新日誌**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
> [示範映像](https://www.bilibili.com/video/BV1pm4y1z7Gm/)을 確認해 보세요!
> RVC를活用한實時間音聲變換: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
> 基本모델은 50時間假量의 高品質 오픈 소스 VCTK 데이터셋을 使用하였으므로, 著作權上의 念慮가 없으니 安心하고 使用하시기 바랍니다.
> 著作權問題가 없는 高品質의 노래를 以後에도 繼續해서 訓練할 豫定입니다.
## 紹介
本Repo는 다음과 같은 特徵을 가지고 있습니다:
+ top1檢索을利用하여 入力音色特徵을 訓練세트音色特徵으로 代替하여 音色의漏出을 防止;
+ 相對的으로 낮은性能의 GPU에서도 빠른訓練可能;
+ 적은量의 데이터로 訓練해도 좋은 結果를 얻을 수 있음 (最小10分以上의 低雜음音聲데이터를 使用하는 것을 勸獎);
+ 모델融合을通한 音色의 變調可能 (ckpt處理탭->ckpt混合選擇);
+ 使用하기 쉬운 WebUI (웹 使用者인터페이스);
+ UVR5 모델을 利用하여 목소리와 背景音樂의 빠른 分離;
## 環境의準備
poetry를通해 依存를設置하는 것을 勸獎합니다.
다음命令은 Python 버전3.8以上의環境에서 實行되어야 합니다:
```bash
# PyTorch 關聯主要依存設置, 이미設置되어 있는 境遇 건너뛰기 可能
# 參照: https://pytorch.org/get-started/locally/
pip install torch torchvision torchaudio
# Windows + Nvidia Ampere Architecture(RTX30xx)를 使用하고 있다面, #21 에서 명시된 것과 같이 PyTorch에 맞는 CUDA 버전을 指定해야 합니다.
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
# Poetry 設置, 이미設置되어 있는 境遇 건너뛰기 可能
# Reference: https://python-poetry.org/docs/#installation
curl -sSL https://install.python-poetry.org | python3 -
# 依存設置
poetry install
```
pip를 活用하여依存를 設置하여도 無妨합니다.
**公知**: `MacOS`에서 `faiss 1.7.2`를 使用하면 Segmentation Fault: 11 誤謬가 發生할 수 있습니다. 手動으로 pip를 使用하여 設置하는境遇 `pip install faiss-cpu==1.7.0`을 使用해야 합니다.
```bash
pip install -r requirements.txt
```
## 其他預備모델準備
RVC 모델은 推論과訓練을 依하여 다른 預備모델이 必要합니다.
[Huggingface space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)를 通해서 다운로드 할 수 있습니다.
다음은 RVC에 必要한 預備모델 및 其他 파일 目錄입니다:
```bash
hubert_base.pt
./pretrained
./uvr5_weights
# Windows를 使用하는境遇 이 사전도 必要할 수 있습니다. FFmpeg가 設置되어 있으면 건너뛰어도 됩니다.
ffmpeg.exe
```
그後 以下의 命令을 使用하여 WebUI를 始作할 수 있습니다:
```bash
python infer-web.py
```
Windows를 使用하는境遇 `RVC-beta.7z`를 다운로드 및 壓縮解除하여 RVC를 直接使用하거나 `go-web.bat`을 使用하여 WebUi를 直接할 수 있습니다.
## 參考
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
+ [VITS](https://github.com/jaywalnut310/vits)
+ [HIFIGAN](https://github.com/jik876/hifi-gan)
+ [Gradio](https://github.com/gradio-app/gradio)
+ [FFmpeg](https://github.com/FFmpeg/FFmpeg)
+ [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
+ [audio-slicer](https://github.com/openvpi/audio-slicer)
## 모든寄與者분들의勞力에感謝드립니다
<a href="https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=liujing04/Retrieval-based-Voice-Conversion-WebUI" />
</a>

View File

@@ -18,7 +18,7 @@ VITS 기반의 간단하고 사용하기 쉬운 음성 변환 프레임워크.<b
------
[**업데이트 로그**](https://github.com/liujing04/Retrieval-based-Voice-Conversion-WebUI/blob/main/Changelog_CN.md)
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md)
[**English**](./README.en.md) | [**中文简体**](../README.md) | [**日本語**](./README.ja.md) | [**한국어**](./README.ko.md) ([**韓國語**](./README.ko.han.md))
> [데모 영상](https://www.bilibili.com/video/BV1pm4y1z7Gm/)을 확인해 보세요!
@@ -30,7 +30,7 @@ VITS 기반의 간단하고 사용하기 쉬운 음성 변환 프레임워크.<b
## 소개
본 Repo는 다음과 같은 특징을 가지고 있습니다:
+ top1 검색을 이용하여 입력 소스 기능을 훈련 세트 기능으로 대체하여 음색의 누출을 방지;
+ top1 검색을 이용하여 입력 음색 특징을 훈련 세트 음색 특징으로 대체하여 음색의 누출을 방지;
+ 상대적으로 낮은 성능의 GPU에서도 빠른 훈련 가능;
+ 적은 양의 데이터로 훈련해도 좋은 결과를 얻을 수 있음 (최소 10분 이상의 저잡음 음성 데이터를 사용하는 것을 권장);
+ 모델 융합을 통한 음색의 변조 가능 (ckpt 처리 탭->ckpt 병합 선택);
@@ -86,9 +86,7 @@ python infer-web.py
```
Windows를 사용하는 경우 `RVC-beta.7z`를 다운로드 및 압축 해제하여 RVC를 직접 사용하거나 `go-web.bat`을 사용하여 WebUi를 시작할 수 있습니다.
중국어로 된 RVC에 대한 튜토리얼도 있으니 필요하다면 확인할 수 있습니다.
## 크레딧
## 참고
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
+ [VITS](https://github.com/jaywalnut310/vits)
+ [HIFIGAN](https://github.com/jik876/hifi-gan)

View File

@@ -12,10 +12,7 @@ In '/logs/your-experiment/3_feature256' where the model is located, features ext
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].)
After saving big_npy as /logs/your-experiment/total_fea.npy, train it with faiss.
As of 2023/04/18, IVF based on L2 distance is used using the index factory function of faiss.
The number of IVF divisions (n_ivf) is N//39, and n_probe uses int(np.power(n_ivf, 0.3)). (Look around train_index in infer-web.py.)
In this article, I will first explain the meaning of these parameters, and then write advice for developers to create a better index.
In this article, I will explain the meaning of these parameters.
# Explanation of the method
## index factory
@@ -103,44 +100,3 @@ https://github.com/facebookresearch/faiss/wiki/Fast-accumulation-of-PQ-and-AQ-co
## RFlat
RFlat is an instruction to recalculate the rough distance calculated by FastScan with the exact distance specified by the third argument of index factory.
When getting k neighbors, k*k_factor points are recalculated.
# Techniques for embedding
## alpha query expansion
Query expansion is a technique used in searches, for example in full-text searches, where a few words are added to the entered search sentence to improve search accuracy. Several methods have also been proposed for vector search, among which α-query expansion is known as a highly effective method that does not require additional learning. In the paper, it is introduced in [Attention-Based Query Expansion Learning](https://arxiv.org/abs/2007.08019), etc., and [2nd place solution of kaggle shopee competition](https://www.kaggle.com/code/lyakaap/2nd-place-solution/notebook).
α-query expansion can be done by summing a vector with neighboring vectors with weights raised to the power of similarity. How to paste the code example. Replace big_npy with α query expansion.
```python
alpha = 3.
index = faiss.index_factory(256, "IVF512,PQ128x4fs,RFlat")
original_norm = np.maximum(np.linalg.norm(big_npy, ord=2, axis=1, keepdims=True), 1e-9)
big_npy /= original_norm
index.train(big_npy)
index.add(big_npy)
dist, neighbor = index.search(big_npy, num_expand)
expand_arrays = []
ixs = np.arange(big_npy.shape[0])
for i in range(-(-big_npy.shape[0]//batch_size)):
ix = ixs[i*batch_size:(i+1)*batch_size]
weight = np.power(np.einsum("nd,nmd->nm", big_npy[ix], big_npy[neighbor[ix]]), alpha)
expand_arrays.append(np.sum(big_npy[neighbor[ix]] * np.expand_dims(weight, axis=2),axis=1))
big_npy = np.concatenate(expand_arrays, axis=0)
# normalize index version
big_npy = big_npy / np.maximum(np.linalg.norm(big_npy, ord=2, axis=1, keepdims=True), 1e-9)
```
This is a technique that can be applied both to the query that does the search and to the DB being searched.
## Compress embedding with MiniBatch KMeans
If total_fea.npy is too large, it is possible to shrink the vector using KMeans.
Compression of embedding is possible with the following code. Specify the size you want to compress for n_clusters, and specify 256 * number of CPU cores for batch_size to fully benefit from CPU parallelization.
```python
import multiprocessing
from sklearn.cluster import MiniBatchKMeans
kmeans = MiniBatchKMeans(n_clusters=10000, batch_size=256 * multiprocessing.cpu_count(), init="random")
kmeans.fit(big_npy)
sample_npy = kmeans.cluster_centers_
```

View File

@@ -9,13 +9,9 @@ RVCではHuBERTで変換した特徴量のEmbeddingに対し、学習データ
# 実装のoverview
モデルが配置されている '/logs/your-experiment/3_feature256'には各音声データからHuBERTで抽出された特徴量が配置されています。
ここからnpyファイルをファイル名でソートした順番で読み込み、ベクトルを連結してbig_npyを作成します。(このベクトルのshapeは[N, 256]です。)
big_npyを/logs/your-experiment/total_fea.npyとして保存した後、faissを学習させます。
ここからnpyファイルをファイル名でソートした順番で読み込み、ベクトルを連結してbig_npyを作成しfaissを学習させます。(このベクトルのshapeは[N, 256]です。)
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周りを探してください。)
本Tipsではまずこれらのパラメータの意味を解説し、その後よりよいindexを作成するための開発者向けアドバイスを書きます。
本Tipsではまずこれらのパラメータの意味を解説します。
# 手法の解説
## index factory
@@ -103,44 +99,3 @@ https://github.com/facebookresearch/faiss/wiki/Fast-accumulation-of-PQ-and-AQ-co
## RFlat
RFlatはFastScanで計算した大まかな距離を、index factoryの第三引数で指定した正確な距離で再計算する指示です。
k個の近傍を取得する際は、k*k_factor個の点について再計算が行われます。
# Embeddingに関するテクニック
## alpha query expansion
クエリ拡張は検索で使われるテクニックで、例えば全文検索では入力された検索文に単語を幾つか追加することで検索精度を上げることがあります。ベクトル検索にもいくつか提唱されていて、その内追加の学習がいらず効果が高い手法としてα-query expansionが知られています。論文では[Attention-Based Query Expansion Learning](https://arxiv.org/abs/2007.08019)などで紹介されていて、[kaggleのshopeeコンペの2位の解法](https://www.kaggle.com/code/lyakaap/2nd-place-solution/notebook)にも用いられていました。
α-query expansionはあるベクトルに対し、近傍のベクトルを類似度のα乗した重みで足し合わせることでできます。いかにコードの例を張ります。big_npyをα query expansionしたものに置き換えます。
```python
alpha = 3.
index = faiss.index_factory(256, "IVF512,PQ128x4fs,RFlat")
original_norm = np.maximum(np.linalg.norm(big_npy, ord=2, axis=1, keepdims=True), 1e-9)
big_npy /= original_norm
index.train(big_npy)
index.add(big_npy)
dist, neighbor = index.search(big_npy, num_expand)
expand_arrays = []
ixs = np.arange(big_npy.shape[0])
for i in range(-(-big_npy.shape[0]//batch_size)):
ix = ixs[i*batch_size:(i+1)*batch_size]
weight = np.power(np.einsum("nd,nmd->nm", big_npy[ix], big_npy[neighbor[ix]]), alpha)
expand_arrays.append(np.sum(big_npy[neighbor[ix]] * np.expand_dims(weight, axis=2),axis=1))
big_npy = np.concatenate(expand_arrays, axis=0)
# normalize index version
big_npy = big_npy / np.maximum(np.linalg.norm(big_npy, ord=2, axis=1, keepdims=True), 1e-9)
```
これは、検索を行うクエリにも、検索対象のDBにも適応可能なテクニックです。
## MiniBatch KMeansによるembeddingの圧縮
total_fea.npyが大きすぎる場合、KMeansを用いてベクトルを小さくすることが可能です。
以下のコードで、embeddingの圧縮が可能です。n_clustersは圧縮したい大きさを指定し、batch_sizeは256 * CPUのコア数を指定することでCPUの並列化の恩恵を十分に得ることができます。
```python
import multiprocessing
from sklearn.cluster import MiniBatchKMeans
kmeans = MiniBatchKMeans(n_clusters=10000, batch_size=256 * multiprocessing.cpu_count(), init="random")
kmeans.fit(big_npy)
sample_npy = kmeans.cluster_centers_
```

89
docs/faq.md Normal file
View File

@@ -0,0 +1,89 @@
## Q1:ffmpeg error/utf8 error.
大概率不是ffmpeg问题而是音频路径问题<br>
ffmpeg读取路径带空格、()等特殊符号可能出现ffmpeg error训练集音频带中文路径在写入filelist.txt的时候可能出现utf8 error<br>
## Q2:一键训练结束没有索引
显示"Training is done. The program is closed."则模型训练成功,后续紧邻的报错是假的;<br>
一键训练结束完成没有added开头的索引文件可能是因为训练集太大卡住了添加索引的步骤已通过批处理add索引解决内存add索引对内存需求过大的问题。临时可尝试再次点击"训练索引"按钮。<br>
## Q3:训练结束推理没看到训练集的音色
点刷新音色再看看如果还没有看看训练有没有报错控制台和webui的截图logs/实验名下的log都可以发给开发者看看。<br>
## Q4:如何分享模型
rvc_root/logs/实验名 下面存储的pth不是用来分享模型用来推理的而是为了存储实验状态供复现以及继续训练用的。用来分享的模型应该是weights文件夹下大小为60+MB的pth文件<br>
后续将把weights/exp_name.pth和logs/exp_name/added_xxx.index合并打包成weights/exp_name.zip省去填写index的步骤那么zip文件用来分享不要分享pth文件除非是想换机器继续训练<br>
如果你把logs文件夹下的几百MB的pth文件复制/分享到weights文件夹下强行用于推理可能会出现f0tgt_sr等各种key不存在的报错。你需要用ckpt选项卡最下面手工或自动本地logs下如果能找到相关信息则会自动选择是否携带音高、目标音频采样率的选项后进行ckpt小模型提取输入路径填G开头的那个提取完在weights文件夹下会出现60+MB的pth文件刷新音色后可以选择使用。<br>
## Q5:Connection Error.
也许你关闭了控制台(黑色窗口)。<br>
## Q6:WebUI弹出Expecting value: line 1 column 1 (char 0).
请关闭系统局域网代理/全局代理。<br>
这个不仅是客户端的代理也包括服务端的代理例如你使用autodl设置了http_proxy和https_proxy学术加速使用时也需要unset关掉<br>
## Q7:不用WebUI如何通过命令训练推理
训练脚本:<br>
可先跑通WebUI消息窗内会显示数据集处理和训练用命令行<br>
推理脚本:<br>
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py<br>
例子:<br>
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>
f0up_key=sys.argv[1]<br>
input_path=sys.argv[2]<br>
index_path=sys.argv[3]<br>
f0method=sys.argv[4]#harvest or pm<br>
opt_path=sys.argv[5]<br>
model_path=sys.argv[6]<br>
index_rate=float(sys.argv[7])<br>
device=sys.argv[8]<br>
is_half=bool(sys.argv[9])<br>
## Q8:Cuda error/Cuda out of memory.
小概率是cuda配置问题、设备不支持大概率是显存不够out of memory<br>
训练的话缩小batch size如果缩小到1还不够只能更换显卡训练推理的话酌情缩小config.py结尾的x_padx_queryx_centerx_max。4G以下显存例如10603G和各种2G显卡可以直接放弃4G显存显卡还有救。<br>
## Q9:total_epoch调多少比较好
如果训练集音质差底噪大20~30足够了调太高底模音质无法带高你的低音质训练集<br>
如果训练集音质高底噪低时长多可以调高200是ok的训练速度很快既然你有条件准备高音质训练集显卡想必条件也不错肯定不在乎多一些训练时间<br>
## Q10:需要多少训练集时长
推荐10min至50min<br>
  保证音质高底噪低的情况下,如果有个人特色的音色统一,则多多益善<br>
  高水平的训练集(精简+音色有特色5min至10min也是ok的仓库作者本人就经常这么玩<br>
也有人拿1min至2min的数据来训练并且训练成功的但是成功经验是其他人不可复现的不太具备参考价值。这要求训练集音色特色非常明显比如说高频气声较明显的萝莉少女音且音质高<br>
1min以下时长数据目前没见有人尝试成功过。不建议进行这种鬼畜行为。<br>
## Q11:index rate干嘛用的怎么调科普
  如果底模和推理源的音质高于训练集的音质,他们可以带高推理结果的音质,但代价可能是音色往底模/推理源的音色靠,这种现象叫做"音色泄露"<br>
index rate用来削减/解决音色泄露问题。调到1则理论上不存在推理源的音色泄露问题但音质更倾向于训练集。如果训练集音质比推理源低则index rate调高可能降低音质。调到0则不具备利用检索混合来保护训练集音色的效果<br>
如果训练集优质时长多可调高total_epoch此时模型本身不太会引用推理源和底模的音色很少存在"音色泄露"问题此时index_rate不重要你甚至可以不建立/分享index索引文件。<br>
## Q11:推理怎么选gpu
config.py文件里device cuda:后面选择卡号;<br>
卡号和显卡的映射关系,在训练选项卡的显卡信息栏里能看到。<br>
## Q12:如何推理训练中间保存的pth
通过ckpt选项卡最下面提取小模型。<br>
## Q13:如何中断和继续训练
现阶段只能关闭WebUI控制台双击go-web.bat重启程序。网页参数也要刷新重新填写<br>
继续训练相同网页参数点训练模型就会接着上次的checkpoint继续训练。<br>
## Q14:训练时出现文件页面/内存error
进程开太多了,内存炸了。你可能可以通过如下方式解决<br>
1、"提取音高和处理数据使用的CPU进程数" 酌情拉低;<br>
2、训练集音频手工切一下不要太长。<br>

95
docs/faq_en.md Normal file
View File

@@ -0,0 +1,95 @@
## Q1:ffmpeg error/utf8 error.
It is most likely not a FFmpeg issue, but rather an audio path issue;
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>
## Q2:Cannot find index file after "One-click Training".
If it displays "Training is done. The program is closed," then the model has been trained successfully, and the subsequent errors are fake;
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>
## Q3:Cannot find the model in “Inferencing timbre” after training
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>
## Q4:How to share a model/How to use others' models?
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;
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;
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>
## Q5:Connection Error.
You may have closed the console (black command line window).<br>
## Q6:WebUI popup 'Expecting value: line 1 column 1 (char 0)'.
Please disable system LAN proxy/global proxy and then refresh.<br>
## Q7:How to train and infer without the WebUI?
Training script:<br>
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>
Inference script:<br>
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py<br>
e.g.<br>
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>
f0up_key=sys.argv[1]<br>
input_path=sys.argv[2]<br>
index_path=sys.argv[3]<br>
f0method=sys.argv[4]#harvest or pm<br>
opt_path=sys.argv[5]<br>
model_path=sys.argv[6]<br>
index_rate=float(sys.argv[7])<br>
device=sys.argv[8]<br>
is_half=bool(sys.argv[9])<br>
## Q8:Cuda error/Cuda out of memory.
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>
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>
## Q9:How many total_epoch are optimal?
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>
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>
## Q10:How much training set duration is needed?
A dataset of around 10min to 50min is recommended.<br>
With guaranteed high sound quality and low bottom noise, more can be added if the dataset's timbre is uniform.<br>
For a high-level training set (lean + distinctive tone), 5min to 10min is fine.<br>
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;
Data of less than 1min duration has not been successfully attempted so far. This is not recommended.<br>
## Q11:What is the index rate for and how to adjust it?
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>
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>
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>
## Q12:How to choose the gpu when inferring?
In the config.py file, select the card number after "device cuda:".<br>
The mapping between card number and graphics card can be seen in the graphics card information section of the training tab.<br>
## Q13:How to use the model saved in the middle of training?
Save via model extraction at the bottom of the ckpt processing tab.
## Q14:File/memory error(when training)?
Too many processes and your memory is not enough. You may fix it by:
1、decrease "Number of CPU threads".
2、pre-cut trainset to shorter audio files.

View File

@@ -6,8 +6,12 @@ This TIPS explains how data training is done.
I will explain along the steps in the training tab of the GUI.
## step1
Set the experiment name here. You can also set here whether the model should take pitch into account.
Data for each experiment is placed in `/logs/experiment name/`.
Set the experiment name here.
You can also set here whether the model should take pitch into account.
If the model doesn't consider pitch, the model will be lighter, but not suitable for singing.
Data for each experiment is placed in `/logs/your-experiment-name/`.
## step2a
Loads and preprocesses audio.
@@ -23,14 +27,14 @@ After converting to int16 with ffmpeg, convert to float32 and normalize between
The audio is smoothed by scipy's filtfilt.
### Audio Split
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/experiment name/0_gt_wavs` and then convert it to 16k sampling rate to `/logs/experiment name/1_16k_wavs ` as a wav file.
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.
## step2b
### Extract pitch
Extract pitch information from wav files. Extract the pitch information (=f0) using the method built into parselmouth or pyworld and save it in `/logs/experiment name/2a_f0`. Then logarithmically convert the pitch information to an integer between 1 and 255 and save it in `/logs/experiment name/2b-f0nsf`.
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`.
### Extract feature_print
Convert the wav file to embedding in advance using HuBERT. Read the wav file saved in `/logs/experiment name/1_16k_wavs`, convert the wav file to 256-dimensional features with HuBERT, and save in npy format in `/logs/experiment name/3_feature256`.
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`.
## step3
train the model.
@@ -40,11 +44,20 @@ In deep learning, the data set is divided and the learning proceeds little by li
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.
### Specify pretrained model
RVC starts training the model from pretrained weights instead of from 0, so it can be trained with a small dataset. By default it loads `rvc-location/pretrained/f0G40k.pth` and `rvc-location/pretrained/f0D40k.pth`. When learning, model parameters are saved in `logs/experiment name/G_{}.pth` and `logs/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.
RVC starts training the model from pretrained weights instead of from 0, so it can be trained with a small dataset.
By default
- If you consider pitch, it loads `rvc-location/pretrained/f0G40k.pth` and `rvc-location/pretrained/f0D40k.pth`.
- If you don't consider pitch, it loads `rvc-location/pretrained/f0G40k.pth` and `rvc-location/pretrained/f0D40k.pth`.
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.
### learning index
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.
For index learning, we use the approximate neighborhood search library faiss. Read the feature value of `/logs/experiment name/3_feature256`, save the combined feature value as `/logs/experiment name/total_fea.npy`, and use it to learn the index `/logs/experiment name Save it as /add_XXX.index`.
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`.
(From the 20230428update version, it is read from the index, and saving / specifying is no longer necessary.)
### Button description
- Train model: After executing step2b, press this button to train the model.

View File

@@ -6,7 +6,10 @@ RVCの訓練における説明、およびTIPS
GUIの訓練タブのstepに沿って説明します。
## step1
実験名の設定を行います。また、モデルにピッチを考慮させるかもここで設定できます。
実験名の設定を行います。
また、モデルに音高ガイド(ピッチ)を考慮させるかもここで設定できます。考慮させない場合はモデルは軽量になりますが、歌唱には向かなくなります。
各実験のデータは`/logs/実験名/`に配置されます。
## step2a
@@ -40,11 +43,19 @@ HuBERTを用いてwavファイルを事前にembeddingに変換します。`/log
そのため、学習時間は 1step当たりの学習時間 x (データセット内のデータ数 ÷ バッチサイズ) x epoch数 かかります。一般にバッチサイズを大きくするほど学習は安定し、(1step当たりの学習時間÷バッチサイズ)は小さくなりますが、その分GPUのメモリを多く使用します。GPUのRAMはnvidia-smiコマンド等で確認できます。実行環境のマシンに合わせてバッチサイズをできるだけ大きくするとより短時間で学習が可能です。
### pretrained modelの指定
RVCではモデルの訓練を0からではなく、事前学習済みの重みから開始するため、少ないデータセットで学習を行えます。デフォルトでは`RVCのある場所/pretrained/f0G40k.pth``RVCのある場所/pretrained/f0D40k.pth`を読み込みます。学習時はsave_every_epochごとにモデルのパラメータが`logs/実験名/G_{}.pth``logs/実験名/D_{}.pth`に保存されますが、このパスを指定することで学習を再開したり、もしくは違う実験で学習したモデルの重みから学習を開始できます。
RVCではモデルの訓練を0からではなく、事前学習済みの重みから開始するため、少ないデータセットで学習を行えます。
デフォルトでは
- 音高ガイドを考慮する場合、`RVCのある場所/pretrained/f0G40k.pth``RVCのある場所/pretrained/f0D40k.pth`を読み込みます。
- 音高ガイドを考慮しない場合、`RVCのある場所/pretrained/G40k.pth``RVCのある場所/pretrained/D40k.pth`を読み込みます。
学習時はsave_every_epochごとにモデルのパラメータが`logs/実験名/G_{}.pth``logs/実験名/D_{}.pth`に保存されますが、このパスを指定することで学習を再開したり、もしくは違う実験で学習したモデルの重みから学習を開始できます。
### indexの学習
RVCでは学習時に使われたHuBERTの特徴量を保存し、推論時は学習時の特徴量から近い特徴量を探してきて推論を行います。この検索を高速に行うために事前にindexの学習を行います。
indexの学習には近似近傍探索ライブラリのfaissを用います。`/logs/実験名/3_feature256`の特徴量を読み込み、全て結合させた特徴量を`/logs/実験名/total_fea.npy`として保存、それを用いて学習したindexを`/logs/実験名/add_XXX.index`として保存します。
indexの学習には近似近傍探索ライブラリのfaissを用います。`/logs/実験名/3_feature256`の特徴量を読み込み、それを用いて学習したindexを`/logs/実験名/add_XXX.index`として保存します。
(20230428updateよりtotal_fea.npyはindexから読み込むので不要になりました。)
### ボタンの説明
- モデルのトレーニング: step2bまでを実行した後、このボタンを押すとモデルの学習を行います。

View File

@@ -18,6 +18,13 @@ from fairseq import checkpoint_utils
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"
f = open("%s/extract_f0_feature.log" % exp_dir, "a+")
@@ -60,7 +67,7 @@ models, saved_cfg, task = checkpoint_utils.load_model_ensemble_and_task(
model = models[0]
model = model.to(device)
printt("move model to %s" % device)
if device != "cpu":
if device not in ["mps", "cpu"]:
model = model.half()
model.eval()
@@ -83,7 +90,7 @@ else:
padding_mask = torch.BoolTensor(feats.shape).fill_(False)
inputs = {
"source": feats.half().to(device)
if device != "cpu"
if device not in ["mps", "cpu"]
else feats.to(device),
"padding_mask": padding_mask.to(device),
"output_layer": 9, # layer 9

36
gui.py
View File

@@ -1,4 +1,4 @@
import os, sys
import os, sys, traceback
now_dir = os.getcwd()
sys.path.append(now_dir)
@@ -38,7 +38,8 @@ class RVC:
self.window = 160
if index_rate != 0:
self.index = faiss.read_index(index_path)
self.big_npy = np.load(npy_path)
# self.big_npy = np.load(npy_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
print("index search enabled")
self.index_rate = index_rate
model_path = hubert_path
@@ -63,8 +64,8 @@ class RVC:
print(self.net_g.load_state_dict(cpt["weight"], strict=False))
self.net_g.eval().to(device)
self.net_g.half()
except Exception as e:
print(e)
except:
print(traceback.format_exc())
def get_f0(self, x, f0_up_key, inp_f0=None):
x_pad = 1
@@ -125,8 +126,17 @@ class RVC:
####索引优化
if hasattr(self, "index") and hasattr(self, "big_npy") and self.index_rate != 0:
npy = feats[0].cpu().numpy().astype("float32")
_, I = self.index.search(npy, 1)
npy = self.big_npy[I.squeeze()].astype("float16")
# _, I = self.index.search(npy, 1)
# npy = self.big_npy[I.squeeze()].astype("float16")
score, ix = self.index.search(npy, k=8)
weight = np.square(1 / score)
weight /= weight.sum(axis=1, keepdims=True)
npy = np.sum(
self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1
).astype("float16")
feats = (
torch.from_numpy(npy).unsqueeze(0).to(device) * self.index_rate
+ (1 - self.index_rate) * feats
@@ -203,9 +213,7 @@ class GUI:
title=i18n("加载模型"),
layout=[
[
sg.Input(
default_text="TEMP\\hubert_base.pt", key="hubert_path"
),
sg.Input(default_text="hubert_base.pt", key="hubert_path"),
sg.FileBrowse(i18n("Hubert模型")),
],
[
@@ -221,7 +229,7 @@ class GUI:
],
[
sg.Input(
default_text="TEMP\\big_src_feature_atri.npy",
default_text="你不需要填写这个You don't need write this.",
key="npy_path",
),
sg.FileBrowse(i18n("选择.npy文件")),
@@ -375,9 +383,7 @@ class GUI:
self.crossfade_frame = int(self.config.crossfade_time * self.config.samplerate)
self.sola_search_frame = int(0.012 * self.config.samplerate)
self.delay_frame = int(0.01 * self.config.samplerate) # 往前预留0.02s
self.extra_frame = int(
self.config.extra_time * self.config.samplerate
)
self.extra_frame = int(self.config.extra_time * self.config.samplerate)
self.rvc = None
self.rvc = RVC(
self.config.pitch,
@@ -408,7 +414,9 @@ class GUI:
orig_freq=self.config.samplerate, new_freq=16000, dtype=torch.float32
)
self.resampler2 = tat.Resample(
orig_freq=self.rvc.tgt_sr, new_freq=self.config.samplerate, dtype=torch.float32
orig_freq=self.rvc.tgt_sr,
new_freq=self.config.samplerate,
dtype=torch.float32,
)
thread_vc = threading.Thread(target=self.soundinput)
thread_vc.start()

View File

@@ -22,4 +22,4 @@ class I18nAuto:
self.language_map = load_language_list(language)
def __call__(self, key):
return self.language_map[key]
return self.language_map.get(key, key)

View File

@@ -1,23 +1,34 @@
{
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "This software is open source under the MIT license, the author does not have any control over the software, and those who use the software and spread the sounds exported by the software are solely responsible. <br>If you do not agree with this clause, you cannot use or quote any codes and files in the software package . See root directory <b>Agreement-LICENSE.txt</b> for details.",
"很遗憾您这没有能用的显卡来支持您训练": "Unfortunately, you don't have a GPU to help you train",
"是": "yes",
"step1:正在处理数据": "step 1: processing data",
"step2a:无需提取音高": "step 2a: skipped extracting pitch",
"step2b:正在提取特征": "step 2b: extracting features",
"step3a:正在训练模型": "step 3a: training the model",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Training completed, you can view the training logs in the console or the train.log within the experiement folder",
"全流程结束!": "all processes have been completed!",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "This software is open source under the MIT license, the author does not have any control over the software, and those who use the software and spread the sounds exported by the software are solely responsible. <br>If you do not agree with this clause, you cannot use or quote any codes and files in the software package. See root directory <b>Agreement-LICENSE.txt</b> for details.",
"模型推理": "Model inference",
"推理音色": "Inferencing timbre",
"刷新音色列表": "Refresh timbre list",
"刷新音色列表和索引路径": "Refresh timbre list and index path",
"卸载音色省显存": "Unload timbre to save GPU memory",
"请选择说话人id": "Please select a speaker id",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "It is recommended +12key for male to female conversion, and -12key for female to male conversion. If the sound range explodes and the timbre is distorted, you can also adjust it to the appropriate range by yourself. ",
"变调(整数, 半音数量, 升八度12降八度-12)": "transpose(integer, number of semitones, octave sharp 12 octave flat -12)",
"输入待处理音频文件路径(默认是正确格式示例)": "Enter the path of the audio file to be processed (the default is the correct format example)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "Select the algorithm for pitch extraction. Use 'pm' to speed up for singing voices, or use 'harvest' for better low-pitched voices, but it is extremely slow.",
"特征检索库文件路径": "Feature search database file path",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3:using median filter for f0. The number is median filter radius.",
"特征检索库文件路径,为空则使用下拉的选择结果": "Feature file path. If null, use dropdown result.",
"自动检测index路径,下拉式选择(dropdown)": "Auto detect index path in logs directory. Dropdown.",
"特征文件路径": "Feature file path",
"检索特征占比": "Search feature ratio",
"后处理重采样至最终采样率0为不进行重采样": "Post resample the audio to the final sample rate. Default: don't use post resample.",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0 curve file, optional, one pitch per line, instead of the default F0 and ups and downs",
"转换": "Conversion",
"输出信息": "Output information",
"输出音频(右下角三个点,点了可以下载)": "Output audio (three dots in the lower right corner, click to download)",
"转换": "Convert",
"输出信息": "Export message",
"输出音频(右下角三个点,点了可以下载)": "Export audio (three dots in the lower right corner, click to download)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "For batch conversion, input the audio folder to be converted, or upload multiple audio files, and output the converted audio in the specified folder (opt by default). ",
"指定输出文件夹": "Specify output folder",
"检索特征占比": "Search feature ratio",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Enter the path of the audio folder to be processed (just go to the address bar of the file manager and copy it)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "You can also input audio files in batches, choose one of the two, and read the folder first",
"伴奏人声分离": "Accompaniment and vocal separation",
@@ -31,6 +42,7 @@
"输入实验名": "Input experiment name",
"目标采样率": "Target sample rate",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "Does the model have pitch guidance (singing must, voice can not.)",
"提取音高和处理数据使用的CPU进程数": "Number of CPU threads to use for pitch extraction and dataset processing",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a: Automatically traverse all files that can be decoded into audio in the training folder and perform slice normalization, and generate 2 wav folders in the experiment directory; only single-person training is supported for the time being. ",
"输入训练文件夹路径": "Input training folder path",
"请指定说话人id": "Please specify speaker ID",
@@ -38,13 +50,14 @@
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "step2b: Use CPU to extract pitch (if the model has pitch), use GPU to extract features (select card number)",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Enter the card numbers used separated by -, for example 0-1-2 use card 0 and card 1 and card 2",
"显卡信息": "GPU information",
"提取音高使用的CPU进程数": "Number of CPU threads to use for pitch extraction",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "Select pitch extraction algorithm: Use 'pm' for faster processing of singing voice, 'dio' for high-quality speech but slower processing, and 'harvest' for the best quality but slowest processing.",
"特征提取": "Feature extraction",
"step3: 填写训练设置, 开始训练模型和索引": "step3: Fill in the training settings, start training the model and index",
"保存频率save_every_epoch": "Save frequency (save_every_epoch)",
"总训练轮数total_epoch": "Total training epochs (total_epoch)",
"每张显卡的batch_size": "batch_size for every GPU",
"是否仅保存最新的ckpt文件以节省硬盘空间": "Whether to save only the latest ckpt file to save disk space",
"否": "no",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "Whether to cache all training sets to video memory. Small data under 10 minutes can be cached to speed up training, and large data cache will blow up video memory and not increase the speed much",
"加载预训练底模G路径": "Load pre-trained base model G path.",
"加载预训练底模D路径": "Load pre-trained base model D path.",
@@ -71,11 +84,12 @@
"保存名": "Save Name",
"模型是否带音高指导,1是0否": "Whether the model has pitch guidance, 1 for yes, 0 for no",
"提取": "Extract",
"Onnx导出": "Onnx",
"RVC模型路径": "RVC Path",
"Onnx导出": "Export Onnx",
"RVC模型路径": "RVC Model Path",
"Onnx输出路径": "Onnx Export Path",
"MoeVS模型": "MoeSS?",
"MoeVS模型": "MoeVS Model",
"导出Onnx模型": "Export Onnx Model",
"常见问题解答": "FAQ (Frequently Asked Questions)",
"招募音高曲线前端编辑器": "Recruit front-end editors for pitch curves",
"加开发群联系我xxxxx": "Add development group to contact me xxxxx",
"点击查看交流、问题反馈群号": "Click to view the communication and problem feedback group number",
@@ -95,8 +109,8 @@
"采样长度": "Sample length",
"淡入淡出长度": "fade length",
"额外推理时长": "extra inference time",
"输入降噪": "Input Noisereduce",
"输出降噪": "Output Noisereduce",
"输入降噪": "Input Noise Reduction",
"输出降噪": "Output Noise Reduction",
"性能设置": "performance settings",
"开始音频转换": "start audio conversion",
"停止音频转换": "stop audio conversion",

View File

@@ -1,23 +1,34 @@
{
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
"是": "是",
"step1:正在处理数据": "step1:正在处理数据",
"step2a:无需提取音高": "step2a:无需提取音高",
"step2b:正在提取特征": "step2b:正在提取特征",
"step3a:正在训练模型": "step3a:正在训练模型",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"全流程结束!": "全流程结束!",
"本软件以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.",
"模型推理": "inferencia del modelo",
"推理音色": "inferencia de voz",
"刷新音色列表": "Actualizar lista de voces",
"刷新音色列表和索引路径": "刷新音色列表和索引路径",
"卸载音色省显存": "Descargue la voz para ahorrar memoria GPU",
"请选择说话人id": "seleccione una identificación de altavoz",
"男转女推荐+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.",
"变调(整数, 半音数量, 升八度12降八度-12)": "Cambio de tono (entero, número de semitonos, subir una octava +12 o bajar una octava -12)",
"输入待处理音频文件路径(默认是正确格式示例)": "Ingrese la ruta del archivo del audio que se procesará (el formato predeterminado es el ejemplo correcto)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "Seleccione el algoritmo para la extracción de tono. Use 'pm' para acelerar las voces cantadas, o use 'harvest' para mejorar las voces bajas, pero es extremadamente lento.",
"特征检索库文件路径": "Ruta del archivo de la base de datos de búsqueda de características",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音",
"特征检索库文件路径,为空则使用下拉的选择结果": "特征检索库文件路径,为空则使用下拉的选择结果",
"自动检测index路径,下拉式选择(dropdown)": "自动检测index路径,下拉式选择(dropdown)",
"特征文件路径": "Ruta del archivo de características",
"检索特征占比": "Proporción de función de búsqueda",
"后处理重采样至最终采样率0为不进行重采样": "后处理重采样至最终采样率0为不进行重采样",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Archivo de curva F0, opcional, un tono por línea, en lugar de F0 predeterminado y cambio de tono",
"转换": "Conversión",
"输出信息": "Información de salida",
"输出音频(右下角三个点,点了可以下载)": "Salida de audio (haga clic en los tres puntos en la esquina inferior derecha para descargar)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认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).",
"指定输出文件夹": "Especificar carpeta de salida",
"检索特征占比": "Proporción de función de búsqueda",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Ingrese la ruta a la carpeta de audio que se procesará (simplemente cópiela desde la barra de direcciones del administrador de archivos)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "También se pueden ingresar múltiples archivos de audio, cualquiera de las dos opciones, con prioridad dada a la carpeta",
"伴奏人声分离": "Instrumental and vocal separation",
@@ -31,6 +42,7 @@
"输入实验名": "Ingrese el nombre del modelo",
"目标采样率": "Tasa de muestreo objetivo",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "Si el modelo tiene guía de tono (necesaria para cantar, pero no para hablar)",
"提取音高和处理数据使用的CPU进程数": "提取音高和处理数据使用的CPU进程数",
"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.",
"输入训练文件夹路径": "Introduzca la ruta de la carpeta de entrenamiento",
"请指定说话人id": "Especifique el ID del hablante",
@@ -38,13 +50,14 @@
"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).",
"以-分隔输入使用的卡号, 例如 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.",
"显卡信息": "información de la GPU",
"提取音高使用的CPU进程数": "Número de subprocesos de CPU que se utilizarán para la extracción de tono",
"选择音高提取算法:输入歌声可用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.",
"特征提取": "Extracción de características",
"step3: 填写训练设置, 开始训练模型和索引": "Paso 3: complete la configuración de entrenamiento y comience a entrenar el modelo y el índice.",
"保存频率save_every_epoch": "Frecuencia de guardado (save_every_epoch)",
"总训练轮数total_epoch": "Total de épocas de entrenamiento (total_epoch)",
"每张显卡的batch_size": "每张显卡的batch_size",
"是否仅保存最新的ckpt文件以节省硬盘空间": "Si guardar solo el archivo ckpt más reciente para ahorrar espacio en disco",
"否": "否",
"是否缓存所有训练集至显存. 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.",
"加载预训练底模G路径": "Cargue la ruta G del modelo base preentrenada.",
"加载预训练底模D路径": "Cargue la ruta del modelo D base preentrenada.",
@@ -76,6 +89,7 @@
"Onnx输出路径": "Onnx输出路径",
"MoeVS模型": "MoeVS模型",
"导出Onnx模型": "导出Onnx模型",
"常见问题解答": "常见问题解答",
"招募音高曲线前端编辑器": "Reclutar editores front-end para curvas de tono",
"加开发群联系我xxxxx": "Únase al grupo de desarrollo para contactarme en xxxxx",
"点击查看交流、问题反馈群号": "Haga clic para ver el número de grupo de comunicación y comentarios sobre problemas",

View File

@@ -1,23 +1,34 @@
{
"很遗憾您这没有能用的显卡来支持您训练": "トレーニングに対応したGPUが動作しないのは残念です。",
"是": "Yes",
"step1:正在处理数据": "step1:処理中のデータ",
"step2a:无需提取音高": "step2a:ピッチの抽出は不要",
"step2b:正在提取特征": "step2b:抽出される特徴量",
"step3a:正在训练模型": "step3a:トレーニング中のモデル",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "トレーニング終了時に、トレーニングログやフォルダ内のtrain.logを確認することができます",
"全流程结束!": "全流程结束!",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.",
"模型推理": "モデル推論",
"推理音色": "音源推論",
"刷新音色列表": "音源リストを更新",
"刷新音色列表和索引路径": "刷新音色列表和索引路径",
"卸载音色省显存": "音源を削除してメモリを節約",
"请选择说话人id": "話者IDを選択してください",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性から女性へは+12キーをお勧めします。女性から男性へは-12キーをお勧めします。音域が広すぎて音質が劣化した場合は、適切な音域に自分で調整することもできます。",
"变调(整数, 半音数量, 升八度12降八度-12)": "ピッチ変更(整数、半音数、上下オクターブ12-12)",
"输入待处理音频文件路径(默认是正确格式示例)": "処理対象音声ファイルのパスを入力してください(デフォルトは正しいフォーマットの例です)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "ピッチ抽出アルゴリズムを選択してください。歌声の場合は、pmを使用して速度を上げることができます。低音が重要な場合は、harvestを使用できますが、非常に遅くなります。",
"特征检索库文件路径": "特徴量検索データベースのファイルパス",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音",
"特征检索库文件路径,为空则使用下拉的选择结果": "特征检索库文件路径,为空则使用下拉的选择结果",
"自动检测index路径,下拉式选择(dropdown)": "自动检测index路径,下拉式选择(dropdown)",
"特征文件路径": "特徴量ファイルのパス",
"检索特征占比": "検索特徴率",
"后处理重采样至最终采样率0为不进行重采样": "后处理重采样至最终采样率0为不进行重采样",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0(最低共振周波数)カーブファイル(オプション、1行に1ピッチ、デフォルトのF0(最低共振周波数)とエレベーションを置き換えます。)",
"转换": "変換",
"输出信息": "出力情報",
"输出音频(右下角三个点,点了可以下载)": "出力音声(右下の三点をクリックしてダウンロードできます)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "一括変換、変換する音声フォルダを入力、または複数の音声ファイルをアップロードし、指定したフォルダ(デフォルトのopt)に変換した音声を出力します。",
"指定输出文件夹": "出力フォルダを指定してください",
"检索特征占比": "検索特徴率",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "処理対象音声フォルダーのパスを入力してください(ファイルマネージャのアドレスバーからコピーしてください)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "複数の音声ファイルを一括で入力することもできますが、フォルダーを優先して読み込みます",
"伴奏人声分离": "伴奏とボーカルの分離",
@@ -31,6 +42,7 @@
"输入实验名": "実験名を入力してください",
"目标采样率": "目標サンプリングレート",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "モデルに音高ガイドがあるかどうか(歌唱には必要ですが、音声には必要ありません)",
"提取音高和处理数据使用的CPU进程数": "提取音高和处理数据使用的CPU进程数",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "ステップ2a: 訓練フォルダー内のすべての音声ファイルを自動的に探索し、スライスと正規化を行い、2つのwavフォルダーを実験ディレクトリに生成します。現在は一人でのトレーニングのみをサポートしています。",
"输入训练文件夹路径": "トレーニング用フォルダのパスを入力してください",
"请指定说话人id": "話者IDを指定してください",
@@ -38,13 +50,14 @@
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "ステップ2b: CPUを使用して音高を抽出する(モデルに音高がある場合)、GPUを使用して特徴を抽出する(カード番号を選択する)",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "ハイフンで区切って使用するカード番号を入力します。例えば0-1-2はカード0、カード1、カード2を使用します",
"显卡信息": "カード情報",
"提取音高使用的CPU进程数": "抽出に使用するCPUプロセス数",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "音高抽出アルゴリズムの選択:歌声を入力する場合は、pmを使用して速度を上げることができます。CPUが低い場合はdioを使用して速度を上げることができます。harvestは品質が高く、精度が高いですが、遅いです。",
"特征提取": "特徴抽出",
"step3: 填写训练设置, 开始训练模型和索引": "ステップ3: トレーニング設定を入力して、モデルとインデックスのトレーニングを開始します",
"保存频率save_every_epoch": "エポックごとの保存頻度",
"总训练轮数total_epoch": "総トレーニング回数",
"每张显卡的batch_size": "每张显卡的batch_size",
"是否仅保存最新的ckpt文件以节省硬盘空间": "ハードディスク容量を節約するため、最新のckptファイルのみを保存するかどうか",
"否": "否",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "すべてのトレーニングデータをメモリにキャッシュするかどうか。10分以下の小さなデータはキャッシュしてトレーニングを高速化できますが、大きなデータをキャッシュするとメモリが破裂し、あまり速度が上がりません。",
"加载预训练底模G路径": "事前学習済みのGモデルのパスをロードしてください",
"加载预训练底模D路径": "事前学習済みのDモデルのパスをロードしてください",
@@ -76,6 +89,7 @@
"Onnx输出路径": "Onnx出力パス",
"MoeVS模型": "MoeSS",
"导出Onnx模型": "Onnxに変換",
"常见问题解答": "常见问题解答",
"招募音高曲线前端编辑器": "音高曲線フロントエンドエディターを募集",
"加开发群联系我xxxxx": "開発グループに参加して私に連絡してくださいxxxxx",
"点击查看交流、问题反馈群号": "クリックして交流、問題フィードバックグループ番号を表示",

View File

@@ -1,23 +1,34 @@
{
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
"是": "是",
"step1:正在处理数据": "step1:正在处理数据",
"step2a:无需提取音高": "step2a:无需提取音高",
"step2b:正在提取特征": "step2b:正在提取特征",
"step3a:正在训练模型": "step3a:正在训练模型",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"全流程结束!": "全流程结束!",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.",
"模型推理": "模型推理",
"推理音色": "推理音色",
"刷新音色列表": "刷新音色列表",
"刷新音色列表和索引路径": "刷新音色列表和索引路径",
"卸载音色省显存": "卸载音色省显存",
"请选择说话人id": "请选择说话人id",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ",
"变调(整数, 半音数量, 升八度12降八度-12)": "变调(整数, 半音数量, 升八度12降八度-12)",
"输入待处理音频文件路径(默认是正确格式示例)": "输入待处理音频文件路径(默认是正确格式示例)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比",
"特征检索库文件路径": "特征检索库文件路径",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音",
"特征检索库文件路径,为空则使用下拉的选择结果": "特征检索库文件路径,为空则使用下拉的选择结果",
"自动检测index路径,下拉式选择(dropdown)": "自动检测index路径,下拉式选择(dropdown)",
"特征文件路径": "特征文件路径",
"检索特征占比": "检索特征占比",
"后处理重采样至最终采样率0为不进行重采样": "后处理重采样至最终采样率0为不进行重采样",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调",
"转换": "转换",
"输出信息": "输出信息",
"输出音频(右下角三个点,点了可以下载)": "输出音频(右下角三个点,点了可以下载)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ",
"指定输出文件夹": "指定输出文件夹",
"检索特征占比": "检索特征占比",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量输入音频文件, 二选一, 优先读文件夹",
"伴奏人声分离": "伴奏人声分离",
@@ -31,6 +42,7 @@
"输入实验名": "输入实验名",
"目标采样率": "目标采样率",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "模型是否带音高指导(唱歌一定要, 语音可以不要)",
"提取音高和处理数据使用的CPU进程数": "提取音高和处理数据使用的CPU进程数",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ",
"输入训练文件夹路径": "输入训练文件夹路径",
"请指定说话人id": "请指定说话人id",
@@ -38,13 +50,14 @@
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2",
"显卡信息": "显卡信息",
"提取音高使用的CPU进程数": "提取音高使用的CPU进程数",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢",
"特征提取": "特征提取",
"step3: 填写训练设置, 开始训练模型和索引": "step3: 填写训练设置, 开始训练模型和索引",
"保存频率save_every_epoch": "保存频率save_every_epoch",
"总训练轮数total_epoch": "总训练轮数total_epoch",
"每张显卡的batch_size": "每张显卡的batch_size",
"是否仅保存最新的ckpt文件以节省硬盘空间": "是否仅保存最新的ckpt文件以节省硬盘空间",
"否": "否",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速",
"加载预训练底模G路径": "加载预训练底模G路径",
"加载预训练底模D路径": "加载预训练底模D路径",
@@ -76,6 +89,7 @@
"Onnx输出路径": "Onnx输出路径",
"MoeVS模型": "MoeVS模型",
"导出Onnx模型": "导出Onnx模型",
"常见问题解答": "常见问题解答",
"招募音高曲线前端编辑器": "招募音高曲线前端编辑器",
"加开发群联系我xxxxx": "加开发群联系我xxxxx",
"点击查看交流、问题反馈群号": "点击查看交流、问题反馈群号",

View File

@@ -1,23 +1,34 @@
{
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
"是": "是",
"step1:正在处理数据": "step1:正在处理数据",
"step2a:无需提取音高": "step2a:无需提取音高",
"step2b:正在提取特征": "step2b:正在提取特征",
"step3a:正在训练模型": "step3a:正在训练模型",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"全流程结束!": "全流程结束!",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本軟體以MIT協議開源作者不對軟體具備任何控制力使用軟體者、傳播軟體導出的聲音者自負全責。<br>如不認可該條款,則不能使用或引用軟體包內任何程式碼和檔案。詳見根目錄<b>使用需遵守的協議-LICENSE.txt</b>。",
"模型推理": "模型推理",
"推理音色": "推理音色",
"刷新音色列表": "重新整理音色列表",
"刷新音色列表和索引路径": "刷新音色列表和索引路徑",
"卸载音色省显存": "卸載音色節省 VRAM",
"请选择说话人id": "請選擇說話人ID",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key女性轉男性推薦-12key如果音域爆炸導致音色失真也可以自己調整到合適音域。",
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
"输入待处理音频文件路径(默认是正确格式示例)": "輸入待處理音頻檔案路徑(預設是正確格式示例)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "選擇音高提取演算法,輸入歌聲可用 pm 提速harvest 低音好但巨慢無比",
"特征检索库文件路径": "特徵檢索庫檔案路徑",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3則使用對harvest音高識別的結果使用中值濾波數值為濾波半徑使用可以削弱啞音",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
"自动检测index路径,下拉式选择(dropdown)": "自動檢測index路徑,下拉式選擇(dropdown)",
"特征文件路径": "特徵檔案路徑",
"检索特征占比": "檢索特徵佔比",
"后处理重采样至最终采样率0为不进行重采样": "後處理重採樣至最終採樣率0為不進行重採樣",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案可選一行一個音高代替預設的F0及升降調",
"转换": "轉換",
"输出信息": "輸出訊息",
"输出音频(右下角三个点,点了可以下载)": "輸出音頻(右下角三個點,點了可以下載)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "批量轉換,輸入待轉換音頻資料夾,或上傳多個音頻檔案,在指定資料夾(默認opt)下輸出轉換的音頻。",
"指定输出文件夹": "指定輸出資料夾",
"检索特征占比": "檢索特徵佔比",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "輸入待處理音頻資料夾路徑(去檔案管理器地址欄拷貝即可)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量輸入音頻檔案,二選一,優先讀資料夾",
"伴奏人声分离": "伴奏人聲分離",
@@ -31,6 +42,7 @@
"输入实验名": "輸入實驗名稱",
"目标采样率": "目標取樣率",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "模型是否帶音高指導(唱歌一定要,語音可以不要)",
"提取音高和处理数据使用的CPU进程数": "提取音高和處理數據使用的CPU進程數",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a自動遍歷訓練資料夾下所有可解碼成音頻的檔案並進行切片歸一化在實驗目錄下生成2個wav資料夾暫時只支援單人訓練。",
"输入训练文件夹路径": "輸入訓練檔案夾路徑",
"请指定说话人id": "請指定說話人id",
@@ -38,13 +50,14 @@
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "步驟2b: 使用CPU提取音高(如果模型帶音高), 使用GPU提取特徵(選擇卡號)",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
"显卡信息": "顯示卡資訊",
"提取音高使用的CPU进程数": "提取音高使用的CPU進程數",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "選擇音高提取算法:輸入歌聲可用pm提速,高品質語音但CPU差可用dio提速,harvest品質更好但較慢",
"特征提取": "特徵提取",
"step3: 填写训练设置, 开始训练模型和索引": "步驟3: 填寫訓練設定, 開始訓練模型和索引",
"保存频率save_every_epoch": "保存頻率save_every_epoch",
"总训练轮数total_epoch": "總訓練輪數total_epoch",
"每张显卡的batch_size": "每张显卡的batch_size",
"是否仅保存最新的ckpt文件以节省硬盘空间": "是否僅保存最新的ckpt檔案以節省硬碟空間",
"否": "否",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "是否緩存所有訓練集至 VRAM。小於10分鐘的小數據可緩存以加速訓練大數據緩存會爆 VRAM 也加不了多少速度",
"加载预训练底模G路径": "加載預訓練底模G路徑",
"加载预训练底模D路径": "加載預訓練底模D路徑",
@@ -76,6 +89,7 @@
"Onnx输出路径": "Onnx输出路径",
"MoeVS模型": "MoeSS模型",
"导出Onnx模型": "导出Onnx模型",
"常见问题解答": "常見問題解答",
"招募音高曲线前端编辑器": "招募音高曲線前端編輯器",
"加开发群联系我xxxxx": "加開發群聯繫我xxxxx",
"点击查看交流、问题反馈群号": "點擊查看交流、問題反饋群號",

View File

@@ -1,23 +1,34 @@
{
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
"是": "是",
"step1:正在处理数据": "step1:正在处理数据",
"step2a:无需提取音高": "step2a:无需提取音高",
"step2b:正在提取特征": "step2b:正在提取特征",
"step3a:正在训练模型": "step3a:正在训练模型",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"全流程结束!": "全流程结束!",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本軟體以MIT協議開源作者不對軟體具備任何控制力使用軟體者、傳播軟體導出的聲音者自負全責。<br>如不認可該條款,則不能使用或引用軟體包內任何程式碼和檔案。詳見根目錄<b>使用需遵守的協議-LICENSE.txt</b>。",
"模型推理": "模型推理",
"推理音色": "推理音色",
"刷新音色列表": "重新整理音色列表",
"刷新音色列表和索引路径": "刷新音色列表和索引路徑",
"卸载音色省显存": "卸載音色節省 VRAM",
"请选择说话人id": "請選擇說話人ID",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key女性轉男性推薦-12key如果音域爆炸導致音色失真也可以自己調整到合適音域。",
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
"输入待处理音频文件路径(默认是正确格式示例)": "輸入待處理音頻檔案路徑(預設是正確格式示例)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "選擇音高提取演算法,輸入歌聲可用 pm 提速harvest 低音好但巨慢無比",
"特征检索库文件路径": "特徵檢索庫檔案路徑",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3則使用對harvest音高識別的結果使用中值濾波數值為濾波半徑使用可以削弱啞音",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
"自动检测index路径,下拉式选择(dropdown)": "自動檢測index路徑,下拉式選擇(dropdown)",
"特征文件路径": "特徵檔案路徑",
"检索特征占比": "檢索特徵佔比",
"后处理重采样至最终采样率0为不进行重采样": "後處理重採樣至最終採樣率0為不進行重採樣",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案可選一行一個音高代替預設的F0及升降調",
"转换": "轉換",
"输出信息": "輸出訊息",
"输出音频(右下角三个点,点了可以下载)": "輸出音頻(右下角三個點,點了可以下載)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "批量轉換,輸入待轉換音頻資料夾,或上傳多個音頻檔案,在指定資料夾(默認opt)下輸出轉換的音頻。",
"指定输出文件夹": "指定輸出資料夾",
"检索特征占比": "檢索特徵佔比",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "輸入待處理音頻資料夾路徑(去檔案管理器地址欄拷貝即可)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量輸入音頻檔案,二選一,優先讀資料夾",
"伴奏人声分离": "伴奏人聲分離",
@@ -31,6 +42,7 @@
"输入实验名": "輸入實驗名稱",
"目标采样率": "目標取樣率",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "模型是否帶音高指導(唱歌一定要,語音可以不要)",
"提取音高和处理数据使用的CPU进程数": "提取音高和處理數據使用的CPU進程數",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a自動遍歷訓練資料夾下所有可解碼成音頻的檔案並進行切片歸一化在實驗目錄下生成2個wav資料夾暫時只支援單人訓練。",
"输入训练文件夹路径": "輸入訓練檔案夾路徑",
"请指定说话人id": "請指定說話人id",
@@ -38,13 +50,14 @@
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "步驟2b: 使用CPU提取音高(如果模型帶音高), 使用GPU提取特徵(選擇卡號)",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
"显卡信息": "顯示卡資訊",
"提取音高使用的CPU进程数": "提取音高使用的CPU進程數",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "選擇音高提取算法:輸入歌聲可用pm提速,高品質語音但CPU差可用dio提速,harvest品質更好但較慢",
"特征提取": "特徵提取",
"step3: 填写训练设置, 开始训练模型和索引": "步驟3: 填寫訓練設定, 開始訓練模型和索引",
"保存频率save_every_epoch": "保存頻率save_every_epoch",
"总训练轮数total_epoch": "總訓練輪數total_epoch",
"每张显卡的batch_size": "每张显卡的batch_size",
"是否仅保存最新的ckpt文件以节省硬盘空间": "是否僅保存最新的ckpt檔案以節省硬碟空間",
"否": "否",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "是否緩存所有訓練集至 VRAM。小於10分鐘的小數據可緩存以加速訓練大數據緩存會爆 VRAM 也加不了多少速度",
"加载预训练底模G路径": "加載預訓練底模G路徑",
"加载预训练底模D路径": "加載預訓練底模D路徑",
@@ -76,6 +89,7 @@
"Onnx输出路径": "Onnx输出路径",
"MoeVS模型": "MoeSS模型",
"导出Onnx模型": "导出Onnx模型",
"常见问题解答": "常見問題解答",
"招募音高曲线前端编辑器": "招募音高曲線前端編輯器",
"加开发群联系我xxxxx": "加開發群聯繫我xxxxx",
"点击查看交流、问题反馈群号": "點擊查看交流、問題反饋群號",

View File

@@ -1,23 +1,34 @@
{
"很遗憾您这没有能用的显卡来支持您训练": "很遗憾您这没有能用的显卡来支持您训练",
"是": "是",
"step1:正在处理数据": "step1:正在处理数据",
"step2a:无需提取音高": "step2a:无需提取音高",
"step2b:正在提取特征": "step2b:正在提取特征",
"step3a:正在训练模型": "step3a:正在训练模型",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"全流程结束!": "全流程结束!",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>使用需遵守的协议-LICENSE.txt</b>.": "本軟體以MIT協議開源作者不對軟體具備任何控制力使用軟體者、傳播軟體導出的聲音者自負全責。<br>如不認可該條款,則不能使用或引用軟體包內任何程式碼和檔案。詳見根目錄<b>使用需遵守的協議-LICENSE.txt</b>。",
"模型推理": "模型推理",
"推理音色": "推理音色",
"刷新音色列表": "重新整理音色列表",
"刷新音色列表和索引路径": "刷新音色列表和索引路徑",
"卸载音色省显存": "卸載音色節省 VRAM",
"请选择说话人id": "請選擇說話人ID",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key女性轉男性推薦-12key如果音域爆炸導致音色失真也可以自己調整到合適音域。",
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
"输入待处理音频文件路径(默认是正确格式示例)": "輸入待處理音頻檔案路徑(預設是正確格式示例)",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比": "選擇音高提取演算法,輸入歌聲可用 pm 提速harvest 低音好但巨慢無比",
"特征检索库文件路径": "特徵檢索庫檔案路徑",
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3則使用對harvest音高識別的結果使用中值濾波數值為濾波半徑使用可以削弱啞音",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
"自动检测index路径,下拉式选择(dropdown)": "自動檢測index路徑,下拉式選擇(dropdown)",
"特征文件路径": "特徵檔案路徑",
"检索特征占比": "檢索特徵佔比",
"后处理重采样至最终采样率0为不进行重采样": "後處理重採樣至最終採樣率0為不進行重採樣",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案可選一行一個音高代替預設的F0及升降調",
"转换": "轉換",
"输出信息": "輸出訊息",
"输出音频(右下角三个点,点了可以下载)": "輸出音頻(右下角三個點,點了可以下載)",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "批量轉換,輸入待轉換音頻資料夾,或上傳多個音頻檔案,在指定資料夾(默認opt)下輸出轉換的音頻。",
"指定输出文件夹": "指定輸出資料夾",
"检索特征占比": "檢索特徵佔比",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "輸入待處理音頻資料夾路徑(去檔案管理器地址欄拷貝即可)",
"也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量輸入音頻檔案,二選一,優先讀資料夾",
"伴奏人声分离": "伴奏人聲分離",
@@ -31,6 +42,7 @@
"输入实验名": "輸入實驗名稱",
"目标采样率": "目標取樣率",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "模型是否帶音高指導(唱歌一定要,語音可以不要)",
"提取音高和处理数据使用的CPU进程数": "提取音高和處理數據使用的CPU進程數",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a自動遍歷訓練資料夾下所有可解碼成音頻的檔案並進行切片歸一化在實驗目錄下生成2個wav資料夾暫時只支援單人訓練。",
"输入训练文件夹路径": "輸入訓練檔案夾路徑",
"请指定说话人id": "請指定說話人id",
@@ -38,13 +50,14 @@
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "步驟2b: 使用CPU提取音高(如果模型帶音高), 使用GPU提取特徵(選擇卡號)",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
"显卡信息": "顯示卡資訊",
"提取音高使用的CPU进程数": "提取音高使用的CPU進程數",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢": "選擇音高提取算法:輸入歌聲可用pm提速,高品質語音但CPU差可用dio提速,harvest品質更好但較慢",
"特征提取": "特徵提取",
"step3: 填写训练设置, 开始训练模型和索引": "步驟3: 填寫訓練設定, 開始訓練模型和索引",
"保存频率save_every_epoch": "保存頻率save_every_epoch",
"总训练轮数total_epoch": "總訓練輪數total_epoch",
"每张显卡的batch_size": "每张显卡的batch_size",
"是否仅保存最新的ckpt文件以节省硬盘空间": "是否僅保存最新的ckpt檔案以節省硬碟空間",
"否": "否",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "是否緩存所有訓練集至 VRAM。小於10分鐘的小數據可緩存以加速訓練大數據緩存會爆 VRAM 也加不了多少速度",
"加载预训练底模G路径": "加載預訓練底模G路徑",
"加载预训练底模D路径": "加載預訓練底模D路徑",
@@ -76,6 +89,7 @@
"Onnx输出路径": "Onnx输出路径",
"MoeVS模型": "MoeSS模型",
"导出Onnx模型": "导出Onnx模型",
"常见问题解答": "常見問題解答",
"招募音高曲线前端编辑器": "招募音高曲線前端編輯器",
"加开发群联系我xxxxx": "加開發群聯繫我xxxxx",
"点击查看交流、问题反馈群号": "點擊查看交流、問題反饋群號",

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@ from scipy.io import wavfile
class _audio_pre_:
def __init__(self, agg,model_path, device, is_half):
def __init__(self, agg, model_path, device, is_half):
self.model_path = model_path
self.device = device
self.data = {
@@ -139,7 +139,9 @@ class _audio_pre_:
wav_instrument = spec_utils.cmb_spectrogram_to_wave(y_spec_m, self.mp)
print("%s instruments done" % name)
wavfile.write(
os.path.join(ins_root, "instrument_{}_{}.wav".format(name,self.data["agg"])),
os.path.join(
ins_root, "instrument_{}_{}.wav".format(name, self.data["agg"])
),
self.mp.param["sr"],
(np.array(wav_instrument) * 32768).astype("int16"),
) #
@@ -155,7 +157,9 @@ class _audio_pre_:
wav_vocals = spec_utils.cmb_spectrogram_to_wave(v_spec_m, self.mp)
print("%s vocals done" % name)
wavfile.write(
os.path.join(vocal_root, "vocal_{}_{}.wav".format(name,self.data["agg"])),
os.path.join(
vocal_root, "vocal_{}_{}.wav".format(name, self.data["agg"])
),
self.mp.param["sr"],
(np.array(wav_vocals) * 32768).astype("int16"),
)

View File

@@ -1,45 +1,40 @@
joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy==1.9.3
librosa==0.9.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.0; sys_platform == "darwin"
faiss-cpu==1.7.2; sys_platform != "darwin"
faiss-cpu==1.7.3
gradio
Cython
future>=0.18.3
pydub>=0.25.1
soundfile>=0.12.1
ffmpeg-python>=0.2.0
tensorboardX
functorch>=2.0.0
Jinja2>=3.1.2
json5>=0.9.11
json5
Markdown
matplotlib>=3.7.1
matplotlib-inline>=0.1.6
praat-parselmouth>=0.4.3
matplotlib>=3.7.0
matplotlib-inline>=0.1.3
praat-parselmouth>=0.4.2
Pillow>=9.1.1
pyworld>=0.3.2
resampy>=0.4.2
scikit-learn>=1.2.2
starlette>=0.26.1
scikit-learn
starlette>=0.25.0
tensorboard
tensorboard-data-server
tensorboard-plugin-wit
torchgen>=0.0.1
tqdm>=4.65.0
tornado>=6.2
tqdm>=4.63.1
tornado>=6.1
Werkzeug>=2.2.3
uc-micro-py>=1.0.1
sympy>=1.11.1
tabulate>=0.9.0
tabulate>=0.8.10
PyYAML>=6.0
pyasn1>=0.4.8
pyasn1-modules>=0.2.8
fsspec>=2023.3.0
absl-py>=1.4.0
fsspec>=2022.11.0
absl-py>=1.2.0
audioread
uvicorn>=0.21.1
colorama>=0.4.6
colorama>=0.4.5
pyworld>=0.3.2

View File

@@ -1,6 +1,7 @@
import sys, os
now_dir = os.getcwd()
sys.path.append(os.path.join(now_dir))
sys.path.append(os.path.join(now_dir, "train"))
import utils

View File

@@ -117,8 +117,8 @@ class PreProcess:
)
p.start()
ps.append(p)
for p in ps:
p.join()
for p in ps:
p.join()
except:
println("Fail. %s" % traceback.format_exc())

View File

@@ -1,28 +1,60 @@
import numpy as np, parselmouth, torch, pdb
from time import time as ttime
import torch.nn.functional as F
from config import x_pad, x_query, x_center, x_max
import scipy.signal as signal
import pyworld, os, traceback, faiss
import pyworld, os, traceback, faiss, librosa
from scipy import signal
from functools import lru_cache
bh, ah = signal.butter(N=5, Wn=48, btype="high", fs=16000)
input_audio_path2wav = {}
@lru_cache
def cache_harvest_f0(input_audio_path, fs, f0max, f0min, frame_period):
audio = input_audio_path2wav[input_audio_path]
f0, t = pyworld.harvest(
audio,
fs=fs,
f0_ceil=f0max,
f0_floor=f0min,
frame_period=frame_period,
)
f0 = pyworld.stonemask(audio, f0, t, fs)
return f0
class VC(object):
def __init__(self, tgt_sr, device, is_half):
def __init__(self, tgt_sr, config):
self.x_pad, self.x_query, self.x_center, self.x_max, self.is_half = (
config.x_pad,
config.x_query,
config.x_center,
config.x_max,
config.is_half,
)
self.sr = 16000 # hubert输入采样率
self.window = 160 # 每帧点数
self.t_pad = self.sr * x_pad # 每条前后pad时间
self.t_pad_tgt = tgt_sr * x_pad
self.t_pad = self.sr * self.x_pad # 每条前后pad时间
self.t_pad_tgt = tgt_sr * self.x_pad
self.t_pad2 = self.t_pad * 2
self.t_query = self.sr * x_query # 查询切点前后查询时间
self.t_center = self.sr * x_center # 查询切点位置
self.t_max = self.sr * x_max # 免查询时长阈值
self.device = device
self.is_half = is_half
self.t_query = self.sr * self.x_query # 查询切点前后查询时间
self.t_center = self.sr * self.x_center # 查询切点位置
self.t_max = self.sr * self.x_max # 免查询时长阈值
self.device = config.device
def get_f0(self, x, p_len, f0_up_key, f0_method, inp_f0=None):
def get_f0(
self,
input_audio_path,
x,
p_len,
f0_up_key,
f0_method,
filter_radius,
inp_f0=None,
):
global input_audio_path2wav
time_step = self.window / self.sr * 1000
f0_min = 50
f0_max = 1100
@@ -45,15 +77,10 @@ class VC(object):
f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant"
)
elif f0_method == "harvest":
f0, t = pyworld.harvest(
x.astype(np.double),
fs=self.sr,
f0_ceil=f0_max,
f0_floor=f0_min,
frame_period=10,
)
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.sr)
f0 = signal.medfilt(f0, 3)
input_audio_path2wav[input_audio_path] = x.astype(np.double)
f0 = cache_harvest_f0(input_audio_path, self.sr, f0_max, f0_min, 10)
if filter_radius > 2:
f0 = signal.medfilt(f0, 3)
f0 *= pow(2, f0_up_key / 12)
# with open("test.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
tf0 = self.sr // self.window # 每秒f0点数
@@ -64,8 +91,10 @@ class VC(object):
replace_f0 = np.interp(
list(range(delta_t)), inp_f0[:, 0] * 100, inp_f0[:, 1]
)
shape = f0[x_pad * tf0 : x_pad * tf0 + len(replace_f0)].shape[0]
f0[x_pad * tf0 : x_pad * tf0 + len(replace_f0)] = replace_f0[:shape]
shape = f0[self.x_pad * tf0 : self.x_pad * tf0 + len(replace_f0)].shape[0]
f0[self.x_pad * tf0 : self.x_pad * tf0 + len(replace_f0)] = replace_f0[
:shape
]
# with open("test_opt.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
f0bak = f0.copy()
f0_mel = 1127 * np.log(1 + f0 / 700)
@@ -151,7 +180,6 @@ class VC(object):
.data.cpu()
.float()
.numpy()
.astype(np.int16)
)
else:
audio1 = (
@@ -159,7 +187,6 @@ class VC(object):
.data.cpu()
.float()
.numpy()
.astype(np.int16)
)
del feats, p_len, padding_mask
if torch.cuda.is_available():
@@ -175,6 +202,7 @@ class VC(object):
net_g,
sid,
audio,
input_audio_path,
times,
f0_up_key,
f0_method,
@@ -182,6 +210,9 @@ class VC(object):
# file_big_npy,
index_rate,
if_f0,
filter_radius,
tgt_sr,
resample_sr,
f0_file=None,
):
if (
@@ -236,9 +267,19 @@ class VC(object):
sid = torch.tensor(sid, device=self.device).unsqueeze(0).long()
pitch, pitchf = None, None
if if_f0 == 1:
pitch, pitchf = self.get_f0(audio_pad, p_len, f0_up_key, f0_method, inp_f0)
pitch, pitchf = self.get_f0(
input_audio_path,
audio_pad,
p_len,
f0_up_key,
f0_method,
filter_radius,
inp_f0,
)
pitch = pitch[:p_len]
pitchf = pitchf[:p_len]
if self.device == "mps":
pitchf = pitchf.astype(np.float32)
pitch = torch.tensor(pitch, device=self.device).unsqueeze(0).long()
pitchf = torch.tensor(pitchf, device=self.device).unsqueeze(0).float()
t2 = ttime()
@@ -307,6 +348,11 @@ class VC(object):
)[self.t_pad_tgt : -self.t_pad_tgt]
)
audio_opt = np.concatenate(audio_opt)
if resample_sr >= 16000 and tgt_sr != resample_sr:
audio_opt = librosa.resample(
audio_opt, orig_sr=tgt_sr, target_sr=resample_sr
)
audio_opt = audio_opt.astype(np.int16)
del pitch, pitchf, sid
if torch.cuda.is_available():
torch.cuda.empty_cache()