assistanttttttt commited on
Commit
f08e9a8
·
1 Parent(s): 36a9519

Integrate RVC training tab (100 epochs)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. RVC/.github/PULL_REQUEST_TEMPLATE.md +26 -0
  2. RVC/.github/workflows/docker.yml +70 -0
  3. RVC/.github/workflows/genlocale.yml +38 -0
  4. RVC/.github/workflows/pull_format.yml +48 -0
  5. RVC/.github/workflows/push_format.yml +52 -0
  6. RVC/.github/workflows/sync_dev.yml +23 -0
  7. RVC/.github/workflows/unitest.yml +36 -0
  8. RVC/.gitignore +28 -0
  9. RVC/CONTRIBUTING.md +11 -0
  10. RVC/Dockerfile +48 -0
  11. RVC/LICENSE +23 -0
  12. RVC/MIT协议暨相关引用库协议 +45 -0
  13. RVC/README.md +213 -0
  14. RVC/Retrieval_based_Voice_Conversion_WebUI.ipynb +403 -0
  15. RVC/Retrieval_based_Voice_Conversion_WebUI_v2.ipynb +422 -0
  16. RVC/api_231006.py +440 -0
  17. RVC/api_240604.py +565 -0
  18. RVC/assets/hubert/.gitignore +3 -0
  19. RVC/assets/hubert/hubert_inputs.pth +3 -0
  20. RVC/assets/indices/.gitignore +2 -0
  21. RVC/assets/pretrained/.gitignore +2 -0
  22. RVC/assets/pretrained_v2/.gitignore +2 -0
  23. RVC/assets/rmvpe/.gitignore +3 -0
  24. RVC/assets/rmvpe/rmvpe_inputs.pth +3 -0
  25. RVC/assets/uvr5_weights/.gitignore +2 -0
  26. RVC/assets/weights/.gitignore +2 -0
  27. RVC/configs/config.json +1 -0
  28. RVC/configs/config.py +254 -0
  29. RVC/configs/inuse/.gitignore +4 -0
  30. RVC/configs/inuse/v1/.gitignore +2 -0
  31. RVC/configs/inuse/v2/.gitignore +2 -0
  32. RVC/configs/v1/32k.json +46 -0
  33. RVC/configs/v1/40k.json +46 -0
  34. RVC/configs/v1/48k.json +46 -0
  35. RVC/configs/v2/32k.json +46 -0
  36. RVC/configs/v2/48k.json +46 -0
  37. RVC/docker-compose.yml +20 -0
  38. RVC/environment_dml.yaml +186 -0
  39. RVC/go-realtime-gui-dml.bat +2 -0
  40. RVC/go-realtime-gui.bat +2 -0
  41. RVC/go-web-dml.bat +2 -0
  42. RVC/go-web.bat +2 -0
  43. RVC/gui_v1.py +1070 -0
  44. RVC/i18n/i18n.py +27 -0
  45. RVC/i18n/locale/en_US.json +137 -0
  46. RVC/i18n/locale/es_ES.json +137 -0
  47. RVC/i18n/locale/fr_FR.json +137 -0
  48. RVC/i18n/locale/it_IT.json +137 -0
  49. RVC/i18n/locale/ja_JP.json +137 -0
  50. RVC/i18n/locale/ko_KR.json +137 -0
RVC/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pull request checklist
2
+
3
+ - [ ] The PR has a proper title. Use [Semantic Commit Messages](https://seesparkbox.com/foundry/semantic_commit_messages). (No more branch-name title please)
4
+ - [ ] Make sure this is ready to be merged into the relevant branch. Please don't create a PR and let it hang for a few days.
5
+ - [ ] Ensure you can run the codes you submitted succesfully. These submissions will be prioritized for review:
6
+
7
+ Introduce improvements in program execution speed;
8
+
9
+ Introduce improvements in synthesis quality;
10
+
11
+ Fix existing bugs reported by user feedback (or you met);
12
+
13
+ Introduce more convenient user operations.
14
+
15
+ # PR type
16
+
17
+ - Bug fix / new feature / synthesis quality improvement / program execution speed improvement
18
+
19
+ # Description
20
+
21
+ - Describe what this pull request is for.
22
+ - What will it affect.
23
+
24
+ # Screenshot
25
+
26
+ - Please include a screenshot if applicable
RVC/.github/workflows/docker.yml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and Push Docker Image
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ # Sequence of patterns matched against refs/tags
7
+ tags:
8
+ - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ packages: write
15
+ contents: read
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Set time zone
19
+ uses: szenius/set-timezone@v1.0
20
+ with:
21
+ timezoneLinux: "Asia/Shanghai"
22
+ timezoneMacos: "Asia/Shanghai"
23
+ timezoneWindows: "China Standard Time"
24
+
25
+ # # 如果有 dockerhub 账户,可以在github的secrets中配置下面两个,然后取消下面注释的这几行,并在meta步骤的images增加一行 ${{ github.repository }}
26
+ # - name: Login to DockerHub
27
+ # uses: docker/login-action@v1
28
+ # with:
29
+ # username: ${{ secrets.DOCKERHUB_USERNAME }}
30
+ # password: ${{ secrets.DOCKERHUB_TOKEN }}
31
+
32
+ - name: Login to GHCR
33
+ uses: docker/login-action@v2
34
+ with:
35
+ registry: ghcr.io
36
+ username: ${{ github.repository_owner }}
37
+ password: ${{ secrets.GITHUB_TOKEN }}
38
+
39
+ - name: Extract metadata (tags, labels) for Docker
40
+ id: meta
41
+ uses: docker/metadata-action@v4
42
+ with:
43
+ images: |
44
+ ghcr.io/${{ github.repository }}
45
+ # generate Docker tags based on the following events/attributes
46
+ # nightly, master, pr-2, 1.2.3, 1.2, 1
47
+ tags: |
48
+ type=schedule,pattern=nightly
49
+ type=edge
50
+ type=ref,event=branch
51
+ type=ref,event=pr
52
+ type=semver,pattern={{version}}
53
+ type=semver,pattern={{major}}.{{minor}}
54
+ type=semver,pattern={{major}}
55
+
56
+ - name: Set up QEMU
57
+ uses: docker/setup-qemu-action@v2
58
+
59
+ - name: Set up Docker Buildx
60
+ uses: docker/setup-buildx-action@v2
61
+
62
+ - name: Build and push
63
+ id: docker_build
64
+ uses: docker/build-push-action@v4
65
+ with:
66
+ context: .
67
+ platforms: linux/amd64,linux/arm64
68
+ push: true
69
+ tags: ${{ steps.meta.outputs.tags }}
70
+ labels: ${{ steps.meta.outputs.labels }}
RVC/.github/workflows/genlocale.yml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Generate and Sync Locale
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ - dev
7
+ jobs:
8
+ genlocale:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@master
12
+
13
+ - name: Run locale generation
14
+ run: |
15
+ python3 i18n/scan_i18n.py
16
+ cd i18n
17
+ python3 locale_diff.py
18
+
19
+ - name: Commit back
20
+ if: ${{ !github.head_ref }}
21
+ id: commitback
22
+ continue-on-error: true
23
+ run: |
24
+ git config --local user.name 'github-actions[bot]'
25
+ git config --local user.email 'github-actions[bot]@users.noreply.github.com'
26
+ git add --all
27
+ git commit -m "chore(i18n): sync locale on ${{github.ref_name}}"
28
+
29
+ - name: Create Pull Request
30
+ if: steps.commitback.outcome == 'success'
31
+ continue-on-error: true
32
+ uses: peter-evans/create-pull-request@v5
33
+ with:
34
+ delete-branch: true
35
+ body: "Automatically sync i18n translation jsons"
36
+ title: "chore(i18n): sync locale on ${{github.ref_name}}"
37
+ commit-message: "chore(i18n): sync locale on ${{github.ref_name}}"
38
+ branch: genlocale-${{github.ref_name}}
RVC/.github/workflows/pull_format.yml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Check Pull Format
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, reopened]
6
+
7
+ jobs:
8
+ # This workflow closes invalid PR
9
+ close_pr:
10
+ # The type of runner that the job will run on
11
+ runs-on: ubuntu-latest
12
+ permissions: write-all
13
+
14
+ # Steps represent a sequence of tasks that will be executed as part of the job
15
+ steps:
16
+ - name: Close PR if it is not pointed to dev branch
17
+ if: github.event.pull_request.base.ref != 'dev'
18
+ uses: superbrothers/close-pull-request@v3
19
+ with:
20
+ # Optional. Post a issue comment just before closing a pull request.
21
+ comment: "Invalid PR to `non-dev` branch `${{ github.event.pull_request.base.ref }}`."
22
+
23
+ pull_format:
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ contents: write
27
+
28
+ continue-on-error: true
29
+
30
+ steps:
31
+ - name: Checkout
32
+ continue-on-error: true
33
+ uses: actions/checkout@v3
34
+ with:
35
+ ref: ${{ github.head_ref }}
36
+ fetch-depth: 0
37
+
38
+ - name: Set up Python ${{ matrix.python-version }}
39
+ uses: actions/setup-python@v4
40
+ with:
41
+ python-version: ${{ matrix.python-version }}
42
+
43
+ - name: Install Black
44
+ run: pip install "black[jupyter]"
45
+
46
+ - name: Run Black
47
+ # run: black $(git ls-files '*.py')
48
+ run: black .
RVC/.github/workflows/push_format.yml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Standardize Code Format
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - dev
8
+
9
+ jobs:
10
+ push_format:
11
+ runs-on: ubuntu-latest
12
+
13
+ permissions:
14
+ contents: write
15
+ pull-requests: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ with:
20
+ ref: ${{github.ref_name}}
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v4
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install Black
28
+ run: pip install "black[jupyter]"
29
+
30
+ - name: Run Black
31
+ # run: black $(git ls-files '*.py')
32
+ run: black .
33
+
34
+ - name: Commit Back
35
+ continue-on-error: true
36
+ id: commitback
37
+ run: |
38
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
39
+ git config --local user.name "github-actions[bot]"
40
+ git add --all
41
+ git commit -m "chore(format): run black on ${{github.ref_name}}"
42
+
43
+ - name: Create Pull Request
44
+ if: steps.commitback.outcome == 'success'
45
+ continue-on-error: true
46
+ uses: peter-evans/create-pull-request@v5
47
+ with:
48
+ delete-branch: true
49
+ body: "Automatically apply code formatter change"
50
+ title: "chore(format): run black on ${{github.ref_name}}"
51
+ commit-message: "chore(format): run black on ${{github.ref_name}}"
52
+ branch: formatter-${{github.ref_name}}
RVC/.github/workflows/sync_dev.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Merge dev into main
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ sync_dev:
8
+ runs-on: ubuntu-latest
9
+
10
+ permissions:
11
+ contents: write
12
+ pull-requests: write
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ with:
17
+ ref: main
18
+
19
+ - name: Create Pull Request
20
+ run: |
21
+ gh pr create --title "chore(sync): merge dev into main" --body "Merge dev to main" --base main --head dev
22
+ env:
23
+ GH_TOKEN: ${{ github.token }}
RVC/.github/workflows/unitest.yml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Unit Test
2
+ on: [ push, pull_request ]
3
+ jobs:
4
+ build:
5
+ runs-on: ${{ matrix.os }}
6
+ strategy:
7
+ matrix:
8
+ python-version: ["3.8", "3.9", "3.10"]
9
+ os: [ubuntu-latest]
10
+ fail-fast: true
11
+
12
+ steps:
13
+ - uses: actions/checkout@master
14
+ - name: Set up Python ${{ matrix.python-version }}
15
+ uses: actions/setup-python@v4
16
+ with:
17
+ python-version: ${{ matrix.python-version }}
18
+ - name: Install dependencies
19
+ run: |
20
+ sudo apt update
21
+ sudo apt -y install ffmpeg
22
+ sudo apt -y install -qq aria2
23
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d ./ -o hubert_base.pt
24
+ python -m pip install --upgrade pip
25
+ python -m pip install --upgrade setuptools
26
+ python -m pip install --upgrade wheel
27
+ pip install torch torchvision torchaudio
28
+ pip install -r requirements.txt
29
+ - name: Test step 1 & 2
30
+ run: |
31
+ mkdir -p logs/mi-test
32
+ touch logs/mi-test/preprocess.log
33
+ python infer/modules/train/preprocess.py logs/mute/0_gt_wavs 48000 8 logs/mi-test True 3.7
34
+ touch logs/mi-test/extract_f0_feature.log
35
+ python infer/modules/train/extract/extract_f0_print.py logs/mi-test $(nproc) pm
36
+ python infer/modules/train/extract_feature_print.py cpu 1 0 0 logs/mi-test v1 True
RVC/.gitignore ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .DS_Store
2
+ __pycache__
3
+ /TEMP
4
+ *.pyd
5
+ .venv
6
+ /opt
7
+ tools/aria2c/
8
+ tools/flag.txt
9
+
10
+ # Imported from huggingface.co/lj1995/VoiceConversionWebUI
11
+ /pretrained
12
+ /pretrained_v2
13
+ /uvr5_weights
14
+ hubert_base.pt
15
+ rmvpe.onnx
16
+ rmvpe.pt
17
+
18
+ # Generated by RVC
19
+ /logs
20
+ /weights
21
+
22
+ # To set a Python version for the project
23
+ .tool-versions
24
+
25
+ /runtime
26
+ /assets/weights/*
27
+ ffmpeg.*
28
+ ffprobe.*
RVC/CONTRIBUTING.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 贡献规则
2
+ 1. 一般来说,作者`@RVC-Boss`将拒绝所有的算法更改,除非它是为了修复某个代码层面的错误或警告
3
+ 2. 您可以贡献本仓库的其他位置,如翻译和WebUI,但请尽量作最小更改
4
+ 3. 所有更改都需要由`@RVC-Boss`批准,因此您的PR可能会被搁置
5
+ 4. 由此带来的不便请您谅解
6
+
7
+ # Contributing Rules
8
+ 1. Generally, the author `@RVC-Boss` will reject all algorithm changes unless what is to fix a code-level error or warning.
9
+ 2. You can contribute to other parts of this repo like translations and WebUI, but please minimize your changes as much as possible.
10
+ 3. All changes need to be approved by `@RVC-Boss`, so your PR may be put on hold.
11
+ 4. Please accept our apologies for any inconvenience caused.
RVC/Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04
4
+
5
+ EXPOSE 7865
6
+
7
+ WORKDIR /app
8
+
9
+ COPY . .
10
+
11
+ # Install dependenceis to add PPAs
12
+ RUN apt-get update && \
13
+ apt-get install -y -qq ffmpeg aria2 && apt clean && \
14
+ apt-get install -y software-properties-common && \
15
+ apt-get clean && \
16
+ rm -rf /var/lib/apt/lists/*
17
+
18
+ # Add the deadsnakes PPA to get Python 3.9
19
+ RUN add-apt-repository ppa:deadsnakes/ppa
20
+
21
+ # Install Python 3.9 and pip
22
+ RUN apt-get update && \
23
+ apt-get install -y build-essential python-dev python3-dev python3.9-distutils python3.9-dev python3.9 curl && \
24
+ apt-get clean && \
25
+ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
26
+ curl https://bootstrap.pypa.io/get-pip.py | python3.9
27
+
28
+ # Set Python 3.9 as the default
29
+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
30
+
31
+ RUN python3 -m pip install --upgrade pip==24.0
32
+ RUN python3 -m pip install --no-cache-dir -r requirements.txt
33
+
34
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/D40k.pth -d assets/pretrained_v2/ -o D40k.pth
35
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/G40k.pth -d assets/pretrained_v2/ -o G40k.pth
36
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D40k.pth -d assets/pretrained_v2/ -o f0D40k.pth
37
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G40k.pth -d assets/pretrained_v2/ -o f0G40k.pth
38
+
39
+ RUN 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 assets/uvr5_weights/ -o HP2-人声vocals+非人声instrumentals.pth
40
+ RUN 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 assets/uvr5_weights/ -o HP5-主旋律人声vocals+其他instrumentals.pth
41
+
42
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d assets/hubert -o hubert_base.pt
43
+
44
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d assets/rmvpe -o rmvpe.pt
45
+
46
+ VOLUME [ "/app/weights", "/app/opt" ]
47
+
48
+ CMD ["python3", "infer-web.py"]
RVC/LICENSE ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 liujing04
4
+ Copyright (c) 2023 源文雨
5
+ Copyright (c) 2023 Ftps
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
RVC/MIT协议暨相关引用库协议 ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 本软件及其相关代码以MIT协议开源,作者不对软件具备任何控制力,使用软件者、传播软件导出的声音者自负全责。
2
+ 如不认可该条款,则不能使用或引用软件包内任何代码和文件。
3
+
4
+ 特此授予任何获得本软件和相关文档文件(以下简称“软件”)副本的人免费使用、复制、修改、合并、出版、分发、再授权和/或销售本软件的权利,以及授予本软件所提供的人使用本软件的权利,但须符合以下条件:
5
+ 上述版权声明和本许可声明应包含在软件的所有副本或实质部分中。
6
+ 软件是“按原样”提供的,没有任何明示或暗示的保证,包括但不限于适销性、适用于特定目的和不侵权的保证。在任何情况下,作者或版权持有人均不承担因软件或软件的使用或其他交易而产生、产生或与之相关的任何索赔、损害赔偿或其他责任,无论是在合同诉讼、侵权诉讼还是其他诉讼中。
7
+
8
+
9
+ The LICENCEs for related libraries are as follows.
10
+ 相关引用库协议如下:
11
+
12
+ ContentVec
13
+ https://github.com/auspicious3000/contentvec/blob/main/LICENSE
14
+ MIT License
15
+
16
+ VITS
17
+ https://github.com/jaywalnut310/vits/blob/main/LICENSE
18
+ MIT License
19
+
20
+ HIFIGAN
21
+ https://github.com/jik876/hifi-gan/blob/master/LICENSE
22
+ MIT License
23
+
24
+ gradio
25
+ https://github.com/gradio-app/gradio/blob/main/LICENSE
26
+ Apache License 2.0
27
+
28
+ ffmpeg
29
+ https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.LGPLv3
30
+ 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
31
+ LPGLv3 License
32
+ MIT License
33
+
34
+ ultimatevocalremovergui
35
+ https://github.com/Anjok07/ultimatevocalremovergui/blob/master/LICENSE
36
+ https://github.com/yang123qwe/vocal_separation_by_uvr5
37
+ MIT License
38
+
39
+ audio-slicer
40
+ https://github.com/openvpi/audio-slicer/blob/main/LICENSE
41
+ MIT License
42
+
43
+ PySimpleGUI
44
+ https://github.com/PySimpleGUI/PySimpleGUI/blob/master/license.txt
45
+ LPGLv3 License
RVC/README.md ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="center">
2
+
3
+ <h1>Retrieval-based-Voice-Conversion-WebUI</h1>
4
+ 一个基于VITS的简单易用的变声框架<br><br>
5
+
6
+ [![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange
7
+ )](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
8
+
9
+ <img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
10
+
11
+ [![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge&logo=googlecolab&color=525252)](https://colab.research.google.com/github/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/Retrieval_based_Voice_Conversion_WebUI.ipynb)
12
+ [![Licence](https://img.shields.io/badge/LICENSE-MIT-green.svg?style=for-the-badge)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/LICENSE)
13
+ [![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
14
+
15
+ [![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
16
+
17
+ [**更新日志**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/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)) | [**在线演示**](https://modelscope.cn/studios/FlowerCry/RVCv2demo)
18
+
19
+ [**English**](./docs/en/README.en.md) | [**中文简体**](./README.md) | [**日本語**](./docs/jp/README.ja.md) | [**한국어**](./docs/kr/README.ko.md) ([**韓國語**](./docs/kr/README.ko.han.md)) | [**Français**](./docs/fr/README.fr.md) | [**Türkçe**](./docs/tr/README.tr.md) | [**Português**](./docs/pt/README.pt.md)
20
+
21
+ </div>
22
+
23
+ > 底模使用接近50小时的开源高质量VCTK训练集训练,无版权方面的顾虑,请大家放心使用
24
+
25
+ > 请期待RVCv3的底模,参数更大,数据更大,效果更好,基本持平的推理速度,需要训练数据量更少。
26
+
27
+ <table>
28
+ <tr>
29
+ <td align="center">训练推理界面</td>
30
+ <td align="center">实时变声界面</td>
31
+ </tr>
32
+ <tr>
33
+ <td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/092e5c12-0d49-4168-a590-0b0ef6a4f630"></td>
34
+ <td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/730b4114-8805-44a1-ab1a-04668f3c30a6"></td>
35
+ </tr>
36
+ <tr>
37
+ <td align="center">go-web.bat</td>
38
+ <td align="center">go-realtime-gui.bat</td>
39
+ </tr>
40
+ <tr>
41
+ <td align="center">可以自由选择想要执行的操作。</td>
42
+ <td align="center">我们已经实现端到端170ms延迟。如使用ASIO输入输出设备,已能实现端到端90ms延迟,但非常依赖硬件驱动支持。</td>
43
+ </tr>
44
+ </table>
45
+
46
+ ## 简介
47
+ 本仓库具有以下特点
48
+ + 使用top1检索替换输入源特征为训练集特征来杜绝音色泄漏
49
+ + 即便在相对较差的显卡上也能快速训练
50
+ + 使用少量数据进行训练也能得到较好结果(推荐至少收集10分钟低底噪语音数据)
51
+ + 可以通过模型融合来改变音色(借助ckpt处理选项卡中的ckpt-merge)
52
+ + 简单易用的网页界面
53
+ + 可调用UVR5模型来快速分离人声和伴奏
54
+ + 使用最先进的[人声音高提取算法InterSpeech2023-RMVPE](#参考项目)根绝哑音问题。效果最好(显著地)但比crepe_full更快、资源占用更小
55
+ + A卡I卡加速支持
56
+
57
+ 点此查看我们的[演示视频](https://www.bilibili.com/video/BV1pm4y1z7Gm/) !
58
+
59
+ ## 环境配置
60
+ 以下指令需在 Python 版本大于3.8的环境中执行。
61
+
62
+ ### Windows/Linux/MacOS等平台通用方法
63
+ 下列方法任选其一。
64
+ #### 1. 通过 pip 安装依赖
65
+ 1. 安装Pytorch及其核心依赖,若已安装则跳过。参考自: https://pytorch.org/get-started/locally/
66
+ ```bash
67
+ pip install torch torchvision torchaudio
68
+ ```
69
+ 2. 如果是 win 系统 + Nvidia Ampere 架构(RTX30xx),根据 #21 的经验,需要指定 pytorch 对应的 cuda 版本
70
+ ```bash
71
+ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
72
+ ```
73
+ 3. 根据自己的显卡安装对应依赖
74
+ - N卡
75
+ ```bash
76
+ pip install -r requirements.txt
77
+ ```
78
+ - A卡/I卡
79
+ ```bash
80
+ pip install -r requirements-dml.txt
81
+ ```
82
+ - A卡ROCM(Linux)
83
+ ```bash
84
+ pip install -r requirements-amd.txt
85
+ ```
86
+ - I卡IPEX(Linux)
87
+ ```bash
88
+ pip install -r requirements-ipex.txt
89
+ ```
90
+
91
+ #### 2. 通过 poetry 来安装依赖
92
+ 安装 Poetry 依赖管理工具,若已安装则跳过。参考自: https://python-poetry.org/docs/#installation
93
+ ```bash
94
+ curl -sSL https://install.python-poetry.org | python3 -
95
+ ```
96
+
97
+ 通过 Poetry 安装依赖时,python 建议使用 3.7-3.10 版本,其余版本在安装 llvmlite==0.39.0 时会出现冲突
98
+ ```bash
99
+ poetry init -n
100
+ poetry env use "path to your python.exe"
101
+ poetry run pip install -r requirments.txt
102
+ ```
103
+
104
+ ### MacOS
105
+ 可以通过 `run.sh` 来安装依赖
106
+ ```bash
107
+ sh ./run.sh
108
+ ```
109
+
110
+ ## 其他预模型准备
111
+ RVC需要其他一些预模型来推理和训练。
112
+
113
+ 你可以从我们的[Hugging Face space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)下载到这些模型。
114
+
115
+ ### 1. 下载 assets
116
+ 以下是一份清单,包括了所有RVC所需的预模型和其他文件的名称。你可以在`tools`文件夹找到下载它们的脚本。
117
+
118
+ - ./assets/hubert/hubert_base.pt
119
+
120
+ - ./assets/pretrained
121
+
122
+ - ./assets/uvr5_weights
123
+
124
+ 想使用v2版本模型的话,需要额外下载
125
+
126
+ - ./assets/pretrained_v2
127
+
128
+ ### 2. 安装 ffmpeg
129
+ 若ffmpeg和ffprobe已安装则跳过。
130
+
131
+ #### Ubuntu/Debian 用户
132
+ ```bash
133
+ sudo apt install ffmpeg
134
+ ```
135
+ #### MacOS 用户
136
+ ```bash
137
+ brew install ffmpeg
138
+ ```
139
+ #### Windows 用户
140
+ 下载后放置在根目录。
141
+ - 下载[ffmpeg.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe)
142
+
143
+ - 下载[ffprobe.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe)
144
+
145
+ ### 3. 下载 rmvpe 人声音高提取算法所需文件
146
+
147
+ 如果你想使用最新的RMVPE人声音高提取算法,则你需要下载音高提取模型参数并放置于RVC根目录。
148
+
149
+ - 下载[rmvpe.pt](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt)
150
+
151
+ #### 下载 rmvpe 的 dml 环境(可选, A卡/I卡用户)
152
+
153
+ - 下载[rmvpe.onnx](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx)
154
+
155
+ ### 4. AMD显卡Rocm(可选, 仅Linux)
156
+
157
+ 如果你想基于AMD的Rocm技术在Linux系统上运行RVC,请先在[这里](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html)安装所需的驱动。
158
+
159
+ 若你使用的是Arch Linux,可以使用pacman来安装所需驱动:
160
+ ````
161
+ pacman -S rocm-hip-sdk rocm-opencl-sdk
162
+ ````
163
+ 对于某些型号的显卡,你可能需要额外配置如下的环境变量(如:RX6700XT):
164
+ ````
165
+ export ROCM_PATH=/opt/rocm
166
+ export HSA_OVERRIDE_GFX_VERSION=10.3.0
167
+ ````
168
+ 同时确保你的当前用户处于`render`与`video`用户组内:
169
+ ````
170
+ sudo usermod -aG render $USERNAME
171
+ sudo usermod -aG video $USERNAME
172
+ ````
173
+
174
+ ## 开始使用
175
+ ### 直接启动
176
+ 使用以下指令来启动 WebUI
177
+ ```bash
178
+ python infer-web.py
179
+ ```
180
+
181
+ 若先前使用 Poetry 安装依赖,则可以通过以下方式启动WebUI
182
+ ```bash
183
+ poetry run python infer-web.py
184
+ ```
185
+
186
+ ### 使用整合包
187
+ 下载并解压`RVC-beta.7z`
188
+ #### Windows 用户
189
+ 双击`go-web.bat`
190
+ #### MacOS 用户
191
+ ```bash
192
+ sh ./run.sh
193
+ ```
194
+ ### 对于需要使用IPEX技术的I卡用户(仅Linux)
195
+ ```bash
196
+ source /opt/intel/oneapi/setvars.sh
197
+ ```
198
+
199
+ ## 参考项目
200
+ + [ContentVec](https://github.com/auspicious3000/contentvec/)
201
+ + [VITS](https://github.com/jaywalnut310/vits)
202
+ + [HIFIGAN](https://github.com/jik876/hifi-gan)
203
+ + [Gradio](https://github.com/gradio-app/gradio)
204
+ + [FFmpeg](https://github.com/FFmpeg/FFmpeg)
205
+ + [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
206
+ + [audio-slicer](https://github.com/openvpi/audio-slicer)
207
+ + [Vocal pitch extraction:RMVPE](https://github.com/Dream-High/RMVPE)
208
+ + The pretrained model is trained and tested by [yxlllc](https://github.com/yxlllc/RMVPE) and [RVC-Boss](https://github.com/RVC-Boss).
209
+
210
+ ## 感谢所有贡献者作出的努力
211
+ <a href="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
212
+ <img src="https://contrib.rocks/image?repo=RVC-Project/Retrieval-based-Voice-Conversion-WebUI" />
213
+ </a>
RVC/Retrieval_based_Voice_Conversion_WebUI.ipynb ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "attachments": {},
5
+ "cell_type": "markdown",
6
+ "metadata": {},
7
+ "source": [
8
+ "# [Retrieval-based-Voice-Conversion-WebUI](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI) Training notebook"
9
+ ]
10
+ },
11
+ {
12
+ "attachments": {},
13
+ "cell_type": "markdown",
14
+ "metadata": {
15
+ "id": "ZFFCx5J80SGa"
16
+ },
17
+ "source": [
18
+ "[![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.ipynb)"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": null,
24
+ "metadata": {
25
+ "id": "GmFP6bN9dvOq"
26
+ },
27
+ "outputs": [],
28
+ "source": [
29
+ "# @title 查看显卡\n",
30
+ "!nvidia-smi"
31
+ ]
32
+ },
33
+ {
34
+ "cell_type": "code",
35
+ "execution_count": null,
36
+ "metadata": {
37
+ "id": "jwu07JgqoFON"
38
+ },
39
+ "outputs": [],
40
+ "source": [
41
+ "# @title 挂载谷歌云盘\n",
42
+ "\n",
43
+ "from google.colab import drive\n",
44
+ "\n",
45
+ "drive.mount(\"/content/drive\")"
46
+ ]
47
+ },
48
+ {
49
+ "cell_type": "code",
50
+ "execution_count": null,
51
+ "metadata": {
52
+ "id": "wjddIFr1oS3W"
53
+ },
54
+ "outputs": [],
55
+ "source": [
56
+ "# @title 安装依赖\n",
57
+ "!apt-get -y install build-essential python3-dev ffmpeg\n",
58
+ "!pip3 install --upgrade setuptools wheel\n",
59
+ "!pip3 install --upgrade pip\n",
60
+ "!pip3 install faiss-cpu==1.7.2 fairseq gradio==3.14.0 ffmpeg ffmpeg-python praat-parselmouth pyworld numpy==1.23.5 numba==0.56.4 librosa==0.9.2"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "code",
65
+ "execution_count": null,
66
+ "metadata": {
67
+ "id": "ge_97mfpgqTm"
68
+ },
69
+ "outputs": [],
70
+ "source": [
71
+ "# @title 克隆仓库\n",
72
+ "\n",
73
+ "!git clone --depth=1 -b stable https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI\n",
74
+ "%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
75
+ "!mkdir -p pretrained uvr5_weights"
76
+ ]
77
+ },
78
+ {
79
+ "cell_type": "code",
80
+ "execution_count": null,
81
+ "metadata": {
82
+ "id": "BLDEZADkvlw1"
83
+ },
84
+ "outputs": [],
85
+ "source": [
86
+ "# @title 更新仓库(一般无需执行)\n",
87
+ "!git pull"
88
+ ]
89
+ },
90
+ {
91
+ "cell_type": "code",
92
+ "execution_count": null,
93
+ "metadata": {
94
+ "id": "pqE0PrnuRqI2"
95
+ },
96
+ "outputs": [],
97
+ "source": [
98
+ "# @title 安装aria2\n",
99
+ "!apt -y install -qq aria2"
100
+ ]
101
+ },
102
+ {
103
+ "cell_type": "code",
104
+ "execution_count": null,
105
+ "metadata": {
106
+ "id": "UG3XpUwEomUz"
107
+ },
108
+ "outputs": [],
109
+ "source": [
110
+ "# @title 下载底模\n",
111
+ "!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",
112
+ "!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",
113
+ "!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",
114
+ "!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",
115
+ "!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",
116
+ "!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",
117
+ "!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",
118
+ "!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",
119
+ "!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",
120
+ "!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",
121
+ "!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",
122
+ "!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"
123
+ ]
124
+ },
125
+ {
126
+ "cell_type": "code",
127
+ "execution_count": null,
128
+ "metadata": {
129
+ "id": "HugjmZqZRuiF"
130
+ },
131
+ "outputs": [],
132
+ "source": [
133
+ "# @title 下载人声分离模型\n",
134
+ "!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",
135
+ "!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"
136
+ ]
137
+ },
138
+ {
139
+ "cell_type": "code",
140
+ "execution_count": null,
141
+ "metadata": {
142
+ "id": "2RCaT9FTR0ej"
143
+ },
144
+ "outputs": [],
145
+ "source": [
146
+ "# @title 下载hubert_base\n",
147
+ "!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"
148
+ ]
149
+ },
150
+ {
151
+ "cell_type": "code",
152
+ "execution_count": null,
153
+ "metadata": {},
154
+ "outputs": [],
155
+ "source": [
156
+ "# @title #下载rmvpe模型\n",
157
+ "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d /content/Retrieval-based-Voice-Conversion-WebUI -o rmvpe.pt"
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 = (\n",
172
+ " \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" # @param {type:\"string\"}\n",
173
+ ")\n",
174
+ "\n",
175
+ "!mkdir -p /content/dataset\n",
176
+ "!unzip -d /content/dataset -B {DATASET}"
177
+ ]
178
+ },
179
+ {
180
+ "cell_type": "code",
181
+ "execution_count": null,
182
+ "metadata": {
183
+ "id": "PDlFxWHWEynD"
184
+ },
185
+ "outputs": [],
186
+ "source": [
187
+ "# @title 重命名数据集中的重名文件\n",
188
+ "!ls -a /content/dataset/\n",
189
+ "!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
190
+ ]
191
+ },
192
+ {
193
+ "cell_type": "code",
194
+ "execution_count": null,
195
+ "metadata": {
196
+ "id": "7vh6vphDwO0b"
197
+ },
198
+ "outputs": [],
199
+ "source": [
200
+ "# @title 启动web\n",
201
+ "%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
202
+ "# %load_ext tensorboard\n",
203
+ "# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
204
+ "!python3 infer-web.py --colab --pycmd python3"
205
+ ]
206
+ },
207
+ {
208
+ "cell_type": "code",
209
+ "execution_count": null,
210
+ "metadata": {
211
+ "id": "FgJuNeAwx5Y_"
212
+ },
213
+ "outputs": [],
214
+ "source": [
215
+ "# @title 手动将训练后的模型文件备份到谷歌云盘\n",
216
+ "# @markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
217
+ "\n",
218
+ "# @markdown 模型名\n",
219
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
220
+ "# @markdown 模型epoch\n",
221
+ "MODELEPOCH = 9600 # @param {type:\"integer\"}\n",
222
+ "\n",
223
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
224
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth\n",
225
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/added_*.index /content/drive/MyDrive/\n",
226
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/total_*.npy /content/drive/MyDrive/\n",
227
+ "\n",
228
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth"
229
+ ]
230
+ },
231
+ {
232
+ "cell_type": "code",
233
+ "execution_count": null,
234
+ "metadata": {
235
+ "id": "OVQoLQJXS7WX"
236
+ },
237
+ "outputs": [],
238
+ "source": [
239
+ "# @title 从谷歌云盘恢复pth\n",
240
+ "# @markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
241
+ "\n",
242
+ "# @markdown 模型名\n",
243
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
244
+ "# @markdown 模型epoch\n",
245
+ "MODELEPOCH = 7500 # @param {type:\"integer\"}\n",
246
+ "\n",
247
+ "!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
248
+ "\n",
249
+ "!cp /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
250
+ "!cp /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
251
+ "!cp /content/drive/MyDrive/*.index /content/\n",
252
+ "!cp /content/drive/MyDrive/*.npy /content/\n",
253
+ "!cp /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth"
254
+ ]
255
+ },
256
+ {
257
+ "cell_type": "code",
258
+ "execution_count": null,
259
+ "metadata": {
260
+ "id": "ZKAyuKb9J6dz"
261
+ },
262
+ "outputs": [],
263
+ "source": [
264
+ "# @title 手动预处理(不推荐)\n",
265
+ "# @markdown 模型名\n",
266
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
267
+ "# @markdown 采样率\n",
268
+ "BITRATE = 48000 # @param {type:\"integer\"}\n",
269
+ "# @markdown 使用的进程数\n",
270
+ "THREADCOUNT = 8 # @param {type:\"integer\"}\n",
271
+ "\n",
272
+ "!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True"
273
+ ]
274
+ },
275
+ {
276
+ "cell_type": "code",
277
+ "execution_count": null,
278
+ "metadata": {
279
+ "id": "CrxJqzAUKmPJ"
280
+ },
281
+ "outputs": [],
282
+ "source": [
283
+ "# @title 手动提取特征(不推荐)\n",
284
+ "# @markdown 模型名\n",
285
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
286
+ "# @markdown 使用的进程数\n",
287
+ "THREADCOUNT = 8 # @param {type:\"integer\"}\n",
288
+ "# @markdown 音高提取算法\n",
289
+ "ALGO = \"harvest\" # @param {type:\"string\"}\n",
290
+ "\n",
291
+ "!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
292
+ "\n",
293
+ "!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME} True"
294
+ ]
295
+ },
296
+ {
297
+ "cell_type": "code",
298
+ "execution_count": null,
299
+ "metadata": {
300
+ "id": "IMLPLKOaKj58"
301
+ },
302
+ "outputs": [],
303
+ "source": [
304
+ "# @title 手动训练(不推荐)\n",
305
+ "# @markdown 模型名\n",
306
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
307
+ "# @markdown 使用的GPU\n",
308
+ "USEGPU = \"0\" # @param {type:\"string\"}\n",
309
+ "# @markdown 批大小\n",
310
+ "BATCHSIZE = 32 # @param {type:\"integer\"}\n",
311
+ "# @markdown 停止的epoch\n",
312
+ "MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
313
+ "# @markdown 保存epoch间隔\n",
314
+ "EPOCHSAVE = 100 # @param {type:\"integer\"}\n",
315
+ "# @markdown 采样率\n",
316
+ "MODELSAMPLE = \"48k\" # @param {type:\"string\"}\n",
317
+ "# @markdown 是否缓存训练集\n",
318
+ "CACHEDATA = 1 # @param {type:\"integer\"}\n",
319
+ "# @markdown 是否仅保存最新的ckpt文件\n",
320
+ "ONLYLATEST = 0 # @param {type:\"integer\"}\n",
321
+ "\n",
322
+ "!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}"
323
+ ]
324
+ },
325
+ {
326
+ "cell_type": "code",
327
+ "execution_count": null,
328
+ "metadata": {
329
+ "id": "haYA81hySuDl"
330
+ },
331
+ "outputs": [],
332
+ "source": [
333
+ "# @title 删除其它pth,只留选中的(慎点,仔细看代码)\n",
334
+ "# @markdown 模型名\n",
335
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
336
+ "# @markdown 选中模型epoch\n",
337
+ "MODELEPOCH = 9600 # @param {type:\"integer\"}\n",
338
+ "\n",
339
+ "!echo \"备份选中的模型。。。\"\n",
340
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
341
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
342
+ "\n",
343
+ "!echo \"正在删除。。。\"\n",
344
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
345
+ "!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
346
+ "\n",
347
+ "!echo \"恢复选中的模型。。。\"\n",
348
+ "!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
349
+ "!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
350
+ "\n",
351
+ "!echo \"删除完成\"\n",
352
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
353
+ ]
354
+ },
355
+ {
356
+ "cell_type": "code",
357
+ "execution_count": null,
358
+ "metadata": {
359
+ "id": "QhSiPTVPoIRh"
360
+ },
361
+ "outputs": [],
362
+ "source": [
363
+ "# @title 清除项目下所有文件,只留选中的模型(慎点,仔细看代码)\n",
364
+ "# @markdown 模型名\n",
365
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
366
+ "# @markdown 选中模型epoch\n",
367
+ "MODELEPOCH = 9600 # @param {type:\"integer\"}\n",
368
+ "\n",
369
+ "!echo \"备份选中的模型。。。\"\n",
370
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
371
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
372
+ "\n",
373
+ "!echo \"正在删除。。。\"\n",
374
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
375
+ "!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
376
+ "\n",
377
+ "!echo \"恢复选中的模型。。。\"\n",
378
+ "!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
379
+ "!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
380
+ "\n",
381
+ "!echo \"删除完成\"\n",
382
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
383
+ ]
384
+ }
385
+ ],
386
+ "metadata": {
387
+ "accelerator": "GPU",
388
+ "colab": {
389
+ "private_outputs": true,
390
+ "provenance": []
391
+ },
392
+ "gpuClass": "standard",
393
+ "kernelspec": {
394
+ "display_name": "Python 3",
395
+ "name": "python3"
396
+ },
397
+ "language_info": {
398
+ "name": "python"
399
+ }
400
+ },
401
+ "nbformat": 4,
402
+ "nbformat_minor": 0
403
+ }
RVC/Retrieval_based_Voice_Conversion_WebUI_v2.ipynb ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "attachments": {},
5
+ "cell_type": "markdown",
6
+ "metadata": {},
7
+ "source": [
8
+ "# [Retrieval-based-Voice-Conversion-WebUI](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI) Training notebook"
9
+ ]
10
+ },
11
+ {
12
+ "attachments": {},
13
+ "cell_type": "markdown",
14
+ "metadata": {
15
+ "id": "ZFFCx5J80SGa"
16
+ },
17
+ "source": [
18
+ "[![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)"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": null,
24
+ "metadata": {
25
+ "id": "GmFP6bN9dvOq"
26
+ },
27
+ "outputs": [],
28
+ "source": [
29
+ "# @title #查看显卡\n",
30
+ "!nvidia-smi"
31
+ ]
32
+ },
33
+ {
34
+ "cell_type": "code",
35
+ "execution_count": null,
36
+ "metadata": {
37
+ "id": "jwu07JgqoFON"
38
+ },
39
+ "outputs": [],
40
+ "source": [
41
+ "# @title 挂载谷歌云盘\n",
42
+ "\n",
43
+ "from google.colab import drive\n",
44
+ "\n",
45
+ "drive.mount(\"/content/drive\")"
46
+ ]
47
+ },
48
+ {
49
+ "cell_type": "code",
50
+ "execution_count": null,
51
+ "metadata": {
52
+ "id": "wjddIFr1oS3W"
53
+ },
54
+ "outputs": [],
55
+ "source": [
56
+ "# @title #安装依赖\n",
57
+ "!apt-get -y install build-essential python3-dev ffmpeg\n",
58
+ "!pip3 install --upgrade setuptools wheel\n",
59
+ "!pip3 install --upgrade pip\n",
60
+ "!pip3 install faiss-cpu==1.7.2 fairseq gradio==3.14.0 ffmpeg ffmpeg-python praat-parselmouth pyworld numpy==1.23.5 numba==0.56.4 librosa==0.9.2"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "code",
65
+ "execution_count": null,
66
+ "metadata": {
67
+ "id": "ge_97mfpgqTm"
68
+ },
69
+ "outputs": [],
70
+ "source": [
71
+ "# @title #克隆仓库\n",
72
+ "\n",
73
+ "!mkdir Retrieval-based-Voice-Conversion-WebUI\n",
74
+ "%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
75
+ "!git init\n",
76
+ "!git remote add origin https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git\n",
77
+ "!git fetch origin cfd984812804ddc9247d65b14c82cd32e56c1133 --depth=1\n",
78
+ "!git reset --hard FETCH_HEAD"
79
+ ]
80
+ },
81
+ {
82
+ "cell_type": "code",
83
+ "execution_count": null,
84
+ "metadata": {
85
+ "id": "BLDEZADkvlw1"
86
+ },
87
+ "outputs": [],
88
+ "source": [
89
+ "# @title #更新仓库(一般无需执行)\n",
90
+ "!git pull"
91
+ ]
92
+ },
93
+ {
94
+ "cell_type": "code",
95
+ "execution_count": null,
96
+ "metadata": {
97
+ "id": "pqE0PrnuRqI2"
98
+ },
99
+ "outputs": [],
100
+ "source": [
101
+ "# @title #安装aria2\n",
102
+ "!apt -y install -qq aria2"
103
+ ]
104
+ },
105
+ {
106
+ "cell_type": "code",
107
+ "execution_count": null,
108
+ "metadata": {
109
+ "id": "UG3XpUwEomUz"
110
+ },
111
+ "outputs": [],
112
+ "source": [
113
+ "# @title 下载底模\n",
114
+ "\n",
115
+ "# v1\n",
116
+ "!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",
117
+ "!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",
118
+ "!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",
119
+ "!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",
120
+ "!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",
121
+ "!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",
122
+ "!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",
123
+ "!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",
124
+ "!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",
125
+ "!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",
126
+ "!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",
127
+ "!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",
128
+ "\n",
129
+ "# v2\n",
130
+ "# !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",
131
+ "!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",
132
+ "# !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",
133
+ "# !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",
134
+ "!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",
135
+ "# !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",
136
+ "# !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",
137
+ "!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",
138
+ "# !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",
139
+ "# !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",
140
+ "!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",
141
+ "# !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"
142
+ ]
143
+ },
144
+ {
145
+ "cell_type": "code",
146
+ "execution_count": null,
147
+ "metadata": {
148
+ "id": "HugjmZqZRuiF"
149
+ },
150
+ "outputs": [],
151
+ "source": [
152
+ "# @title #下载人声分离模型\n",
153
+ "!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",
154
+ "!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"
155
+ ]
156
+ },
157
+ {
158
+ "cell_type": "code",
159
+ "execution_count": null,
160
+ "metadata": {
161
+ "id": "2RCaT9FTR0ej"
162
+ },
163
+ "outputs": [],
164
+ "source": [
165
+ "# @title #下载hubert_base\n",
166
+ "!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"
167
+ ]
168
+ },
169
+ {
170
+ "cell_type": "code",
171
+ "execution_count": null,
172
+ "metadata": {},
173
+ "outputs": [],
174
+ "source": [
175
+ "# @title #下载rmvpe模型\n",
176
+ "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d /content/Retrieval-based-Voice-Conversion-WebUI -o rmvpe.pt"
177
+ ]
178
+ },
179
+ {
180
+ "cell_type": "code",
181
+ "execution_count": null,
182
+ "metadata": {
183
+ "id": "Mwk7Q0Loqzjx"
184
+ },
185
+ "outputs": [],
186
+ "source": [
187
+ "# @title #从谷歌云盘加载打包好的数据集到/content/dataset\n",
188
+ "\n",
189
+ "# @markdown 数据集位置\n",
190
+ "DATASET = (\n",
191
+ " \"/content/drive/MyDrive/dataset/lulu20230327_32k.zip\" # @param {type:\"string\"}\n",
192
+ ")\n",
193
+ "\n",
194
+ "!mkdir -p /content/dataset\n",
195
+ "!unzip -d /content/dataset -B {DATASET}"
196
+ ]
197
+ },
198
+ {
199
+ "cell_type": "code",
200
+ "execution_count": null,
201
+ "metadata": {
202
+ "id": "PDlFxWHWEynD"
203
+ },
204
+ "outputs": [],
205
+ "source": [
206
+ "# @title #重命名数据集中的重名文件\n",
207
+ "!ls -a /content/dataset/\n",
208
+ "!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
209
+ ]
210
+ },
211
+ {
212
+ "cell_type": "code",
213
+ "execution_count": null,
214
+ "metadata": {
215
+ "id": "7vh6vphDwO0b"
216
+ },
217
+ "outputs": [],
218
+ "source": [
219
+ "# @title #启动webui\n",
220
+ "%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
221
+ "# %load_ext tensorboard\n",
222
+ "# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
223
+ "!python3 infer-web.py --colab --pycmd python3"
224
+ ]
225
+ },
226
+ {
227
+ "cell_type": "code",
228
+ "execution_count": null,
229
+ "metadata": {
230
+ "id": "FgJuNeAwx5Y_"
231
+ },
232
+ "outputs": [],
233
+ "source": [
234
+ "# @title #手动将训练后的模型文件备份到谷歌云盘\n",
235
+ "# @markdown #需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
236
+ "\n",
237
+ "# @markdown #模型名\n",
238
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
239
+ "# @markdown #模型epoch\n",
240
+ "MODELEPOCH = 9600 # @param {type:\"integer\"}\n",
241
+ "\n",
242
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
243
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth\n",
244
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/added_*.index /content/drive/MyDrive/\n",
245
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/total_*.npy /content/drive/MyDrive/\n",
246
+ "\n",
247
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth"
248
+ ]
249
+ },
250
+ {
251
+ "cell_type": "code",
252
+ "execution_count": null,
253
+ "metadata": {
254
+ "id": "OVQoLQJXS7WX"
255
+ },
256
+ "outputs": [],
257
+ "source": [
258
+ "# @title 从谷歌云盘恢复pth\n",
259
+ "# @markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
260
+ "\n",
261
+ "# @markdown 模型名\n",
262
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
263
+ "# @markdown 模型epoch\n",
264
+ "MODELEPOCH = 7500 # @param {type:\"integer\"}\n",
265
+ "\n",
266
+ "!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
267
+ "\n",
268
+ "!cp /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
269
+ "!cp /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
270
+ "!cp /content/drive/MyDrive/*.index /content/\n",
271
+ "!cp /content/drive/MyDrive/*.npy /content/\n",
272
+ "!cp /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth"
273
+ ]
274
+ },
275
+ {
276
+ "cell_type": "code",
277
+ "execution_count": null,
278
+ "metadata": {
279
+ "id": "ZKAyuKb9J6dz"
280
+ },
281
+ "outputs": [],
282
+ "source": [
283
+ "# @title 手动预处理(不推荐)\n",
284
+ "# @markdown 模型名\n",
285
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
286
+ "# @markdown 采样率\n",
287
+ "BITRATE = 48000 # @param {type:\"integer\"}\n",
288
+ "# @markdown 使用的进程数\n",
289
+ "THREADCOUNT = 8 # @param {type:\"integer\"}\n",
290
+ "\n",
291
+ "!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True"
292
+ ]
293
+ },
294
+ {
295
+ "cell_type": "code",
296
+ "execution_count": null,
297
+ "metadata": {
298
+ "id": "CrxJqzAUKmPJ"
299
+ },
300
+ "outputs": [],
301
+ "source": [
302
+ "# @title 手动提取特征(不推荐)\n",
303
+ "# @markdown 模型名\n",
304
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
305
+ "# @markdown 使用的进程数\n",
306
+ "THREADCOUNT = 8 # @param {type:\"integer\"}\n",
307
+ "# @markdown 音高提取算法\n",
308
+ "ALGO = \"harvest\" # @param {type:\"string\"}\n",
309
+ "\n",
310
+ "!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
311
+ "\n",
312
+ "!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME} True"
313
+ ]
314
+ },
315
+ {
316
+ "cell_type": "code",
317
+ "execution_count": null,
318
+ "metadata": {
319
+ "id": "IMLPLKOaKj58"
320
+ },
321
+ "outputs": [],
322
+ "source": [
323
+ "# @title 手动训练(不推荐)\n",
324
+ "# @markdown 模型名\n",
325
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
326
+ "# @markdown 使用的GPU\n",
327
+ "USEGPU = \"0\" # @param {type:\"string\"}\n",
328
+ "# @markdown 批大小\n",
329
+ "BATCHSIZE = 32 # @param {type:\"integer\"}\n",
330
+ "# @markdown 停止的epoch\n",
331
+ "MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
332
+ "# @markdown 保存epoch间隔\n",
333
+ "EPOCHSAVE = 100 # @param {type:\"integer\"}\n",
334
+ "# @markdown 采样率\n",
335
+ "MODELSAMPLE = \"48k\" # @param {type:\"string\"}\n",
336
+ "# @markdown 是否缓存训练集\n",
337
+ "CACHEDATA = 1 # @param {type:\"integer\"}\n",
338
+ "# @markdown 是否仅保存最新的ckpt文件\n",
339
+ "ONLYLATEST = 0 # @param {type:\"integer\"}\n",
340
+ "\n",
341
+ "!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}"
342
+ ]
343
+ },
344
+ {
345
+ "cell_type": "code",
346
+ "execution_count": null,
347
+ "metadata": {
348
+ "id": "haYA81hySuDl"
349
+ },
350
+ "outputs": [],
351
+ "source": [
352
+ "# @title 删除其它pth,只留选中的(慎点,仔细看代码)\n",
353
+ "# @markdown 模型名\n",
354
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
355
+ "# @markdown 选中模型epoch\n",
356
+ "MODELEPOCH = 9600 # @param {type:\"integer\"}\n",
357
+ "\n",
358
+ "!echo \"备份选中的模型。。。\"\n",
359
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
360
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
361
+ "\n",
362
+ "!echo \"正在删除。。。\"\n",
363
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
364
+ "!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
365
+ "\n",
366
+ "!echo \"恢复选中的模型。。。\"\n",
367
+ "!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
368
+ "!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
369
+ "\n",
370
+ "!echo \"删除完成\"\n",
371
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
372
+ ]
373
+ },
374
+ {
375
+ "cell_type": "code",
376
+ "execution_count": null,
377
+ "metadata": {
378
+ "id": "QhSiPTVPoIRh"
379
+ },
380
+ "outputs": [],
381
+ "source": [
382
+ "# @title 清除项目下所有文件,只留选中的模型(慎点,仔细看代码)\n",
383
+ "# @markdown 模型名\n",
384
+ "MODELNAME = \"lulu\" # @param {type:\"string\"}\n",
385
+ "# @markdown 选中模型epoch\n",
386
+ "MODELEPOCH = 9600 # @param {type:\"integer\"}\n",
387
+ "\n",
388
+ "!echo \"备份选中的模型。。。\"\n",
389
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
390
+ "!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
391
+ "\n",
392
+ "!echo \"正在删除。。。\"\n",
393
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
394
+ "!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
395
+ "\n",
396
+ "!echo \"恢复选中的模型。。。\"\n",
397
+ "!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
398
+ "!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
399
+ "\n",
400
+ "!echo \"删除完成\"\n",
401
+ "!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
402
+ ]
403
+ }
404
+ ],
405
+ "metadata": {
406
+ "accelerator": "GPU",
407
+ "colab": {
408
+ "private_outputs": true,
409
+ "provenance": []
410
+ },
411
+ "gpuClass": "standard",
412
+ "kernelspec": {
413
+ "display_name": "Python 3",
414
+ "name": "python3"
415
+ },
416
+ "language_info": {
417
+ "name": "python"
418
+ }
419
+ },
420
+ "nbformat": 4,
421
+ "nbformat_minor": 0
422
+ }
RVC/api_231006.py ADDED
@@ -0,0 +1,440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #api for 231006 release version by Xiaokai
2
+ import os
3
+ import sys
4
+ import json
5
+ import re
6
+ import time
7
+ import librosa
8
+ import torch
9
+ import numpy as np
10
+ import torch.nn.functional as F
11
+ import torchaudio.transforms as tat
12
+ import sounddevice as sd
13
+ from dotenv import load_dotenv
14
+ from fastapi import FastAPI, HTTPException
15
+ from pydantic import BaseModel
16
+ import threading
17
+ import uvicorn
18
+ import logging
19
+
20
+ # Initialize the logger
21
+ logging.basicConfig(level=logging.INFO)
22
+ logger = logging.getLogger(__name__)
23
+
24
+ # Define FastAPI app
25
+ app = FastAPI()
26
+
27
+ class GUIConfig:
28
+ def __init__(self) -> None:
29
+ self.pth_path: str = ""
30
+ self.index_path: str = ""
31
+ self.pitch: int = 0
32
+ self.samplerate: int = 40000
33
+ self.block_time: float = 1.0 # s
34
+ self.buffer_num: int = 1
35
+ self.threhold: int = -60
36
+ self.crossfade_time: float = 0.05
37
+ self.extra_time: float = 2.5
38
+ self.I_noise_reduce = False
39
+ self.O_noise_reduce = False
40
+ self.rms_mix_rate = 0.0
41
+ self.index_rate = 0.3
42
+ self.f0method = "rmvpe"
43
+ self.sg_input_device = ""
44
+ self.sg_output_device = ""
45
+
46
+ class ConfigData(BaseModel):
47
+ pth_path: str
48
+ index_path: str
49
+ sg_input_device: str
50
+ sg_output_device: str
51
+ threhold: int = -60
52
+ pitch: int = 0
53
+ index_rate: float = 0.3
54
+ rms_mix_rate: float = 0.0
55
+ block_time: float = 0.25
56
+ crossfade_length: float = 0.05
57
+ extra_time: float = 2.5
58
+ n_cpu: int = 4
59
+ I_noise_reduce: bool = False
60
+ O_noise_reduce: bool = False
61
+
62
+ class AudioAPI:
63
+ def __init__(self) -> None:
64
+ self.gui_config = GUIConfig()
65
+ self.config = None # Initialize Config object as None
66
+ self.flag_vc = False
67
+ self.function = "vc"
68
+ self.delay_time = 0
69
+ self.rvc = None # Initialize RVC object as None
70
+
71
+ def load(self):
72
+ input_devices, output_devices, _, _ = self.get_devices()
73
+ try:
74
+ with open("configs/config.json", "r", encoding='utf-8') as j:
75
+ data = json.load(j)
76
+ data["rmvpe"] = True # Ensure rmvpe is the only f0method
77
+ if data["sg_input_device"] not in input_devices:
78
+ data["sg_input_device"] = input_devices[sd.default.device[0]]
79
+ if data["sg_output_device"] not in output_devices:
80
+ data["sg_output_device"] = output_devices[sd.default.device[1]]
81
+ except Exception as e:
82
+ logger.error(f"Failed to load configuration: {e}")
83
+ with open("configs/config.json", "w", encoding='utf-8') as j:
84
+ data = {
85
+ "pth_path": " ",
86
+ "index_path": " ",
87
+ "sg_input_device": input_devices[sd.default.device[0]],
88
+ "sg_output_device": output_devices[sd.default.device[1]],
89
+ "threhold": "-60",
90
+ "pitch": "0",
91
+ "index_rate": "0",
92
+ "rms_mix_rate": "0",
93
+ "block_time": "0.25",
94
+ "crossfade_length": "0.05",
95
+ "extra_time": "2.5",
96
+ "f0method": "rmvpe",
97
+ "use_jit": False,
98
+ }
99
+ data["rmvpe"] = True # Ensure rmvpe is the only f0method
100
+ json.dump(data, j, ensure_ascii=False)
101
+ return data
102
+
103
+ def set_values(self, values):
104
+ logger.info(f"Setting values: {values}")
105
+ if not values.pth_path.strip():
106
+ raise HTTPException(status_code=400, detail="Please select a .pth file")
107
+ if not values.index_path.strip():
108
+ raise HTTPException(status_code=400, detail="Please select an index file")
109
+ self.set_devices(values.sg_input_device, values.sg_output_device)
110
+ self.config.use_jit = False
111
+ self.gui_config.pth_path = values.pth_path
112
+ self.gui_config.index_path = values.index_path
113
+ self.gui_config.threhold = values.threhold
114
+ self.gui_config.pitch = values.pitch
115
+ self.gui_config.block_time = values.block_time
116
+ self.gui_config.crossfade_time = values.crossfade_length
117
+ self.gui_config.extra_time = values.extra_time
118
+ self.gui_config.I_noise_reduce = values.I_noise_reduce
119
+ self.gui_config.O_noise_reduce = values.O_noise_reduce
120
+ self.gui_config.rms_mix_rate = values.rms_mix_rate
121
+ self.gui_config.index_rate = values.index_rate
122
+ self.gui_config.n_cpu = values.n_cpu
123
+ self.gui_config.f0method = "rmvpe"
124
+ return True
125
+
126
+ def start_vc(self):
127
+ torch.cuda.empty_cache()
128
+ self.flag_vc = True
129
+ self.rvc = rvc_for_realtime.RVC(
130
+ self.gui_config.pitch,
131
+ self.gui_config.pth_path,
132
+ self.gui_config.index_path,
133
+ self.gui_config.index_rate,
134
+ 0,
135
+ 0,
136
+ 0,
137
+ self.config,
138
+ self.rvc if self.rvc else None,
139
+ )
140
+ self.gui_config.samplerate = self.rvc.tgt_sr
141
+ self.zc = self.rvc.tgt_sr // 100
142
+ self.block_frame = (
143
+ int(
144
+ np.round(
145
+ self.gui_config.block_time
146
+ * self.gui_config.samplerate
147
+ / self.zc
148
+ )
149
+ )
150
+ * self.zc
151
+ )
152
+ self.block_frame_16k = 160 * self.block_frame // self.zc
153
+ self.crossfade_frame = (
154
+ int(
155
+ np.round(
156
+ self.gui_config.crossfade_time
157
+ * self.gui_config.samplerate
158
+ / self.zc
159
+ )
160
+ )
161
+ * self.zc
162
+ )
163
+ self.sola_search_frame = self.zc
164
+ self.extra_frame = (
165
+ int(
166
+ np.round(
167
+ self.gui_config.extra_time
168
+ * self.gui_config.samplerate
169
+ / self.zc
170
+ )
171
+ )
172
+ * self.zc
173
+ )
174
+ self.input_wav = torch.zeros(
175
+ self.extra_frame + self.crossfade_frame + self.sola_search_frame + self.block_frame,
176
+ device=self.config.device,
177
+ dtype=torch.float32,
178
+ )
179
+ self.input_wav_res = torch.zeros(
180
+ 160 * self.input_wav.shape[0] // self.zc,
181
+ device=self.config.device,
182
+ dtype=torch.float32,
183
+ )
184
+ self.pitch = np.zeros(self.input_wav.shape[0] // self.zc, dtype="int32")
185
+ self.pitchf = np.zeros(self.input_wav.shape[0] // self.zc, dtype="float64")
186
+ self.sola_buffer = torch.zeros(self.crossfade_frame, device=self.config.device, dtype=torch.float32)
187
+ self.nr_buffer = self.sola_buffer.clone()
188
+ self.output_buffer = self.input_wav.clone()
189
+ self.res_buffer = torch.zeros(2 * self.zc, device=self.config.device, dtype=torch.float32)
190
+ self.valid_rate = 1 - (self.extra_frame - 1) / self.input_wav.shape[0]
191
+ self.fade_in_window = (
192
+ torch.sin(0.5 * np.pi * torch.linspace(0.0, 1.0, steps=self.crossfade_frame, device=self.config.device, dtype=torch.float32)) ** 2
193
+ )
194
+ self.fade_out_window = 1 - self.fade_in_window
195
+ self.resampler = tat.Resample(
196
+ orig_freq=self.gui_config.samplerate,
197
+ new_freq=16000,
198
+ dtype=torch.float32,
199
+ ).to(self.config.device)
200
+ self.tg = TorchGate(
201
+ sr=self.gui_config.samplerate, n_fft=4 * self.zc, prop_decrease=0.9
202
+ ).to(self.config.device)
203
+ thread_vc = threading.Thread(target=self.soundinput)
204
+ thread_vc.start()
205
+
206
+ def soundinput(self):
207
+ channels = 1 if sys.platform == "darwin" else 2
208
+ with sd.Stream(
209
+ channels=channels,
210
+ callback=self.audio_callback,
211
+ blocksize=self.block_frame,
212
+ samplerate=self.gui_config.samplerate,
213
+ dtype="float32",
214
+ ) as stream:
215
+ global stream_latency
216
+ stream_latency = stream.latency[-1]
217
+ while self.flag_vc:
218
+ time.sleep(self.gui_config.block_time)
219
+ logger.info("Audio block passed.")
220
+ logger.info("Ending VC")
221
+
222
+ def audio_callback(self, indata: np.ndarray, outdata: np.ndarray, frames, times, status):
223
+ start_time = time.perf_counter()
224
+ indata = librosa.to_mono(indata.T)
225
+ if self.gui_config.threhold > -60:
226
+ rms = librosa.feature.rms(y=indata, frame_length=4 * self.zc, hop_length=self.zc)
227
+ db_threhold = (librosa.amplitude_to_db(rms, ref=1.0)[0] < self.gui_config.threhold)
228
+ for i in range(db_threhold.shape[0]):
229
+ if db_threhold[i]:
230
+ indata[i * self.zc : (i + 1) * self.zc] = 0
231
+ self.input_wav[: -self.block_frame] = self.input_wav[self.block_frame :].clone()
232
+ self.input_wav[-self.block_frame :] = torch.from_numpy(indata).to(self.config.device)
233
+ self.input_wav_res[: -self.block_frame_16k] = self.input_wav_res[self.block_frame_16k :].clone()
234
+ if self.gui_config.I_noise_reduce and self.function == "vc":
235
+ input_wav = self.input_wav[-self.crossfade_frame - self.block_frame - 2 * self.zc :]
236
+ input_wav = self.tg(input_wav.unsqueeze(0), self.input_wav.unsqueeze(0))[0, 2 * self.zc :]
237
+ input_wav[: self.crossfade_frame] *= self.fade_in_window
238
+ input_wav[: self.crossfade_frame] += self.nr_buffer * self.fade_out_window
239
+ self.nr_buffer[:] = input_wav[-self.crossfade_frame :]
240
+ input_wav = torch.cat((self.res_buffer[:], input_wav[: self.block_frame]))
241
+ self.res_buffer[:] = input_wav[-2 * self.zc :]
242
+ self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(input_wav)[160:]
243
+ else:
244
+ self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(self.input_wav[-self.block_frame - 2 * self.zc :])[160:]
245
+ if self.function == "vc":
246
+ f0_extractor_frame = self.block_frame_16k + 800
247
+ if self.gui_config.f0method == "rmvpe":
248
+ f0_extractor_frame = (5120 * ((f0_extractor_frame - 1) // 5120 + 1) - 160)
249
+ infer_wav = self.rvc.infer(
250
+ self.input_wav_res,
251
+ self.input_wav_res[-f0_extractor_frame:].cpu().numpy(),
252
+ self.block_frame_16k,
253
+ self.valid_rate,
254
+ self.pitch,
255
+ self.pitchf,
256
+ self.gui_config.f0method,
257
+ )
258
+ infer_wav = infer_wav[-self.crossfade_frame - self.sola_search_frame - self.block_frame :]
259
+ else:
260
+ infer_wav = self.input_wav[-self.crossfade_frame - self.sola_search_frame - self.block_frame :].clone()
261
+ if (self.gui_config.O_noise_reduce and self.function == "vc") or (self.gui_config.I_noise_reduce and self.function == "im"):
262
+ self.output_buffer[: -self.block_frame] = self.output_buffer[self.block_frame :].clone()
263
+ self.output_buffer[-self.block_frame :] = infer_wav[-self.block_frame :]
264
+ infer_wav = self.tg(infer_wav.unsqueeze(0), self.output_buffer.unsqueeze(0)).squeeze(0)
265
+ if self.gui_config.rms_mix_rate < 1 and self.function == "vc":
266
+ rms1 = librosa.feature.rms(y=self.input_wav_res[-160 * infer_wav.shape[0] // self.zc :].cpu().numpy(), frame_length=640, hop_length=160)
267
+ rms1 = torch.from_numpy(rms1).to(self.config.device)
268
+ rms1 = F.interpolate(rms1.unsqueeze(0), size=infer_wav.shape[0] + 1, mode="linear", align_corners=True)[0, 0, :-1]
269
+ rms2 = librosa.feature.rms(y=infer_wav[:].cpu().numpy(), frame_length=4 * self.zc, hop_length=self.zc)
270
+ rms2 = torch.from_numpy(rms2).to(self.config.device)
271
+ rms2 = F.interpolate(rms2.unsqueeze(0), size=infer_wav.shape[0] + 1, mode="linear", align_corners=True)[0, 0, :-1]
272
+ rms2 = torch.max(rms2, torch.zeros_like(rms2) + 1e-3)
273
+ infer_wav *= torch.pow(rms1 / rms2, torch.tensor(1 - self.gui_config.rms_mix_rate))
274
+ conv_input = infer_wav[None, None, : self.crossfade_frame + self.sola_search_frame]
275
+ cor_nom = F.conv1d(conv_input, self.sola_buffer[None, None, :])
276
+ cor_den = torch.sqrt(F.conv1d(conv_input**2, torch.ones(1, 1, self.crossfade_frame, device=self.config.device)) + 1e-8)
277
+ if sys.platform == "darwin":
278
+ _, sola_offset = torch.max(cor_nom[0, 0] / cor_den[0, 0])
279
+ sola_offset = sola_offset.item()
280
+ else:
281
+ sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
282
+ logger.info(f"sola_offset = {sola_offset}")
283
+ infer_wav = infer_wav[sola_offset : sola_offset + self.block_frame + self.crossfade_frame]
284
+ infer_wav[: self.crossfade_frame] *= self.fade_in_window
285
+ infer_wav[: self.crossfade_frame] += self.sola_buffer * self.fade_out_window
286
+ self.sola_buffer[:] = infer_wav[-self.crossfade_frame :]
287
+ if sys.platform == "darwin":
288
+ outdata[:] = infer_wav[: -self.crossfade_frame].cpu().numpy()[:, np.newaxis]
289
+ else:
290
+ outdata[:] = infer_wav[: -self.crossfade_frame].repeat(2, 1).t().cpu().numpy()
291
+ total_time = time.perf_counter() - start_time
292
+ logger.info(f"Infer time: {total_time:.2f}")
293
+
294
+ def get_devices(self, update: bool = True):
295
+ if update:
296
+ sd._terminate()
297
+ sd._initialize()
298
+ devices = sd.query_devices()
299
+ hostapis = sd.query_hostapis()
300
+ for hostapi in hostapis:
301
+ for device_idx in hostapi["devices"]:
302
+ devices[device_idx]["hostapi_name"] = hostapi["name"]
303
+ input_devices = [
304
+ f"{d['name']} ({d['hostapi_name']})"
305
+ for d in devices
306
+ if d["max_input_channels"] > 0
307
+ ]
308
+ output_devices = [
309
+ f"{d['name']} ({d['hostapi_name']})"
310
+ for d in devices
311
+ if d["max_output_channels"] > 0
312
+ ]
313
+ input_devices_indices = [
314
+ d["index"] if "index" in d else d["name"]
315
+ for d in devices
316
+ if d["max_input_channels"] > 0
317
+ ]
318
+ output_devices_indices = [
319
+ d["index"] if "index" in d else d["name"]
320
+ for d in devices
321
+ if d["max_output_channels"] > 0
322
+ ]
323
+ return (
324
+ input_devices,
325
+ output_devices,
326
+ input_devices_indices,
327
+ output_devices_indices,
328
+ )
329
+
330
+ def set_devices(self, input_device, output_device):
331
+ (
332
+ input_devices,
333
+ output_devices,
334
+ input_device_indices,
335
+ output_device_indices,
336
+ ) = self.get_devices()
337
+ logger.debug(f"Available input devices: {input_devices}")
338
+ logger.debug(f"Available output devices: {output_devices}")
339
+ logger.debug(f"Selected input device: {input_device}")
340
+ logger.debug(f"Selected output device: {output_device}")
341
+
342
+ if input_device not in input_devices:
343
+ logger.error(f"Input device '{input_device}' is not in the list of available devices")
344
+ raise HTTPException(status_code=400, detail=f"Input device '{input_device}' is not available")
345
+
346
+ if output_device not in output_devices:
347
+ logger.error(f"Output device '{output_device}' is not in the list of available devices")
348
+ raise HTTPException(status_code=400, detail=f"Output device '{output_device}' is not available")
349
+
350
+ sd.default.device[0] = input_device_indices[input_devices.index(input_device)]
351
+ sd.default.device[1] = output_device_indices[output_devices.index(output_device)]
352
+ logger.info(f"Input device set to {sd.default.device[0]}: {input_device}")
353
+ logger.info(f"Output device set to {sd.default.device[1]}: {output_device}")
354
+
355
+ audio_api = AudioAPI()
356
+
357
+ @app.get("/inputDevices", response_model=list)
358
+ def get_input_devices():
359
+ try:
360
+ input_devices, _, _, _ = audio_api.get_devices()
361
+ return input_devices
362
+ except Exception as e:
363
+ logger.error(f"Failed to get input devices: {e}")
364
+ raise HTTPException(status_code=500, detail="Failed to get input devices")
365
+
366
+ @app.get("/outputDevices", response_model=list)
367
+ def get_output_devices():
368
+ try:
369
+ _, output_devices, _, _ = audio_api.get_devices()
370
+ return output_devices
371
+ except Exception as e:
372
+ logger.error(f"Failed to get output devices: {e}")
373
+ raise HTTPException(status_code=500, detail="Failed to get output devices")
374
+
375
+ @app.post("/config")
376
+ def configure_audio(config_data: ConfigData):
377
+ try:
378
+ logger.info(f"Configuring audio with data: {config_data}")
379
+ if audio_api.set_values(config_data):
380
+ settings = config_data.dict()
381
+ settings["use_jit"] = False
382
+ settings["f0method"] = "rmvpe"
383
+ with open("configs/config.json", "w", encoding='utf-8') as j:
384
+ json.dump(settings, j, ensure_ascii=False)
385
+ logger.info("Configuration set successfully")
386
+ return {"message": "Configuration set successfully"}
387
+ except HTTPException as e:
388
+ logger.error(f"Configuration error: {e.detail}")
389
+ raise
390
+ except Exception as e:
391
+ logger.error(f"Configuration failed: {e}")
392
+ raise HTTPException(status_code=400, detail=f"Configuration failed: {e}")
393
+
394
+ @app.post("/start")
395
+ def start_conversion():
396
+ try:
397
+ if not audio_api.flag_vc:
398
+ audio_api.start_vc()
399
+ return {"message": "Audio conversion started"}
400
+ else:
401
+ logger.warning("Audio conversion already running")
402
+ raise HTTPException(status_code=400, detail="Audio conversion already running")
403
+ except HTTPException as e:
404
+ logger.error(f"Start conversion error: {e.detail}")
405
+ raise
406
+ except Exception as e:
407
+ logger.error(f"Failed to start conversion: {e}")
408
+ raise HTTPException(status_code=500, detail=f"Failed to start conversion: {e}")
409
+
410
+ @app.post("/stop")
411
+ def stop_conversion():
412
+ try:
413
+ if audio_api.flag_vc:
414
+ audio_api.flag_vc = False
415
+ global stream_latency
416
+ stream_latency = -1
417
+ return {"message": "Audio conversion stopped"}
418
+ else:
419
+ logger.warning("Audio conversion not running")
420
+ raise HTTPException(status_code=400, detail="Audio conversion not running")
421
+ except HTTPException as e:
422
+ logger.error(f"Stop conversion error: {e.detail}")
423
+ raise
424
+ except Exception as e:
425
+ logger.error(f"Failed to stop conversion: {e}")
426
+ raise HTTPException(status_code=500, detail=f"Failed to stop conversion: {e}")
427
+
428
+ if __name__ == "__main__":
429
+ if sys.platform == "win32":
430
+ from multiprocessing import freeze_support
431
+ freeze_support()
432
+ load_dotenv()
433
+ os.environ["OMP_NUM_THREADS"] = "4"
434
+ if sys.platform == "darwin":
435
+ os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
436
+ from tools.torchgate import TorchGate
437
+ import tools.rvc_for_realtime as rvc_for_realtime
438
+ from configs.config import Config
439
+ audio_api.config = Config()
440
+ uvicorn.run(app, host="0.0.0.0", port=6242)
RVC/api_240604.py ADDED
@@ -0,0 +1,565 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #api for 240604 release version by Xiaokai
2
+ import os
3
+ import sys
4
+ import json
5
+ import re
6
+ import time
7
+ import librosa
8
+ import torch
9
+ import numpy as np
10
+ import torch.nn.functional as F
11
+ import torchaudio.transforms as tat
12
+ import sounddevice as sd
13
+ from dotenv import load_dotenv
14
+ from fastapi import FastAPI, HTTPException
15
+ from pydantic import BaseModel
16
+ import threading
17
+ import uvicorn
18
+ import logging
19
+ from multiprocessing import Queue, Process, cpu_count, freeze_support
20
+
21
+ # Initialize the logger
22
+ logging.basicConfig(level=logging.INFO)
23
+ logger = logging.getLogger(__name__)
24
+
25
+ # Define FastAPI app
26
+ app = FastAPI()
27
+
28
+ class GUIConfig:
29
+ def __init__(self) -> None:
30
+ self.pth_path: str = ""
31
+ self.index_path: str = ""
32
+ self.pitch: int = 0
33
+ self.formant: float = 0.0
34
+ self.sr_type: str = "sr_model"
35
+ self.block_time: float = 0.25 # s
36
+ self.threhold: int = -60
37
+ self.crossfade_time: float = 0.05
38
+ self.extra_time: float = 2.5
39
+ self.I_noise_reduce: bool = False
40
+ self.O_noise_reduce: bool = False
41
+ self.use_pv: bool = False
42
+ self.rms_mix_rate: float = 0.0
43
+ self.index_rate: float = 0.0
44
+ self.n_cpu: int = 4
45
+ self.f0method: str = "fcpe"
46
+ self.sg_input_device: str = ""
47
+ self.sg_output_device: str = ""
48
+
49
+ class ConfigData(BaseModel):
50
+ pth_path: str
51
+ index_path: str
52
+ sg_input_device: str
53
+ sg_output_device: str
54
+ threhold: int = -60
55
+ pitch: int = 0
56
+ formant: float = 0.0
57
+ index_rate: float = 0.3
58
+ rms_mix_rate: float = 0.0
59
+ block_time: float = 0.25
60
+ crossfade_length: float = 0.05
61
+ extra_time: float = 2.5
62
+ n_cpu: int = 4
63
+ I_noise_reduce: bool = False
64
+ O_noise_reduce: bool = False
65
+ use_pv: bool = False
66
+ f0method: str = "fcpe"
67
+
68
+ class Harvest(Process):
69
+ def __init__(self, inp_q, opt_q):
70
+ super(Harvest, self).__init__()
71
+ self.inp_q = inp_q
72
+ self.opt_q = opt_q
73
+
74
+ def run(self):
75
+ import numpy as np
76
+ import pyworld
77
+ while True:
78
+ idx, x, res_f0, n_cpu, ts = self.inp_q.get()
79
+ f0, t = pyworld.harvest(
80
+ x.astype(np.double),
81
+ fs=16000,
82
+ f0_ceil=1100,
83
+ f0_floor=50,
84
+ frame_period=10,
85
+ )
86
+ res_f0[idx] = f0
87
+ if len(res_f0.keys()) >= n_cpu:
88
+ self.opt_q.put(ts)
89
+
90
+ class AudioAPI:
91
+ def __init__(self) -> None:
92
+ self.gui_config = GUIConfig()
93
+ self.config = None # Initialize Config object as None
94
+ self.flag_vc = False
95
+ self.function = "vc"
96
+ self.delay_time = 0
97
+ self.rvc = None # Initialize RVC object as None
98
+ self.inp_q = None
99
+ self.opt_q = None
100
+ self.n_cpu = min(cpu_count(), 8)
101
+
102
+ def initialize_queues(self):
103
+ self.inp_q = Queue()
104
+ self.opt_q = Queue()
105
+ for _ in range(self.n_cpu):
106
+ p = Harvest(self.inp_q, self.opt_q)
107
+ p.daemon = True
108
+ p.start()
109
+
110
+ def load(self):
111
+ input_devices, output_devices, _, _ = self.get_devices()
112
+ try:
113
+ with open("configs/config.json", "r", encoding='utf-8') as j:
114
+ data = json.load(j)
115
+ if data["sg_input_device"] not in input_devices:
116
+ data["sg_input_device"] = input_devices[sd.default.device[0]]
117
+ if data["sg_output_device"] not in output_devices:
118
+ data["sg_output_device"] = output_devices[sd.default.device[1]]
119
+ except Exception as e:
120
+ logger.error(f"Failed to load configuration: {e}")
121
+ with open("configs/config.json", "w", encoding='utf-8') as j:
122
+ data = {
123
+ "pth_path": "",
124
+ "index_path": "",
125
+ "sg_input_device": input_devices[sd.default.device[0]],
126
+ "sg_output_device": output_devices[sd.default.device[1]],
127
+ "threhold": -60,
128
+ "pitch": 0,
129
+ "formant": 0.0,
130
+ "index_rate": 0,
131
+ "rms_mix_rate": 0,
132
+ "block_time": 0.25,
133
+ "crossfade_length": 0.05,
134
+ "extra_time": 2.5,
135
+ "n_cpu": 4,
136
+ "f0method": "fcpe",
137
+ "use_jit": False,
138
+ "use_pv": False,
139
+ }
140
+ json.dump(data, j, ensure_ascii=False)
141
+ return data
142
+
143
+ def set_values(self, values):
144
+ logger.info(f"Setting values: {values}")
145
+ if not values.pth_path.strip():
146
+ raise HTTPException(status_code=400, detail="Please select a .pth file")
147
+ if not values.index_path.strip():
148
+ raise HTTPException(status_code=400, detail="Please select an index file")
149
+ self.set_devices(values.sg_input_device, values.sg_output_device)
150
+ self.config.use_jit = False
151
+ self.gui_config.pth_path = values.pth_path
152
+ self.gui_config.index_path = values.index_path
153
+ self.gui_config.threhold = values.threhold
154
+ self.gui_config.pitch = values.pitch
155
+ self.gui_config.formant = values.formant
156
+ self.gui_config.block_time = values.block_time
157
+ self.gui_config.crossfade_time = values.crossfade_length
158
+ self.gui_config.extra_time = values.extra_time
159
+ self.gui_config.I_noise_reduce = values.I_noise_reduce
160
+ self.gui_config.O_noise_reduce = values.O_noise_reduce
161
+ self.gui_config.rms_mix_rate = values.rms_mix_rate
162
+ self.gui_config.index_rate = values.index_rate
163
+ self.gui_config.n_cpu = values.n_cpu
164
+ self.gui_config.use_pv = values.use_pv
165
+ self.gui_config.f0method = values.f0method
166
+ return True
167
+
168
+ def start_vc(self):
169
+ torch.cuda.empty_cache()
170
+ self.flag_vc = True
171
+ self.rvc = rvc_for_realtime.RVC(
172
+ self.gui_config.pitch,
173
+ self.gui_config.pth_path,
174
+ self.gui_config.index_path,
175
+ self.gui_config.index_rate,
176
+ self.gui_config.n_cpu,
177
+ self.inp_q,
178
+ self.opt_q,
179
+ self.config,
180
+ self.rvc if self.rvc else None,
181
+ )
182
+ self.gui_config.samplerate = (
183
+ self.rvc.tgt_sr
184
+ if self.gui_config.sr_type == "sr_model"
185
+ else self.get_device_samplerate()
186
+ )
187
+ self.zc = self.gui_config.samplerate // 100
188
+ self.block_frame = (
189
+ int(
190
+ np.round(
191
+ self.gui_config.block_time
192
+ * self.gui_config.samplerate
193
+ / self.zc
194
+ )
195
+ )
196
+ * self.zc
197
+ )
198
+ self.block_frame_16k = 160 * self.block_frame // self.zc
199
+ self.crossfade_frame = (
200
+ int(
201
+ np.round(
202
+ self.gui_config.crossfade_time
203
+ * self.gui_config.samplerate
204
+ / self.zc
205
+ )
206
+ )
207
+ * self.zc
208
+ )
209
+ self.sola_buffer_frame = min(self.crossfade_frame, 4 * self.zc)
210
+ self.sola_search_frame = self.zc
211
+ self.extra_frame = (
212
+ int(
213
+ np.round(
214
+ self.gui_config.extra_time
215
+ * self.gui_config.samplerate
216
+ / self.zc
217
+ )
218
+ )
219
+ * self.zc
220
+ )
221
+ self.input_wav = torch.zeros(
222
+ self.extra_frame
223
+ + self.crossfade_frame
224
+ + self.sola_search_frame
225
+ + self.block_frame,
226
+ device=self.config.device,
227
+ dtype=torch.float32,
228
+ )
229
+ self.input_wav_denoise = self.input_wav.clone()
230
+ self.input_wav_res = torch.zeros(
231
+ 160 * self.input_wav.shape[0] // self.zc,
232
+ device=self.config.device,
233
+ dtype=torch.float32,
234
+ )
235
+ self.rms_buffer = np.zeros(4 * self.zc, dtype="float32")
236
+ self.sola_buffer = torch.zeros(
237
+ self.sola_buffer_frame, device=self.config.device, dtype=torch.float32
238
+ )
239
+ self.nr_buffer = self.sola_buffer.clone()
240
+ self.output_buffer = self.input_wav.clone()
241
+ self.skip_head = self.extra_frame // self.zc
242
+ self.return_length = (
243
+ self.block_frame + self.sola_buffer_frame + self.sola_search_frame
244
+ ) // self.zc
245
+ self.fade_in_window = (
246
+ torch.sin(
247
+ 0.5
248
+ * np.pi
249
+ * torch.linspace(
250
+ 0.0,
251
+ 1.0,
252
+ steps=self.sola_buffer_frame,
253
+ device=self.config.device,
254
+ dtype=torch.float32,
255
+ )
256
+ )
257
+ ** 2
258
+ )
259
+ self.fade_out_window = 1 - self.fade_in_window
260
+ self.resampler = tat.Resample(
261
+ orig_freq=self.gui_config.samplerate,
262
+ new_freq=16000,
263
+ dtype=torch.float32,
264
+ ).to(self.config.device)
265
+ if self.rvc.tgt_sr != self.gui_config.samplerate:
266
+ self.resampler2 = tat.Resample(
267
+ orig_freq=self.rvc.tgt_sr,
268
+ new_freq=self.gui_config.samplerate,
269
+ dtype=torch.float32,
270
+ ).to(self.config.device)
271
+ else:
272
+ self.resampler2 = None
273
+ self.tg = TorchGate(
274
+ sr=self.gui_config.samplerate, n_fft=4 * self.zc, prop_decrease=0.9
275
+ ).to(self.config.device)
276
+ thread_vc = threading.Thread(target=self.soundinput)
277
+ thread_vc.start()
278
+
279
+ def soundinput(self):
280
+ channels = 1 if sys.platform == "darwin" else 2
281
+ with sd.Stream(
282
+ channels=channels,
283
+ callback=self.audio_callback,
284
+ blocksize=self.block_frame,
285
+ samplerate=self.gui_config.samplerate,
286
+ dtype="float32",
287
+ ) as stream:
288
+ global stream_latency
289
+ stream_latency = stream.latency[-1]
290
+ while self.flag_vc:
291
+ time.sleep(self.gui_config.block_time)
292
+ logger.info("Audio block passed.")
293
+ logger.info("Ending VC")
294
+
295
+ def audio_callback(self, indata: np.ndarray, outdata: np.ndarray, frames, times, status):
296
+ start_time = time.perf_counter()
297
+ indata = librosa.to_mono(indata.T)
298
+ if self.gui_config.threhold > -60:
299
+ indata = np.append(self.rms_buffer, indata)
300
+ rms = librosa.feature.rms(y=indata, frame_length=4 * self.zc, hop_length=self.zc)[:, 2:]
301
+ self.rms_buffer[:] = indata[-4 * self.zc :]
302
+ indata = indata[2 * self.zc - self.zc // 2 :]
303
+ db_threhold = (
304
+ librosa.amplitude_to_db(rms, ref=1.0)[0] < self.gui_config.threhold
305
+ )
306
+ for i in range(db_threhold.shape[0]):
307
+ if db_threhold[i]:
308
+ indata[i * self.zc : (i + 1) * self.zc] = 0
309
+ indata = indata[self.zc // 2 :]
310
+ self.input_wav[: -self.block_frame] = self.input_wav[self.block_frame :].clone()
311
+ self.input_wav[-indata.shape[0] :] = torch.from_numpy(indata).to(self.config.device)
312
+ self.input_wav_res[: -self.block_frame_16k] = self.input_wav_res[self.block_frame_16k :].clone()
313
+ # input noise reduction and resampling
314
+ if self.gui_config.I_noise_reduce:
315
+ self.input_wav_denoise[: -self.block_frame] = self.input_wav_denoise[self.block_frame :].clone()
316
+ input_wav = self.input_wav[-self.sola_buffer_frame - self.block_frame :]
317
+ input_wav = self.tg(input_wav.unsqueeze(0), self.input_wav.unsqueeze(0)).squeeze(0)
318
+ input_wav[: self.sola_buffer_frame] *= self.fade_in_window
319
+ input_wav[: self.sola_buffer_frame] += self.nr_buffer * self.fade_out_window
320
+ self.input_wav_denoise[-self.block_frame :] = input_wav[: self.block_frame]
321
+ self.nr_buffer[:] = input_wav[self.block_frame :]
322
+ self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(
323
+ self.input_wav_denoise[-self.block_frame - 2 * self.zc :]
324
+ )[160:]
325
+ else:
326
+ self.input_wav_res[-160 * (indata.shape[0] // self.zc + 1) :] = (
327
+ self.resampler(self.input_wav[-indata.shape[0] - 2 * self.zc :])[160:]
328
+ )
329
+ # infer
330
+ if self.function == "vc":
331
+ infer_wav = self.rvc.infer(
332
+ self.input_wav_res,
333
+ self.block_frame_16k,
334
+ self.skip_head,
335
+ self.return_length,
336
+ self.gui_config.f0method,
337
+ )
338
+ if self.resampler2 is not None:
339
+ infer_wav = self.resampler2(infer_wav)
340
+ elif self.gui_config.I_noise_reduce:
341
+ infer_wav = self.input_wav_denoise[self.extra_frame :].clone()
342
+ else:
343
+ infer_wav = self.input_wav[self.extra_frame :].clone()
344
+ # output noise reduction
345
+ if self.gui_config.O_noise_reduce and self.function == "vc":
346
+ self.output_buffer[: -self.block_frame] = self.output_buffer[self.block_frame :].clone()
347
+ self.output_buffer[-self.block_frame :] = infer_wav[-self.block_frame :]
348
+ infer_wav = self.tg(infer_wav.unsqueeze(0), self.output_buffer.unsqueeze(0)).squeeze(0)
349
+ # volume envelop mixing
350
+ if self.gui_config.rms_mix_rate < 1 and self.function == "vc":
351
+ if self.gui_config.I_noise_reduce:
352
+ input_wav = self.input_wav_denoise[self.extra_frame :]
353
+ else:
354
+ input_wav = self.input_wav[self.extra_frame :]
355
+ rms1 = librosa.feature.rms(
356
+ y=input_wav[: infer_wav.shape[0]].cpu().numpy(),
357
+ frame_length=4 * self.zc,
358
+ hop_length=self.zc,
359
+ )
360
+ rms1 = torch.from_numpy(rms1).to(self.config.device)
361
+ rms1 = F.interpolate(
362
+ rms1.unsqueeze(0),
363
+ size=infer_wav.shape[0] + 1,
364
+ mode="linear",
365
+ align_corners=True,
366
+ )[0, 0, :-1]
367
+ rms2 = librosa.feature.rms(
368
+ y=infer_wav[:].cpu().numpy(),
369
+ frame_length=4 * self.zc,
370
+ hop_length=self.zc,
371
+ )
372
+ rms2 = torch.from_numpy(rms2).to(self.config.device)
373
+ rms2 = F.interpolate(
374
+ rms2.unsqueeze(0),
375
+ size=infer_wav.shape[0] + 1,
376
+ mode="linear",
377
+ align_corners=True,
378
+ )[0, 0, :-1]
379
+ rms2 = torch.max(rms2, torch.zeros_like(rms2) + 1e-3)
380
+ infer_wav *= torch.pow(
381
+ rms1 / rms2, torch.tensor(1 - self.gui_config.rms_mix_rate)
382
+ )
383
+ # SOLA algorithm from https://github.com/yxlllc/DDSP-SVC
384
+ conv_input = infer_wav[None, None, : self.sola_buffer_frame + self.sola_search_frame]
385
+ cor_nom = F.conv1d(conv_input, self.sola_buffer[None, None, :])
386
+ cor_den = torch.sqrt(
387
+ F.conv1d(
388
+ conv_input**2,
389
+ torch.ones(1, 1, self.sola_buffer_frame, device=self.config.device),
390
+ )
391
+ + 1e-8
392
+ )
393
+ if sys.platform == "darwin":
394
+ _, sola_offset = torch.max(cor_nom[0, 0] / cor_den[0, 0])
395
+ sola_offset = sola_offset.item()
396
+ else:
397
+ sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
398
+ logger.info(f"sola_offset = {sola_offset}")
399
+ infer_wav = infer_wav[sola_offset:]
400
+ if "privateuseone" in str(self.config.device) or not self.gui_config.use_pv:
401
+ infer_wav[: self.sola_buffer_frame] *= self.fade_in_window
402
+ infer_wav[: self.sola_buffer_frame] += self.sola_buffer * self.fade_out_window
403
+ else:
404
+ infer_wav[: self.sola_buffer_frame] = phase_vocoder(
405
+ self.sola_buffer,
406
+ infer_wav[: self.sola_buffer_frame],
407
+ self.fade_out_window,
408
+ self.fade_in_window,
409
+ )
410
+ self.sola_buffer[:] = infer_wav[
411
+ self.block_frame : self.block_frame + self.sola_buffer_frame
412
+ ]
413
+ if sys.platform == "darwin":
414
+ outdata[:] = infer_wav[: self.block_frame].cpu().numpy()[:, np.newaxis]
415
+ else:
416
+ outdata[:] = infer_wav[: self.block_frame].repeat(2, 1).t().cpu().numpy()
417
+ total_time = time.perf_counter() - start_time
418
+ logger.info(f"Infer time: {total_time:.2f}")
419
+
420
+ def get_devices(self, update: bool = True):
421
+ if update:
422
+ sd._terminate()
423
+ sd._initialize()
424
+ devices = sd.query_devices()
425
+ hostapis = sd.query_hostapis()
426
+ for hostapi in hostapis:
427
+ for device_idx in hostapi["devices"]:
428
+ devices[device_idx]["hostapi_name"] = hostapi["name"]
429
+ input_devices = [
430
+ f"{d['name']} ({d['hostapi_name']})"
431
+ for d in devices
432
+ if d["max_input_channels"] > 0
433
+ ]
434
+ output_devices = [
435
+ f"{d['name']} ({d['hostapi_name']})"
436
+ for d in devices
437
+ if d["max_output_channels"] > 0
438
+ ]
439
+ input_devices_indices = [
440
+ d["index"] if "index" in d else d["name"]
441
+ for d in devices
442
+ if d["max_input_channels"] > 0
443
+ ]
444
+ output_devices_indices = [
445
+ d["index"] if "index" in d else d["name"]
446
+ for d in devices
447
+ if d["max_output_channels"] > 0
448
+ ]
449
+ return (
450
+ input_devices,
451
+ output_devices,
452
+ input_devices_indices,
453
+ output_devices_indices,
454
+ )
455
+
456
+ def set_devices(self, input_device, output_device):
457
+ (
458
+ input_devices,
459
+ output_devices,
460
+ input_device_indices,
461
+ output_device_indices,
462
+ ) = self.get_devices()
463
+ logger.debug(f"Available input devices: {input_devices}")
464
+ logger.debug(f"Available output devices: {output_devices}")
465
+ logger.debug(f"Selected input device: {input_device}")
466
+ logger.debug(f"Selected output device: {output_device}")
467
+
468
+ if input_device not in input_devices:
469
+ logger.error(f"Input device '{input_device}' is not in the list of available devices")
470
+ raise HTTPException(status_code=400, detail=f"Input device '{input_device}' is not available")
471
+
472
+ if output_device not in output_devices:
473
+ logger.error(f"Output device '{output_device}' is not in the list of available devices")
474
+ raise HTTPException(status_code=400, detail=f"Output device '{output_device}' is not available")
475
+
476
+ sd.default.device[0] = input_device_indices[input_devices.index(input_device)]
477
+ sd.default.device[1] = output_device_indices[output_devices.index(output_device)]
478
+ logger.info(f"Input device set to {sd.default.device[0]}: {input_device}")
479
+ logger.info(f"Output device set to {sd.default.device[1]}: {output_device}")
480
+
481
+ audio_api = AudioAPI()
482
+
483
+ @app.get("/inputDevices", response_model=list)
484
+ def get_input_devices():
485
+ try:
486
+ input_devices, _, _, _ = audio_api.get_devices()
487
+ return input_devices
488
+ except Exception as e:
489
+ logger.error(f"Failed to get input devices: {e}")
490
+ raise HTTPException(status_code=500, detail="Failed to get input devices")
491
+
492
+ @app.get("/outputDevices", response_model=list)
493
+ def get_output_devices():
494
+ try:
495
+ _, output_devices, _, _ = audio_api.get_devices()
496
+ return output_devices
497
+ except Exception as e:
498
+ logger.error(f"Failed to get output devices: {e}")
499
+ raise HTTPException(status_code=500, detail="Failed to get output devices")
500
+
501
+ @app.post("/config")
502
+ def configure_audio(config_data: ConfigData):
503
+ try:
504
+ logger.info(f"Configuring audio with data: {config_data}")
505
+ if audio_api.set_values(config_data):
506
+ settings = config_data.dict()
507
+ settings["use_jit"] = False
508
+ with open("configs/config.json", "w", encoding='utf-8') as j:
509
+ json.dump(settings, j, ensure_ascii=False)
510
+ logger.info("Configuration set successfully")
511
+ return {"message": "Configuration set successfully"}
512
+ except HTTPException as e:
513
+ logger.error(f"Configuration error: {e.detail}")
514
+ raise
515
+ except Exception as e:
516
+ logger.error(f"Configuration failed: {e}")
517
+ raise HTTPException(status_code=400, detail=f"Configuration failed: {e}")
518
+
519
+ @app.post("/start")
520
+ def start_conversion():
521
+ try:
522
+ if not audio_api.flag_vc:
523
+ audio_api.start_vc()
524
+ return {"message": "Audio conversion started"}
525
+ else:
526
+ logger.warning("Audio conversion already running")
527
+ raise HTTPException(status_code=400, detail="Audio conversion already running")
528
+ except HTTPException as e:
529
+ logger.error(f"Start conversion error: {e.detail}")
530
+ raise
531
+ except Exception as e:
532
+ logger.error(f"Failed to start conversion: {e}")
533
+ raise HTTPException(status_code=500, detail="Failed to start conversion: {e}")
534
+
535
+ @app.post("/stop")
536
+ def stop_conversion():
537
+ try:
538
+ if audio_api.flag_vc:
539
+ audio_api.flag_vc = False
540
+ global stream_latency
541
+ stream_latency = -1
542
+ return {"message": "Audio conversion stopped"}
543
+ else:
544
+ logger.warning("Audio conversion not running")
545
+ raise HTTPException(status_code=400, detail="Audio conversion not running")
546
+ except HTTPException as e:
547
+ logger.error(f"Stop conversion error: {e.detail}")
548
+ raise
549
+ except Exception as e:
550
+ logger.error(f"Failed to stop conversion: {e}")
551
+ raise HTTPException(status_code=500, detail="Failed to stop conversion: {e}")
552
+
553
+ if __name__ == "__main__":
554
+ if sys.platform == "win32":
555
+ freeze_support()
556
+ load_dotenv()
557
+ os.environ["OMP_NUM_THREADS"] = "4"
558
+ if sys.platform == "darwin":
559
+ os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
560
+ from tools.torchgate import TorchGate
561
+ import tools.rvc_for_realtime as rvc_for_realtime
562
+ from configs.config import Config
563
+ audio_api.config = Config()
564
+ audio_api.initialize_queues()
565
+ uvicorn.run(app, host="0.0.0.0", port=6242)
RVC/assets/hubert/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *
2
+ !.gitignore
3
+ !hubert_inputs.pth
RVC/assets/hubert/hubert_inputs.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbd4741d4be8a71333170c0df5320f605a9d210b96547b391555da078167861f
3
+ size 169434
RVC/assets/indices/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/assets/pretrained/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/assets/pretrained_v2/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/assets/rmvpe/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ *
2
+ !.gitignore
3
+ !rmvpe_inputs.pth
RVC/assets/rmvpe/rmvpe_inputs.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:339fcb7e1476b302e9aecef4a951e918c20852b2e871de5eea13b06e554e0a3a
3
+ size 33527
RVC/assets/uvr5_weights/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/assets/weights/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/configs/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"pth_path": "assets/weights/kikiV1.pth", "index_path": "logs/kikiV1.index", "sg_hostapi": "MME", "sg_wasapi_exclusive": false, "sg_input_device": "VoiceMeeter Output (VB-Audio Vo", "sg_output_device": "VoiceMeeter Input (VB-Audio Voi", "sr_type": "sr_device", "threhold": -60.0, "pitch": 12.0, "formant": 0.0, "rms_mix_rate": 0.5, "index_rate": 0.0, "block_time": 0.15, "crossfade_length": 0.08, "extra_time": 2.0, "n_cpu": 4.0, "use_jit": false, "use_pv": false, "f0method": "fcpe"}
RVC/configs/config.py ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ import os
3
+ import sys
4
+ import json
5
+ import shutil
6
+ from multiprocessing import cpu_count
7
+
8
+ import torch
9
+
10
+ try:
11
+ import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
12
+
13
+ if torch.xpu.is_available():
14
+ from infer.modules.ipex import ipex_init
15
+
16
+ ipex_init()
17
+ except Exception: # pylint: disable=broad-exception-caught
18
+ pass
19
+ import logging
20
+
21
+ logger = logging.getLogger(__name__)
22
+
23
+
24
+ version_config_list = [
25
+ "v1/32k.json",
26
+ "v1/40k.json",
27
+ "v1/48k.json",
28
+ "v2/48k.json",
29
+ "v2/32k.json",
30
+ ]
31
+
32
+
33
+ def singleton_variable(func):
34
+ def wrapper(*args, **kwargs):
35
+ if not wrapper.instance:
36
+ wrapper.instance = func(*args, **kwargs)
37
+ return wrapper.instance
38
+
39
+ wrapper.instance = None
40
+ return wrapper
41
+
42
+
43
+ @singleton_variable
44
+ class Config:
45
+ def __init__(self):
46
+ self.device = "cuda:0"
47
+ self.is_half = True
48
+ self.use_jit = False
49
+ self.n_cpu = 0
50
+ self.gpu_name = None
51
+ self.json_config = self.load_config_json()
52
+ self.gpu_mem = None
53
+ (
54
+ self.python_cmd,
55
+ self.listen_port,
56
+ self.iscolab,
57
+ self.noparallel,
58
+ self.noautoopen,
59
+ self.dml,
60
+ ) = self.arg_parse()
61
+ self.instead = ""
62
+ self.preprocess_per = 3.7
63
+ self.x_pad, self.x_query, self.x_center, self.x_max = self.device_config()
64
+
65
+ @staticmethod
66
+ def load_config_json() -> dict:
67
+ d = {}
68
+ for config_file in version_config_list:
69
+ p = f"configs/inuse/{config_file}"
70
+ if not os.path.exists(p):
71
+ shutil.copy(f"configs/{config_file}", p)
72
+ with open(f"configs/inuse/{config_file}", "r") as f:
73
+ d[config_file] = json.load(f)
74
+ return d
75
+
76
+ @staticmethod
77
+ def arg_parse() -> tuple:
78
+ exe = sys.executable or "python"
79
+ parser = argparse.ArgumentParser()
80
+ parser.add_argument("--port", type=int, default=7865, help="Listen port")
81
+ parser.add_argument("--pycmd", type=str, default=exe, help="Python command")
82
+ parser.add_argument("--colab", action="store_true", help="Launch in colab")
83
+ parser.add_argument(
84
+ "--noparallel", action="store_true", help="Disable parallel processing"
85
+ )
86
+ parser.add_argument(
87
+ "--noautoopen",
88
+ action="store_true",
89
+ help="Do not open in browser automatically",
90
+ )
91
+ parser.add_argument(
92
+ "--dml",
93
+ action="store_true",
94
+ help="torch_dml",
95
+ )
96
+ cmd_opts = parser.parse_args()
97
+
98
+ cmd_opts.port = cmd_opts.port if 0 <= cmd_opts.port <= 65535 else 7865
99
+
100
+ return (
101
+ cmd_opts.pycmd,
102
+ cmd_opts.port,
103
+ cmd_opts.colab,
104
+ cmd_opts.noparallel,
105
+ cmd_opts.noautoopen,
106
+ cmd_opts.dml,
107
+ )
108
+
109
+ # has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
110
+ # check `getattr` and try it for compatibility
111
+ @staticmethod
112
+ def has_mps() -> bool:
113
+ if not torch.backends.mps.is_available():
114
+ return False
115
+ try:
116
+ torch.zeros(1).to(torch.device("mps"))
117
+ return True
118
+ except Exception:
119
+ return False
120
+
121
+ @staticmethod
122
+ def has_xpu() -> bool:
123
+ if hasattr(torch, "xpu") and torch.xpu.is_available():
124
+ return True
125
+ else:
126
+ return False
127
+
128
+ def use_fp32_config(self):
129
+ for config_file in version_config_list:
130
+ self.json_config[config_file]["train"]["fp16_run"] = False
131
+ with open(f"configs/inuse/{config_file}", "r") as f:
132
+ strr = f.read().replace("true", "false")
133
+ with open(f"configs/inuse/{config_file}", "w") as f:
134
+ f.write(strr)
135
+ logger.info("overwrite " + config_file)
136
+ self.preprocess_per = 3.0
137
+ logger.info("overwrite preprocess_per to %d" % (self.preprocess_per))
138
+
139
+ def device_config(self) -> tuple:
140
+ if torch.cuda.is_available():
141
+ if self.has_xpu():
142
+ self.device = self.instead = "xpu:0"
143
+ self.is_half = True
144
+ i_device = int(self.device.split(":")[-1])
145
+ self.gpu_name = torch.cuda.get_device_name(i_device)
146
+ if (
147
+ ("16" in self.gpu_name and "V100" not in self.gpu_name.upper())
148
+ or "P40" in self.gpu_name.upper()
149
+ or "P10" in self.gpu_name.upper()
150
+ or "1060" in self.gpu_name
151
+ or "1070" in self.gpu_name
152
+ or "1080" in self.gpu_name
153
+ ):
154
+ logger.info("Found GPU %s, force to fp32", self.gpu_name)
155
+ self.is_half = False
156
+ self.use_fp32_config()
157
+ else:
158
+ logger.info("Found GPU %s", self.gpu_name)
159
+ self.gpu_mem = int(
160
+ torch.cuda.get_device_properties(i_device).total_memory
161
+ / 1024
162
+ / 1024
163
+ / 1024
164
+ + 0.4
165
+ )
166
+ if self.gpu_mem <= 4:
167
+ self.preprocess_per = 3.0
168
+ elif self.has_mps():
169
+ logger.info("No supported Nvidia GPU found")
170
+ self.device = self.instead = "mps"
171
+ self.is_half = False
172
+ self.use_fp32_config()
173
+ else:
174
+ logger.info("No supported Nvidia GPU found")
175
+ self.device = self.instead = "cpu"
176
+ self.is_half = False
177
+ self.use_fp32_config()
178
+
179
+ if self.n_cpu == 0:
180
+ self.n_cpu = cpu_count()
181
+
182
+ if self.is_half:
183
+ # 6G显存配置
184
+ x_pad = 3
185
+ x_query = 10
186
+ x_center = 60
187
+ x_max = 65
188
+ else:
189
+ # 5G显存配置
190
+ x_pad = 1
191
+ x_query = 6
192
+ x_center = 38
193
+ x_max = 41
194
+
195
+ if self.gpu_mem is not None and self.gpu_mem <= 4:
196
+ x_pad = 1
197
+ x_query = 5
198
+ x_center = 30
199
+ x_max = 32
200
+ if self.dml:
201
+ logger.info("Use DirectML instead")
202
+ if (
203
+ os.path.exists(
204
+ "runtime\Lib\site-packages\onnxruntime\capi\DirectML.dll"
205
+ )
206
+ == False
207
+ ):
208
+ try:
209
+ os.rename(
210
+ "runtime\Lib\site-packages\onnxruntime",
211
+ "runtime\Lib\site-packages\onnxruntime-cuda",
212
+ )
213
+ except:
214
+ pass
215
+ try:
216
+ os.rename(
217
+ "runtime\Lib\site-packages\onnxruntime-dml",
218
+ "runtime\Lib\site-packages\onnxruntime",
219
+ )
220
+ except:
221
+ pass
222
+ # if self.device != "cpu":
223
+ import torch_directml
224
+
225
+ self.device = torch_directml.device(torch_directml.default_device())
226
+ self.is_half = False
227
+ else:
228
+ if self.instead:
229
+ logger.info(f"Use {self.instead} instead")
230
+ if (
231
+ os.path.exists(
232
+ "runtime\Lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"
233
+ )
234
+ == False
235
+ ):
236
+ try:
237
+ os.rename(
238
+ "runtime\Lib\site-packages\onnxruntime",
239
+ "runtime\Lib\site-packages\onnxruntime-dml",
240
+ )
241
+ except:
242
+ pass
243
+ try:
244
+ os.rename(
245
+ "runtime\Lib\site-packages\onnxruntime-cuda",
246
+ "runtime\Lib\site-packages\onnxruntime",
247
+ )
248
+ except:
249
+ pass
250
+ logger.info(
251
+ "Half-precision floating-point: %s, device: %s"
252
+ % (self.is_half, self.device)
253
+ )
254
+ return x_pad, x_query, x_center, x_max
RVC/configs/inuse/.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ *
2
+ !.gitignore
3
+ !v1
4
+ !v2
RVC/configs/inuse/v1/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/configs/inuse/v2/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *
2
+ !.gitignore
RVC/configs/v1/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
+ }
RVC/configs/v1/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
+ }
RVC/configs/v1/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
+ }
RVC/configs/v2/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,8,2,2],
40
+ "upsample_initial_channel": 512,
41
+ "upsample_kernel_sizes": [20,16,4,4],
42
+ "use_spectral_norm": false,
43
+ "gin_channels": 256,
44
+ "spk_embed_dim": 109
45
+ }
46
+ }
RVC/configs/v2/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": 17280,
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": [12,10,2,2],
40
+ "upsample_initial_channel": 512,
41
+ "upsample_kernel_sizes": [24,20,4,4],
42
+ "use_spectral_norm": false,
43
+ "gin_channels": 256,
44
+ "spk_embed_dim": 109
45
+ }
46
+ }
RVC/docker-compose.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.8"
2
+ services:
3
+ rvc:
4
+ build:
5
+ context: .
6
+ dockerfile: Dockerfile
7
+ container_name: rvc
8
+ volumes:
9
+ - ./weights:/app/assets/weights
10
+ - ./opt:/app/opt
11
+ # - ./dataset:/app/dataset # you can use this folder in order to provide your dataset for model training
12
+ ports:
13
+ - 7865:7865
14
+ deploy:
15
+ resources:
16
+ reservations:
17
+ devices:
18
+ - driver: nvidia
19
+ count: 1
20
+ capabilities: [gpu]
RVC/environment_dml.yaml ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: pydml
2
+ channels:
3
+ - pytorch
4
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
5
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
6
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
7
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
8
+ - defaults
9
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
10
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
11
+ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
12
+ dependencies:
13
+ - abseil-cpp=20211102.0=hd77b12b_0
14
+ - absl-py=1.3.0=py310haa95532_0
15
+ - aiohttp=3.8.3=py310h2bbff1b_0
16
+ - aiosignal=1.2.0=pyhd3eb1b0_0
17
+ - async-timeout=4.0.2=py310haa95532_0
18
+ - attrs=22.1.0=py310haa95532_0
19
+ - blas=1.0=mkl
20
+ - blinker=1.4=py310haa95532_0
21
+ - bottleneck=1.3.5=py310h9128911_0
22
+ - brotli=1.0.9=h2bbff1b_7
23
+ - brotli-bin=1.0.9=h2bbff1b_7
24
+ - brotlipy=0.7.0=py310h2bbff1b_1002
25
+ - bzip2=1.0.8=he774522_0
26
+ - c-ares=1.19.0=h2bbff1b_0
27
+ - ca-certificates=2023.05.30=haa95532_0
28
+ - cachetools=4.2.2=pyhd3eb1b0_0
29
+ - certifi=2023.5.7=py310haa95532_0
30
+ - cffi=1.15.1=py310h2bbff1b_3
31
+ - charset-normalizer=2.0.4=pyhd3eb1b0_0
32
+ - click=8.0.4=py310haa95532_0
33
+ - colorama=0.4.6=py310haa95532_0
34
+ - contourpy=1.0.5=py310h59b6b97_0
35
+ - cryptography=39.0.1=py310h21b164f_0
36
+ - cycler=0.11.0=pyhd3eb1b0_0
37
+ - fonttools=4.25.0=pyhd3eb1b0_0
38
+ - freetype=2.12.1=ha860e81_0
39
+ - frozenlist=1.3.3=py310h2bbff1b_0
40
+ - giflib=5.2.1=h8cc25b3_3
41
+ - glib=2.69.1=h5dc1a3c_2
42
+ - google-auth=2.6.0=pyhd3eb1b0_0
43
+ - google-auth-oauthlib=0.4.4=pyhd3eb1b0_0
44
+ - grpc-cpp=1.48.2=hf108199_0
45
+ - grpcio=1.48.2=py310hf108199_0
46
+ - gst-plugins-base=1.18.5=h9e645db_0
47
+ - gstreamer=1.18.5=hd78058f_0
48
+ - icu=58.2=ha925a31_3
49
+ - idna=3.4=py310haa95532_0
50
+ - intel-openmp=2023.1.0=h59b6b97_46319
51
+ - jpeg=9e=h2bbff1b_1
52
+ - kiwisolver=1.4.4=py310hd77b12b_0
53
+ - krb5=1.19.4=h5b6d351_0
54
+ - lerc=3.0=hd77b12b_0
55
+ - libbrotlicommon=1.0.9=h2bbff1b_7
56
+ - libbrotlidec=1.0.9=h2bbff1b_7
57
+ - libbrotlienc=1.0.9=h2bbff1b_7
58
+ - libclang=14.0.6=default_hb5a9fac_1
59
+ - libclang13=14.0.6=default_h8e68704_1
60
+ - libdeflate=1.17=h2bbff1b_0
61
+ - libffi=3.4.4=hd77b12b_0
62
+ - libiconv=1.16=h2bbff1b_2
63
+ - libogg=1.3.5=h2bbff1b_1
64
+ - libpng=1.6.39=h8cc25b3_0
65
+ - libprotobuf=3.20.3=h23ce68f_0
66
+ - libtiff=4.5.0=h6c2663c_2
67
+ - libuv=1.44.2=h2bbff1b_0
68
+ - libvorbis=1.3.7=he774522_0
69
+ - libwebp=1.2.4=hbc33d0d_1
70
+ - libwebp-base=1.2.4=h2bbff1b_1
71
+ - libxml2=2.10.3=h0ad7f3c_0
72
+ - libxslt=1.1.37=h2bbff1b_0
73
+ - lz4-c=1.9.4=h2bbff1b_0
74
+ - markdown=3.4.1=py310haa95532_0
75
+ - markupsafe=2.1.1=py310h2bbff1b_0
76
+ - matplotlib=3.7.1=py310haa95532_1
77
+ - matplotlib-base=3.7.1=py310h4ed8f06_1
78
+ - mkl=2023.1.0=h8bd8f75_46356
79
+ - mkl-service=2.4.0=py310h2bbff1b_1
80
+ - mkl_fft=1.3.6=py310h4ed8f06_1
81
+ - mkl_random=1.2.2=py310h4ed8f06_1
82
+ - multidict=6.0.2=py310h2bbff1b_0
83
+ - munkres=1.1.4=py_0
84
+ - numexpr=2.8.4=py310h2cd9be0_1
85
+ - numpy=1.24.3=py310h055cbcc_1
86
+ - numpy-base=1.24.3=py310h65a83cf_1
87
+ - oauthlib=3.2.2=py310haa95532_0
88
+ - openssl=1.1.1t=h2bbff1b_0
89
+ - packaging=23.0=py310haa95532_0
90
+ - pandas=1.5.3=py310h4ed8f06_0
91
+ - pcre=8.45=hd77b12b_0
92
+ - pillow=9.4.0=py310hd77b12b_0
93
+ - pip=23.0.1=py310haa95532_0
94
+ - ply=3.11=py310haa95532_0
95
+ - protobuf=3.20.3=py310hd77b12b_0
96
+ - pyasn1=0.4.8=pyhd3eb1b0_0
97
+ - pyasn1-modules=0.2.8=py_0
98
+ - pycparser=2.21=pyhd3eb1b0_0
99
+ - pyjwt=2.4.0=py310haa95532_0
100
+ - pyopenssl=23.0.0=py310haa95532_0
101
+ - pyparsing=3.0.9=py310haa95532_0
102
+ - pyqt=5.15.7=py310hd77b12b_0
103
+ - pyqt5-sip=12.11.0=py310hd77b12b_0
104
+ - pysocks=1.7.1=py310haa95532_0
105
+ - python=3.10.11=h966fe2a_2
106
+ - python-dateutil=2.8.2=pyhd3eb1b0_0
107
+ - pytorch-mutex=1.0=cpu
108
+ - pytz=2022.7=py310haa95532_0
109
+ - pyyaml=6.0=py310h2bbff1b_1
110
+ - qt-main=5.15.2=he8e5bd7_8
111
+ - qt-webengine=5.15.9=hb9a9bb5_5
112
+ - qtwebkit=5.212=h2bbfb41_5
113
+ - re2=2022.04.01=hd77b12b_0
114
+ - requests=2.29.0=py310haa95532_0
115
+ - requests-oauthlib=1.3.0=py_0
116
+ - rsa=4.7.2=pyhd3eb1b0_1
117
+ - setuptools=67.8.0=py310haa95532_0
118
+ - sip=6.6.2=py310hd77b12b_0
119
+ - six=1.16.0=pyhd3eb1b0_1
120
+ - sqlite=3.41.2=h2bbff1b_0
121
+ - tbb=2021.8.0=h59b6b97_0
122
+ - tensorboard=2.10.0=py310haa95532_0
123
+ - tensorboard-data-server=0.6.1=py310haa95532_0
124
+ - tensorboard-plugin-wit=1.8.1=py310haa95532_0
125
+ - tk=8.6.12=h2bbff1b_0
126
+ - toml=0.10.2=pyhd3eb1b0_0
127
+ - tornado=6.2=py310h2bbff1b_0
128
+ - tqdm=4.65.0=py310h9909e9c_0
129
+ - typing_extensions=4.5.0=py310haa95532_0
130
+ - tzdata=2023c=h04d1e81_0
131
+ - urllib3=1.26.16=py310haa95532_0
132
+ - vc=14.2=h21ff451_1
133
+ - vs2015_runtime=14.27.29016=h5e58377_2
134
+ - werkzeug=2.2.3=py310haa95532_0
135
+ - wheel=0.38.4=py310haa95532_0
136
+ - win_inet_pton=1.1.0=py310haa95532_0
137
+ - xz=5.4.2=h8cc25b3_0
138
+ - yaml=0.2.5=he774522_0
139
+ - yarl=1.8.1=py310h2bbff1b_0
140
+ - zlib=1.2.13=h8cc25b3_0
141
+ - zstd=1.5.5=hd43e919_0
142
+ - pip:
143
+ - antlr4-python3-runtime==4.8
144
+ - appdirs==1.4.4
145
+ - audioread==3.0.0
146
+ - bitarray==2.7.4
147
+ - cython==0.29.35
148
+ - decorator==5.1.1
149
+ - fairseq==0.12.2
150
+ - faiss-cpu==1.7.4
151
+ - filelock==3.12.0
152
+ - hydra-core==1.0.7
153
+ - jinja2==3.1.2
154
+ - joblib==1.2.0
155
+ - lazy-loader==0.2
156
+ - librosa==0.10.0.post2
157
+ - llvmlite==0.40.0
158
+ - lxml==4.9.2
159
+ - mpmath==1.3.0
160
+ - msgpack==1.0.5
161
+ - networkx==3.1
162
+ - noisereduce==2.0.1
163
+ - numba==0.57.0
164
+ - omegaconf==2.0.6
165
+ - opencv-python==4.7.0.72
166
+ - pooch==1.6.0
167
+ - portalocker==2.7.0
168
+ - pysimplegui==4.60.5
169
+ - pywin32==306
170
+ - pyworld==0.3.3
171
+ - regex==2023.5.5
172
+ - sacrebleu==2.3.1
173
+ - scikit-learn==1.2.2
174
+ - scipy==1.10.1
175
+ - sounddevice==0.4.6
176
+ - soundfile==0.12.1
177
+ - soxr==0.3.5
178
+ - sympy==1.12
179
+ - tabulate==0.9.0
180
+ - threadpoolctl==3.1.0
181
+ - torch==2.0.0
182
+ - torch-directml==0.2.0.dev230426
183
+ - torchaudio==2.0.1
184
+ - torchvision==0.15.1
185
+ - wget==3.2
186
+ prefix: D:\ProgramData\anaconda3_\envs\pydml
RVC/go-realtime-gui-dml.bat ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ runtime\python.exe gui_v1.py --pycmd runtime\python.exe --dml
2
+ pause
RVC/go-realtime-gui.bat ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ runtime\python.exe gui_v1.py
2
+ pause
RVC/go-web-dml.bat ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ runtime\python.exe infer-web.py --pycmd runtime\python.exe --port 7897 --dml
2
+ pause
RVC/go-web.bat ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ runtime\python.exe infer-web.py --pycmd runtime\python.exe --port 7897
2
+ pause
RVC/gui_v1.py ADDED
@@ -0,0 +1,1070 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ from dotenv import load_dotenv
4
+ import shutil
5
+
6
+ load_dotenv()
7
+
8
+ os.environ["OMP_NUM_THREADS"] = "4"
9
+ if sys.platform == "darwin":
10
+ os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
11
+
12
+ now_dir = os.getcwd()
13
+ sys.path.append(now_dir)
14
+ import multiprocessing
15
+
16
+ flag_vc = False
17
+
18
+
19
+ def printt(strr, *args):
20
+ if len(args) == 0:
21
+ print(strr)
22
+ else:
23
+ print(strr % args)
24
+
25
+
26
+ def phase_vocoder(a, b, fade_out, fade_in):
27
+ window = torch.sqrt(fade_out * fade_in)
28
+ fa = torch.fft.rfft(a * window)
29
+ fb = torch.fft.rfft(b * window)
30
+ absab = torch.abs(fa) + torch.abs(fb)
31
+ n = a.shape[0]
32
+ if n % 2 == 0:
33
+ absab[1:-1] *= 2
34
+ else:
35
+ absab[1:] *= 2
36
+ phia = torch.angle(fa)
37
+ phib = torch.angle(fb)
38
+ deltaphase = phib - phia
39
+ deltaphase = deltaphase - 2 * np.pi * torch.floor(deltaphase / 2 / np.pi + 0.5)
40
+ w = 2 * np.pi * torch.arange(n // 2 + 1).to(a) + deltaphase
41
+ t = torch.arange(n).unsqueeze(-1).to(a) / n
42
+ result = (
43
+ a * (fade_out**2)
44
+ + b * (fade_in**2)
45
+ + torch.sum(absab * torch.cos(w * t + phia), -1) * window / n
46
+ )
47
+ return result
48
+
49
+
50
+ class Harvest(multiprocessing.Process):
51
+ def __init__(self, inp_q, opt_q):
52
+ multiprocessing.Process.__init__(self)
53
+ self.inp_q = inp_q
54
+ self.opt_q = opt_q
55
+
56
+ def run(self):
57
+ import numpy as np
58
+ import pyworld
59
+
60
+ while 1:
61
+ idx, x, res_f0, n_cpu, ts = self.inp_q.get()
62
+ f0, t = pyworld.harvest(
63
+ x.astype(np.double),
64
+ fs=16000,
65
+ f0_ceil=1100,
66
+ f0_floor=50,
67
+ frame_period=10,
68
+ )
69
+ res_f0[idx] = f0
70
+ if len(res_f0.keys()) >= n_cpu:
71
+ self.opt_q.put(ts)
72
+
73
+
74
+ if __name__ == "__main__":
75
+ import json
76
+ import multiprocessing
77
+ import re
78
+ import threading
79
+ import time
80
+ import traceback
81
+ from multiprocessing import Queue, cpu_count
82
+ from queue import Empty
83
+
84
+ import librosa
85
+ from tools.torchgate import TorchGate
86
+ import numpy as np
87
+ import FreeSimpleGUI as sg
88
+ import sounddevice as sd
89
+ import torch
90
+ import torch.nn.functional as F
91
+ import torchaudio.transforms as tat
92
+
93
+ from infer.lib import rtrvc as rvc_for_realtime
94
+ from i18n.i18n import I18nAuto
95
+ from configs.config import Config
96
+
97
+ i18n = I18nAuto()
98
+
99
+ # device = rvc_for_realtime.config.device
100
+ # device = torch.device(
101
+ # "cuda"
102
+ # if torch.cuda.is_available()
103
+ # else ("mps" if torch.backends.mps.is_available() else "cpu")
104
+ # )
105
+ current_dir = os.getcwd()
106
+ inp_q = Queue()
107
+ opt_q = Queue()
108
+ n_cpu = min(cpu_count(), 8)
109
+ for _ in range(n_cpu):
110
+ p = Harvest(inp_q, opt_q)
111
+ p.daemon = True
112
+ p.start()
113
+
114
+ class GUIConfig:
115
+ def __init__(self) -> None:
116
+ self.pth_path: str = ""
117
+ self.index_path: str = ""
118
+ self.pitch: int = 0
119
+ self.formant=0.0
120
+ self.sr_type: str = "sr_model"
121
+ self.block_time: float = 0.25 # s
122
+ self.threhold: int = -60
123
+ self.crossfade_time: float = 0.05
124
+ self.extra_time: float = 2.5
125
+ self.I_noise_reduce: bool = False
126
+ self.O_noise_reduce: bool = False
127
+ self.use_pv: bool = False
128
+ self.rms_mix_rate: float = 0.0
129
+ self.index_rate: float = 0.0
130
+ self.n_cpu: int = min(n_cpu, 4)
131
+ self.f0method: str = "fcpe"
132
+ self.sg_hostapi: str = ""
133
+ self.wasapi_exclusive: bool = False
134
+ self.sg_input_device: str = ""
135
+ self.sg_output_device: str = ""
136
+
137
+ class GUI:
138
+ def __init__(self) -> None:
139
+ self.gui_config = GUIConfig()
140
+ self.config = Config()
141
+ self.function = "vc"
142
+ self.delay_time = 0
143
+ self.hostapis = None
144
+ self.input_devices = None
145
+ self.output_devices = None
146
+ self.input_devices_indices = None
147
+ self.output_devices_indices = None
148
+ self.stream = None
149
+ self.update_devices()
150
+ self.launcher()
151
+
152
+ def load(self):
153
+ try:
154
+ if not os.path.exists("configs/inuse/config.json"):
155
+ shutil.copy("configs/config.json", "configs/inuse/config.json")
156
+ with open("configs/inuse/config.json", "r") as j:
157
+ data = json.load(j)
158
+ data["sr_model"] = data["sr_type"] == "sr_model"
159
+ data["sr_device"] = data["sr_type"] == "sr_device"
160
+ data["pm"] = data["f0method"] == "pm"
161
+ data["harvest"] = data["f0method"] == "harvest"
162
+ data["crepe"] = data["f0method"] == "crepe"
163
+ data["rmvpe"] = data["f0method"] == "rmvpe"
164
+ data["fcpe"] = data["f0method"] == "fcpe"
165
+ if data["sg_hostapi"] in self.hostapis:
166
+ self.update_devices(hostapi_name=data["sg_hostapi"])
167
+ if (
168
+ data["sg_input_device"] not in self.input_devices
169
+ or data["sg_output_device"] not in self.output_devices
170
+ ):
171
+ self.update_devices()
172
+ data["sg_hostapi"] = self.hostapis[0]
173
+ data["sg_input_device"] = self.input_devices[
174
+ self.input_devices_indices.index(sd.default.device[0])
175
+ ]
176
+ data["sg_output_device"] = self.output_devices[
177
+ self.output_devices_indices.index(sd.default.device[1])
178
+ ]
179
+ else:
180
+ data["sg_hostapi"] = self.hostapis[0]
181
+ data["sg_input_device"] = self.input_devices[
182
+ self.input_devices_indices.index(sd.default.device[0])
183
+ ]
184
+ data["sg_output_device"] = self.output_devices[
185
+ self.output_devices_indices.index(sd.default.device[1])
186
+ ]
187
+ except:
188
+ with open("configs/inuse/config.json", "w") as j:
189
+ data = {
190
+ "pth_path": "",
191
+ "index_path": "",
192
+ "sg_hostapi": self.hostapis[0],
193
+ "sg_wasapi_exclusive": False,
194
+ "sg_input_device": self.input_devices[
195
+ self.input_devices_indices.index(sd.default.device[0])
196
+ ],
197
+ "sg_output_device": self.output_devices[
198
+ self.output_devices_indices.index(sd.default.device[1])
199
+ ],
200
+ "sr_type": "sr_model",
201
+ "threhold": -60,
202
+ "pitch": 0,
203
+ "formant": 0.0,
204
+ "index_rate": 0,
205
+ "rms_mix_rate": 0,
206
+ "block_time": 0.25,
207
+ "crossfade_length": 0.05,
208
+ "extra_time": 2.5,
209
+ "n_cpu": 4,
210
+ "f0method": "rmvpe",
211
+ "use_jit": False,
212
+ "use_pv": False,
213
+ }
214
+ data["sr_model"] = data["sr_type"] == "sr_model"
215
+ data["sr_device"] = data["sr_type"] == "sr_device"
216
+ data["pm"] = data["f0method"] == "pm"
217
+ data["harvest"] = data["f0method"] == "harvest"
218
+ data["crepe"] = data["f0method"] == "crepe"
219
+ data["rmvpe"] = data["f0method"] == "rmvpe"
220
+ data["fcpe"] = data["f0method"] == "fcpe"
221
+ return data
222
+
223
+ def launcher(self):
224
+ data = self.load()
225
+ self.config.use_jit = False # data.get("use_jit", self.config.use_jit)
226
+ sg.theme("LightBlue3")
227
+ layout = [
228
+ [
229
+ sg.Frame(
230
+ title=i18n("加载模型"),
231
+ layout=[
232
+ [
233
+ sg.Input(
234
+ default_text=data.get("pth_path", ""),
235
+ key="pth_path",
236
+ ),
237
+ sg.FileBrowse(
238
+ i18n("选择.pth文件"),
239
+ initial_folder=os.path.join(
240
+ os.getcwd(), "assets/weights"
241
+ ),
242
+ file_types=((". pth"),),
243
+ ),
244
+ ],
245
+ [
246
+ sg.Input(
247
+ default_text=data.get("index_path", ""),
248
+ key="index_path",
249
+ ),
250
+ sg.FileBrowse(
251
+ i18n("选择.index文件"),
252
+ initial_folder=os.path.join(os.getcwd(), "logs"),
253
+ file_types=((". index"),),
254
+ ),
255
+ ],
256
+ ],
257
+ )
258
+ ],
259
+ [
260
+ sg.Frame(
261
+ layout=[
262
+ [
263
+ sg.Text(i18n("设备类型")),
264
+ sg.Combo(
265
+ self.hostapis,
266
+ key="sg_hostapi",
267
+ default_value=data.get("sg_hostapi", ""),
268
+ enable_events=True,
269
+ size=(20, 1),
270
+ ),
271
+ sg.Checkbox(
272
+ i18n("独占 WASAPI 设备"),
273
+ key="sg_wasapi_exclusive",
274
+ default=data.get("sg_wasapi_exclusive", False),
275
+ enable_events=True,
276
+ ),
277
+ ],
278
+ [
279
+ sg.Text(i18n("输入设备")),
280
+ sg.Combo(
281
+ self.input_devices,
282
+ key="sg_input_device",
283
+ default_value=data.get("sg_input_device", ""),
284
+ enable_events=True,
285
+ size=(45, 1),
286
+ ),
287
+ ],
288
+ [
289
+ sg.Text(i18n("输出设备")),
290
+ sg.Combo(
291
+ self.output_devices,
292
+ key="sg_output_device",
293
+ default_value=data.get("sg_output_device", ""),
294
+ enable_events=True,
295
+ size=(45, 1),
296
+ ),
297
+ ],
298
+ [
299
+ sg.Button(i18n("重载设备列表"), key="reload_devices"),
300
+ sg.Radio(
301
+ i18n("使用模型采样率"),
302
+ "sr_type",
303
+ key="sr_model",
304
+ default=data.get("sr_model", True),
305
+ enable_events=True,
306
+ ),
307
+ sg.Radio(
308
+ i18n("使用设备采样率"),
309
+ "sr_type",
310
+ key="sr_device",
311
+ default=data.get("sr_device", False),
312
+ enable_events=True,
313
+ ),
314
+ sg.Text(i18n("采样率:")),
315
+ sg.Text("", key="sr_stream"),
316
+ ],
317
+ ],
318
+ title=i18n("音频设备"),
319
+ )
320
+ ],
321
+ [
322
+ sg.Frame(
323
+ layout=[
324
+ [
325
+ sg.Text(i18n("响应阈值")),
326
+ sg.Slider(
327
+ range=(-60, 0),
328
+ key="threhold",
329
+ resolution=1,
330
+ orientation="h",
331
+ default_value=data.get("threhold", -60),
332
+ enable_events=True,
333
+ ),
334
+ ],
335
+ [
336
+ sg.Text(i18n("音调设置")),
337
+ sg.Slider(
338
+ range=(-16, 16),
339
+ key="pitch",
340
+ resolution=1,
341
+ orientation="h",
342
+ default_value=data.get("pitch", 0),
343
+ enable_events=True,
344
+ ),
345
+ ],
346
+ [
347
+ sg.Text(i18n("性别因子/声线粗细")),
348
+ sg.Slider(
349
+ range=(-2, 2),
350
+ key="formant",
351
+ resolution=0.05,
352
+ orientation="h",
353
+ default_value=data.get("formant", 0.0),
354
+ enable_events=True,
355
+ ),
356
+ ],
357
+ [
358
+ sg.Text(i18n("Index Rate")),
359
+ sg.Slider(
360
+ range=(0.0, 1.0),
361
+ key="index_rate",
362
+ resolution=0.01,
363
+ orientation="h",
364
+ default_value=data.get("index_rate", 0),
365
+ enable_events=True,
366
+ ),
367
+ ],
368
+ [
369
+ sg.Text(i18n("响度因子")),
370
+ sg.Slider(
371
+ range=(0.0, 1.0),
372
+ key="rms_mix_rate",
373
+ resolution=0.01,
374
+ orientation="h",
375
+ default_value=data.get("rms_mix_rate", 0),
376
+ enable_events=True,
377
+ ),
378
+ ],
379
+ [
380
+ sg.Text(i18n("音高算法")),
381
+ sg.Radio(
382
+ "pm",
383
+ "f0method",
384
+ key="pm",
385
+ default=data.get("pm", False),
386
+ enable_events=True,
387
+ ),
388
+ sg.Radio(
389
+ "harvest",
390
+ "f0method",
391
+ key="harvest",
392
+ default=data.get("harvest", False),
393
+ enable_events=True,
394
+ ),
395
+ sg.Radio(
396
+ "crepe",
397
+ "f0method",
398
+ key="crepe",
399
+ default=data.get("crepe", False),
400
+ enable_events=True,
401
+ ),
402
+ sg.Radio(
403
+ "rmvpe",
404
+ "f0method",
405
+ key="rmvpe",
406
+ default=data.get("rmvpe", False),
407
+ enable_events=True,
408
+ ),
409
+ sg.Radio(
410
+ "fcpe",
411
+ "f0method",
412
+ key="fcpe",
413
+ default=data.get("fcpe", True),
414
+ enable_events=True,
415
+ ),
416
+ ],
417
+ ],
418
+ title=i18n("常规设置"),
419
+ ),
420
+ sg.Frame(
421
+ layout=[
422
+ [
423
+ sg.Text(i18n("采样长度")),
424
+ sg.Slider(
425
+ range=(0.02, 1.5),
426
+ key="block_time",
427
+ resolution=0.01,
428
+ orientation="h",
429
+ default_value=data.get("block_time", 0.25),
430
+ enable_events=True,
431
+ ),
432
+ ],
433
+ # [
434
+ # sg.Text("设备延迟"),
435
+ # sg.Slider(
436
+ # range=(0, 1),
437
+ # key="device_latency",
438
+ # resolution=0.001,
439
+ # orientation="h",
440
+ # default_value=data.get("device_latency", 0.1),
441
+ # enable_events=True,
442
+ # ),
443
+ # ],
444
+ [
445
+ sg.Text(i18n("harvest进程数")),
446
+ sg.Slider(
447
+ range=(1, n_cpu),
448
+ key="n_cpu",
449
+ resolution=1,
450
+ orientation="h",
451
+ default_value=data.get(
452
+ "n_cpu", min(self.gui_config.n_cpu, n_cpu)
453
+ ),
454
+ enable_events=True,
455
+ ),
456
+ ],
457
+ [
458
+ sg.Text(i18n("淡入淡出长度")),
459
+ sg.Slider(
460
+ range=(0.01, 0.15),
461
+ key="crossfade_length",
462
+ resolution=0.01,
463
+ orientation="h",
464
+ default_value=data.get("crossfade_length", 0.05),
465
+ enable_events=True,
466
+ ),
467
+ ],
468
+ [
469
+ sg.Text(i18n("额外推理时长")),
470
+ sg.Slider(
471
+ range=(0.05, 5.00),
472
+ key="extra_time",
473
+ resolution=0.01,
474
+ orientation="h",
475
+ default_value=data.get("extra_time", 2.5),
476
+ enable_events=True,
477
+ ),
478
+ ],
479
+ [
480
+ sg.Checkbox(
481
+ i18n("输入降噪"),
482
+ key="I_noise_reduce",
483
+ enable_events=True,
484
+ ),
485
+ sg.Checkbox(
486
+ i18n("输出降噪"),
487
+ key="O_noise_reduce",
488
+ enable_events=True,
489
+ ),
490
+ sg.Checkbox(
491
+ i18n("启用相位声码器"),
492
+ key="use_pv",
493
+ default=data.get("use_pv", False),
494
+ enable_events=True,
495
+ ),
496
+ # sg.Checkbox(
497
+ # "JIT加速",
498
+ # default=self.config.use_jit,
499
+ # key="use_jit",
500
+ # enable_events=False,
501
+ # ),
502
+ ],
503
+ # [sg.Text("注:首次使用JIT加速时,会出现卡顿,\n 并伴随一些噪音,但这是正常现象!")],
504
+ ],
505
+ title=i18n("性能设置"),
506
+ ),
507
+ ],
508
+ [
509
+ sg.Button(i18n("开始音频转换"), key="start_vc"),
510
+ sg.Button(i18n("停止音频转换"), key="stop_vc"),
511
+ sg.Radio(
512
+ i18n("输入监听"),
513
+ "function",
514
+ key="im",
515
+ default=False,
516
+ enable_events=True,
517
+ ),
518
+ sg.Radio(
519
+ i18n("输出变声"),
520
+ "function",
521
+ key="vc",
522
+ default=True,
523
+ enable_events=True,
524
+ ),
525
+ sg.Text(i18n("算法延迟(ms):")),
526
+ sg.Text("0", key="delay_time"),
527
+ sg.Text(i18n("推理时间(ms):")),
528
+ sg.Text("0", key="infer_time"),
529
+ ],
530
+ ]
531
+ self.window = sg.Window("RVC - GUI", layout=layout, finalize=True)
532
+ self.event_handler()
533
+
534
+ def event_handler(self):
535
+ global flag_vc
536
+ while True:
537
+ event, values = self.window.read()
538
+ if event == sg.WINDOW_CLOSED:
539
+ self.stop_stream()
540
+ exit()
541
+ if event == "reload_devices" or event == "sg_hostapi":
542
+ self.gui_config.sg_hostapi = values["sg_hostapi"]
543
+ self.update_devices(hostapi_name=values["sg_hostapi"])
544
+ if self.gui_config.sg_hostapi not in self.hostapis:
545
+ self.gui_config.sg_hostapi = self.hostapis[0]
546
+ self.window["sg_hostapi"].Update(values=self.hostapis)
547
+ self.window["sg_hostapi"].Update(value=self.gui_config.sg_hostapi)
548
+ if (
549
+ self.gui_config.sg_input_device not in self.input_devices
550
+ and len(self.input_devices) > 0
551
+ ):
552
+ self.gui_config.sg_input_device = self.input_devices[0]
553
+ self.window["sg_input_device"].Update(values=self.input_devices)
554
+ self.window["sg_input_device"].Update(
555
+ value=self.gui_config.sg_input_device
556
+ )
557
+ if self.gui_config.sg_output_device not in self.output_devices:
558
+ self.gui_config.sg_output_device = self.output_devices[0]
559
+ self.window["sg_output_device"].Update(values=self.output_devices)
560
+ self.window["sg_output_device"].Update(
561
+ value=self.gui_config.sg_output_device
562
+ )
563
+ if event == "start_vc" and not flag_vc:
564
+ if self.set_values(values) == True:
565
+ printt("cuda_is_available: %s", torch.cuda.is_available())
566
+ self.start_vc()
567
+ settings = {
568
+ "pth_path": values["pth_path"],
569
+ "index_path": values["index_path"],
570
+ "sg_hostapi": values["sg_hostapi"],
571
+ "sg_wasapi_exclusive": values["sg_wasapi_exclusive"],
572
+ "sg_input_device": values["sg_input_device"],
573
+ "sg_output_device": values["sg_output_device"],
574
+ "sr_type": ["sr_model", "sr_device"][
575
+ [
576
+ values["sr_model"],
577
+ values["sr_device"],
578
+ ].index(True)
579
+ ],
580
+ "threhold": values["threhold"],
581
+ "pitch": values["pitch"],
582
+ "rms_mix_rate": values["rms_mix_rate"],
583
+ "index_rate": values["index_rate"],
584
+ # "device_latency": values["device_latency"],
585
+ "block_time": values["block_time"],
586
+ "crossfade_length": values["crossfade_length"],
587
+ "extra_time": values["extra_time"],
588
+ "n_cpu": values["n_cpu"],
589
+ # "use_jit": values["use_jit"],
590
+ "use_jit": False,
591
+ "use_pv": values["use_pv"],
592
+ "f0method": ["pm", "harvest", "crepe", "rmvpe", "fcpe"][
593
+ [
594
+ values["pm"],
595
+ values["harvest"],
596
+ values["crepe"],
597
+ values["rmvpe"],
598
+ values["fcpe"],
599
+ ].index(True)
600
+ ],
601
+ }
602
+ with open("configs/inuse/config.json", "w") as j:
603
+ json.dump(settings, j)
604
+ if self.stream is not None:
605
+ self.delay_time = (
606
+ self.stream.latency[-1]
607
+ + values["block_time"]
608
+ + values["crossfade_length"]
609
+ + 0.01
610
+ )
611
+ if values["I_noise_reduce"]:
612
+ self.delay_time += min(values["crossfade_length"], 0.04)
613
+ self.window["sr_stream"].update(self.gui_config.samplerate)
614
+ self.window["delay_time"].update(
615
+ int(np.round(self.delay_time * 1000))
616
+ )
617
+ # Parameter hot update
618
+ if event == "threhold":
619
+ self.gui_config.threhold = values["threhold"]
620
+ elif event == "pitch":
621
+ self.gui_config.pitch = values["pitch"]
622
+ if hasattr(self, "rvc"):
623
+ self.rvc.change_key(values["pitch"])
624
+ elif event == "formant":
625
+ self.gui_config.formant = values["formant"]
626
+ if hasattr(self, "rvc"):
627
+ self.rvc.change_formant(values["formant"])
628
+ elif event == "index_rate":
629
+ self.gui_config.index_rate = values["index_rate"]
630
+ if hasattr(self, "rvc"):
631
+ self.rvc.change_index_rate(values["index_rate"])
632
+ elif event == "rms_mix_rate":
633
+ self.gui_config.rms_mix_rate = values["rms_mix_rate"]
634
+ elif event in ["pm", "harvest", "crepe", "rmvpe", "fcpe"]:
635
+ self.gui_config.f0method = event
636
+ elif event == "I_noise_reduce":
637
+ self.gui_config.I_noise_reduce = values["I_noise_reduce"]
638
+ if self.stream is not None:
639
+ self.delay_time += (
640
+ 1 if values["I_noise_reduce"] else -1
641
+ ) * min(values["crossfade_length"], 0.04)
642
+ self.window["delay_time"].update(
643
+ int(np.round(self.delay_time * 1000))
644
+ )
645
+ elif event == "O_noise_reduce":
646
+ self.gui_config.O_noise_reduce = values["O_noise_reduce"]
647
+ elif event == "use_pv":
648
+ self.gui_config.use_pv = values["use_pv"]
649
+ elif event in ["vc", "im"]:
650
+ self.function = event
651
+ elif event == "stop_vc" or event != "start_vc":
652
+ # Other parameters do not support hot update
653
+ self.stop_stream()
654
+
655
+ def set_values(self, values):
656
+ if len(values["pth_path"].strip()) == 0:
657
+ sg.popup(i18n("请选择pth文件"))
658
+ return False
659
+ if len(values["index_path"].strip()) == 0:
660
+ sg.popup(i18n("请选择index文件"))
661
+ return False
662
+ pattern = re.compile("[^\x00-\x7F]+")
663
+ if pattern.findall(values["pth_path"]):
664
+ sg.popup(i18n("pth文件路径不可包含中文"))
665
+ return False
666
+ if pattern.findall(values["index_path"]):
667
+ sg.popup(i18n("index文件路径不可包含中文"))
668
+ return False
669
+ self.set_devices(values["sg_input_device"], values["sg_output_device"])
670
+ self.config.use_jit = False # values["use_jit"]
671
+ # self.device_latency = values["device_latency"]
672
+ self.gui_config.sg_hostapi = values["sg_hostapi"]
673
+ self.gui_config.sg_wasapi_exclusive = values["sg_wasapi_exclusive"]
674
+ self.gui_config.sg_input_device = values["sg_input_device"]
675
+ self.gui_config.sg_output_device = values["sg_output_device"]
676
+ self.gui_config.pth_path = values["pth_path"]
677
+ self.gui_config.index_path = values["index_path"]
678
+ self.gui_config.sr_type = ["sr_model", "sr_device"][
679
+ [
680
+ values["sr_model"],
681
+ values["sr_device"],
682
+ ].index(True)
683
+ ]
684
+ self.gui_config.threhold = values["threhold"]
685
+ self.gui_config.pitch = values["pitch"]
686
+ self.gui_config.formant = values["formant"]
687
+ self.gui_config.block_time = values["block_time"]
688
+ self.gui_config.crossfade_time = values["crossfade_length"]
689
+ self.gui_config.extra_time = values["extra_time"]
690
+ self.gui_config.I_noise_reduce = values["I_noise_reduce"]
691
+ self.gui_config.O_noise_reduce = values["O_noise_reduce"]
692
+ self.gui_config.use_pv = values["use_pv"]
693
+ self.gui_config.rms_mix_rate = values["rms_mix_rate"]
694
+ self.gui_config.index_rate = values["index_rate"]
695
+ self.gui_config.n_cpu = values["n_cpu"]
696
+ self.gui_config.f0method = ["pm", "harvest", "crepe", "rmvpe", "fcpe"][
697
+ [
698
+ values["pm"],
699
+ values["harvest"],
700
+ values["crepe"],
701
+ values["rmvpe"],
702
+ values["fcpe"],
703
+ ].index(True)
704
+ ]
705
+ return True
706
+
707
+ def start_vc(self):
708
+ torch.cuda.empty_cache()
709
+ self.rvc = rvc_for_realtime.RVC(
710
+ self.gui_config.pitch,
711
+ self.gui_config.formant,
712
+ self.gui_config.pth_path,
713
+ self.gui_config.index_path,
714
+ self.gui_config.index_rate,
715
+ self.gui_config.n_cpu,
716
+ inp_q,
717
+ opt_q,
718
+ self.config,
719
+ self.rvc if hasattr(self, "rvc") else None,
720
+ )
721
+ self.gui_config.samplerate = (
722
+ self.rvc.tgt_sr
723
+ if self.gui_config.sr_type == "sr_model"
724
+ else self.get_device_samplerate()
725
+ )
726
+ self.gui_config.channels = self.get_device_channels()
727
+ self.zc = self.gui_config.samplerate // 100
728
+ self.block_frame = (
729
+ int(
730
+ np.round(
731
+ self.gui_config.block_time
732
+ * self.gui_config.samplerate
733
+ / self.zc
734
+ )
735
+ )
736
+ * self.zc
737
+ )
738
+ self.block_frame_16k = 160 * self.block_frame // self.zc
739
+ self.crossfade_frame = (
740
+ int(
741
+ np.round(
742
+ self.gui_config.crossfade_time
743
+ * self.gui_config.samplerate
744
+ / self.zc
745
+ )
746
+ )
747
+ * self.zc
748
+ )
749
+ self.sola_buffer_frame = min(self.crossfade_frame, 4 * self.zc)
750
+ self.sola_search_frame = self.zc
751
+ self.extra_frame = (
752
+ int(
753
+ np.round(
754
+ self.gui_config.extra_time
755
+ * self.gui_config.samplerate
756
+ / self.zc
757
+ )
758
+ )
759
+ * self.zc
760
+ )
761
+ self.input_wav: torch.Tensor = torch.zeros(
762
+ self.extra_frame
763
+ + self.crossfade_frame
764
+ + self.sola_search_frame
765
+ + self.block_frame,
766
+ device=self.config.device,
767
+ dtype=torch.float32,
768
+ )
769
+ self.input_wav_denoise: torch.Tensor = self.input_wav.clone()
770
+ self.input_wav_res: torch.Tensor = torch.zeros(
771
+ 160 * self.input_wav.shape[0] // self.zc,
772
+ device=self.config.device,
773
+ dtype=torch.float32,
774
+ )
775
+ self.rms_buffer: np.ndarray = np.zeros(4 * self.zc, dtype="float32")
776
+ self.sola_buffer: torch.Tensor = torch.zeros(
777
+ self.sola_buffer_frame, device=self.config.device, dtype=torch.float32
778
+ )
779
+ self.nr_buffer: torch.Tensor = self.sola_buffer.clone()
780
+ self.output_buffer: torch.Tensor = self.input_wav.clone()
781
+ self.skip_head = self.extra_frame // self.zc
782
+ self.return_length = (
783
+ self.block_frame + self.sola_buffer_frame + self.sola_search_frame
784
+ ) // self.zc
785
+ self.fade_in_window: torch.Tensor = (
786
+ torch.sin(
787
+ 0.5
788
+ * np.pi
789
+ * torch.linspace(
790
+ 0.0,
791
+ 1.0,
792
+ steps=self.sola_buffer_frame,
793
+ device=self.config.device,
794
+ dtype=torch.float32,
795
+ )
796
+ )
797
+ ** 2
798
+ )
799
+ self.fade_out_window: torch.Tensor = 1 - self.fade_in_window
800
+ self.resampler = tat.Resample(
801
+ orig_freq=self.gui_config.samplerate,
802
+ new_freq=16000,
803
+ dtype=torch.float32,
804
+ ).to(self.config.device)
805
+ if self.rvc.tgt_sr != self.gui_config.samplerate:
806
+ self.resampler2 = tat.Resample(
807
+ orig_freq=self.rvc.tgt_sr,
808
+ new_freq=self.gui_config.samplerate,
809
+ dtype=torch.float32,
810
+ ).to(self.config.device)
811
+ else:
812
+ self.resampler2 = None
813
+ self.tg = TorchGate(
814
+ sr=self.gui_config.samplerate, n_fft=4 * self.zc, prop_decrease=0.9
815
+ ).to(self.config.device)
816
+ self.start_stream()
817
+
818
+ def start_stream(self):
819
+ global flag_vc
820
+ if not flag_vc:
821
+ flag_vc = True
822
+ if (
823
+ "WASAPI" in self.gui_config.sg_hostapi
824
+ and self.gui_config.sg_wasapi_exclusive
825
+ ):
826
+ extra_settings = sd.WasapiSettings(exclusive=True)
827
+ else:
828
+ extra_settings = None
829
+ self.stream = sd.Stream(
830
+ callback=self.audio_callback,
831
+ blocksize=self.block_frame,
832
+ samplerate=self.gui_config.samplerate,
833
+ channels=self.gui_config.channels,
834
+ dtype="float32",
835
+ extra_settings=extra_settings,
836
+ )
837
+ self.stream.start()
838
+
839
+ def stop_stream(self):
840
+ global flag_vc
841
+ if flag_vc:
842
+ flag_vc = False
843
+ if self.stream is not None:
844
+ self.stream.abort()
845
+ self.stream.close()
846
+ self.stream = None
847
+
848
+ def audio_callback(
849
+ self, indata: np.ndarray, outdata: np.ndarray, frames, times, status
850
+ ):
851
+ """
852
+ 音频处理
853
+ """
854
+ global flag_vc
855
+ start_time = time.perf_counter()
856
+ indata = librosa.to_mono(indata.T)
857
+ if self.gui_config.threhold > -60:
858
+ indata = np.append(self.rms_buffer, indata)
859
+ rms = librosa.feature.rms(
860
+ y=indata, frame_length=4 * self.zc, hop_length=self.zc
861
+ )[:, 2:]
862
+ self.rms_buffer[:] = indata[-4 * self.zc :]
863
+ indata = indata[2 * self.zc - self.zc // 2 :]
864
+ db_threhold = (
865
+ librosa.amplitude_to_db(rms, ref=1.0)[0] < self.gui_config.threhold
866
+ )
867
+ for i in range(db_threhold.shape[0]):
868
+ if db_threhold[i]:
869
+ indata[i * self.zc : (i + 1) * self.zc] = 0
870
+ indata = indata[self.zc // 2 :]
871
+ self.input_wav[: -self.block_frame] = self.input_wav[
872
+ self.block_frame :
873
+ ].clone()
874
+ self.input_wav[-indata.shape[0] :] = torch.from_numpy(indata).to(
875
+ self.config.device
876
+ )
877
+ self.input_wav_res[: -self.block_frame_16k] = self.input_wav_res[
878
+ self.block_frame_16k :
879
+ ].clone()
880
+ # input noise reduction and resampling
881
+ if self.gui_config.I_noise_reduce:
882
+ self.input_wav_denoise[: -self.block_frame] = self.input_wav_denoise[
883
+ self.block_frame :
884
+ ].clone()
885
+ input_wav = self.input_wav[-self.sola_buffer_frame - self.block_frame :]
886
+ input_wav = self.tg(
887
+ input_wav.unsqueeze(0), self.input_wav.unsqueeze(0)
888
+ ).squeeze(0)
889
+ input_wav[: self.sola_buffer_frame] *= self.fade_in_window
890
+ input_wav[: self.sola_buffer_frame] += (
891
+ self.nr_buffer * self.fade_out_window
892
+ )
893
+ self.input_wav_denoise[-self.block_frame :] = input_wav[
894
+ : self.block_frame
895
+ ]
896
+ self.nr_buffer[:] = input_wav[self.block_frame :]
897
+ self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(
898
+ self.input_wav_denoise[-self.block_frame - 2 * self.zc :]
899
+ )[160:]
900
+ else:
901
+ self.input_wav_res[-160 * (indata.shape[0] // self.zc + 1) :] = (
902
+ self.resampler(self.input_wav[-indata.shape[0] - 2 * self.zc :])[
903
+ 160:
904
+ ]
905
+ )
906
+ # infer
907
+ if self.function == "vc":
908
+ infer_wav = self.rvc.infer(
909
+ self.input_wav_res,
910
+ self.block_frame_16k,
911
+ self.skip_head,
912
+ self.return_length,
913
+ self.gui_config.f0method,
914
+ )
915
+ if self.resampler2 is not None:
916
+ infer_wav = self.resampler2(infer_wav)
917
+ elif self.gui_config.I_noise_reduce:
918
+ infer_wav = self.input_wav_denoise[self.extra_frame :].clone()
919
+ else:
920
+ infer_wav = self.input_wav[self.extra_frame :].clone()
921
+ # output noise reduction
922
+ if self.gui_config.O_noise_reduce and self.function == "vc":
923
+ self.output_buffer[: -self.block_frame] = self.output_buffer[
924
+ self.block_frame :
925
+ ].clone()
926
+ self.output_buffer[-self.block_frame :] = infer_wav[-self.block_frame :]
927
+ infer_wav = self.tg(
928
+ infer_wav.unsqueeze(0), self.output_buffer.unsqueeze(0)
929
+ ).squeeze(0)
930
+ # volume envelop mixing
931
+ if self.gui_config.rms_mix_rate < 1 and self.function == "vc":
932
+ if self.gui_config.I_noise_reduce:
933
+ input_wav = self.input_wav_denoise[self.extra_frame :]
934
+ else:
935
+ input_wav = self.input_wav[self.extra_frame :]
936
+ rms1 = librosa.feature.rms(
937
+ y=input_wav[: infer_wav.shape[0]].cpu().numpy(),
938
+ frame_length=4 * self.zc,
939
+ hop_length=self.zc,
940
+ )
941
+ rms1 = torch.from_numpy(rms1).to(self.config.device)
942
+ rms1 = F.interpolate(
943
+ rms1.unsqueeze(0),
944
+ size=infer_wav.shape[0] + 1,
945
+ mode="linear",
946
+ align_corners=True,
947
+ )[0, 0, :-1]
948
+ rms2 = librosa.feature.rms(
949
+ y=infer_wav[:].cpu().numpy(),
950
+ frame_length=4 * self.zc,
951
+ hop_length=self.zc,
952
+ )
953
+ rms2 = torch.from_numpy(rms2).to(self.config.device)
954
+ rms2 = F.interpolate(
955
+ rms2.unsqueeze(0),
956
+ size=infer_wav.shape[0] + 1,
957
+ mode="linear",
958
+ align_corners=True,
959
+ )[0, 0, :-1]
960
+ rms2 = torch.max(rms2, torch.zeros_like(rms2) + 1e-3)
961
+ infer_wav *= torch.pow(
962
+ rms1 / rms2, torch.tensor(1 - self.gui_config.rms_mix_rate)
963
+ )
964
+ # SOLA algorithm from https://github.com/yxlllc/DDSP-SVC
965
+ conv_input = infer_wav[
966
+ None, None, : self.sola_buffer_frame + self.sola_search_frame
967
+ ]
968
+ cor_nom = F.conv1d(conv_input, self.sola_buffer[None, None, :])
969
+ cor_den = torch.sqrt(
970
+ F.conv1d(
971
+ conv_input**2,
972
+ torch.ones(1, 1, self.sola_buffer_frame, device=self.config.device),
973
+ )
974
+ + 1e-8
975
+ )
976
+ if sys.platform == "darwin":
977
+ _, sola_offset = torch.max(cor_nom[0, 0] / cor_den[0, 0])
978
+ sola_offset = sola_offset.item()
979
+ else:
980
+ sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
981
+ printt("sola_offset = %d", int(sola_offset))
982
+ infer_wav = infer_wav[sola_offset:]
983
+ if "privateuseone" in str(self.config.device) or not self.gui_config.use_pv:
984
+ infer_wav[: self.sola_buffer_frame] *= self.fade_in_window
985
+ infer_wav[: self.sola_buffer_frame] += (
986
+ self.sola_buffer * self.fade_out_window
987
+ )
988
+ else:
989
+ infer_wav[: self.sola_buffer_frame] = phase_vocoder(
990
+ self.sola_buffer,
991
+ infer_wav[: self.sola_buffer_frame],
992
+ self.fade_out_window,
993
+ self.fade_in_window,
994
+ )
995
+ self.sola_buffer[:] = infer_wav[
996
+ self.block_frame : self.block_frame + self.sola_buffer_frame
997
+ ]
998
+ outdata[:] = (
999
+ infer_wav[: self.block_frame]
1000
+ .repeat(self.gui_config.channels, 1)
1001
+ .t()
1002
+ .cpu()
1003
+ .numpy()
1004
+ )
1005
+ total_time = time.perf_counter() - start_time
1006
+ if flag_vc:
1007
+ self.window["infer_time"].update(int(total_time * 1000))
1008
+ printt("Infer time: %.2f", total_time)
1009
+
1010
+ def update_devices(self, hostapi_name=None):
1011
+ """获取设备列表"""
1012
+ global flag_vc
1013
+ flag_vc = False
1014
+ sd._terminate()
1015
+ sd._initialize()
1016
+ devices = sd.query_devices()
1017
+ hostapis = sd.query_hostapis()
1018
+ for hostapi in hostapis:
1019
+ for device_idx in hostapi["devices"]:
1020
+ devices[device_idx]["hostapi_name"] = hostapi["name"]
1021
+ self.hostapis = [hostapi["name"] for hostapi in hostapis]
1022
+ if hostapi_name not in self.hostapis:
1023
+ hostapi_name = self.hostapis[0]
1024
+ self.input_devices = [
1025
+ d["name"]
1026
+ for d in devices
1027
+ if d["max_input_channels"] > 0 and d["hostapi_name"] == hostapi_name
1028
+ ]
1029
+ self.output_devices = [
1030
+ d["name"]
1031
+ for d in devices
1032
+ if d["max_output_channels"] > 0 and d["hostapi_name"] == hostapi_name
1033
+ ]
1034
+ self.input_devices_indices = [
1035
+ d["index"] if "index" in d else d["name"]
1036
+ for d in devices
1037
+ if d["max_input_channels"] > 0 and d["hostapi_name"] == hostapi_name
1038
+ ]
1039
+ self.output_devices_indices = [
1040
+ d["index"] if "index" in d else d["name"]
1041
+ for d in devices
1042
+ if d["max_output_channels"] > 0 and d["hostapi_name"] == hostapi_name
1043
+ ]
1044
+
1045
+ def set_devices(self, input_device, output_device):
1046
+ """设置输出设备"""
1047
+ sd.default.device[0] = self.input_devices_indices[
1048
+ self.input_devices.index(input_device)
1049
+ ]
1050
+ sd.default.device[1] = self.output_devices_indices[
1051
+ self.output_devices.index(output_device)
1052
+ ]
1053
+ printt("Input device: %s:%s", str(sd.default.device[0]), input_device)
1054
+ printt("Output device: %s:%s", str(sd.default.device[1]), output_device)
1055
+
1056
+ def get_device_samplerate(self):
1057
+ return int(
1058
+ sd.query_devices(device=sd.default.device[0])["default_samplerate"]
1059
+ )
1060
+
1061
+ def get_device_channels(self):
1062
+ max_input_channels = sd.query_devices(device=sd.default.device[0])[
1063
+ "max_input_channels"
1064
+ ]
1065
+ max_output_channels = sd.query_devices(device=sd.default.device[1])[
1066
+ "max_output_channels"
1067
+ ]
1068
+ return min(max_input_channels, max_output_channels, 2)
1069
+
1070
+ gui = GUI()
RVC/i18n/i18n.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import locale
3
+ import os
4
+
5
+
6
+ def load_language_list(language):
7
+ with open(f"./i18n/locale/{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/locale/{language}.json"):
19
+ language = "en_US"
20
+ self.language = language
21
+ self.language_map = load_language_list(language)
22
+
23
+ def __call__(self, key):
24
+ return self.language_map.get(key, key)
25
+
26
+ def __repr__(self):
27
+ return "Use Language: " + self.language
RVC/i18n/locale/en_US.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": "If >=3: apply median filtering to the harvested pitch results. The value represents the filter radius and can reduce breathiness.",
3
+ "A模型权重": "Weight (w) for Model A:",
4
+ "A模型路径": "Path to Model A:",
5
+ "B模型路径": "Path to Model B:",
6
+ "E:\\语音音频+标注\\米津玄师\\src": "C:\\Users\\Desktop\\src",
7
+ "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0 curve file (optional). One pitch per line. Replaces the default F0 and pitch modulation:",
8
+ "Index Rate": "Index Rate",
9
+ "Onnx导出": "Export Onnx",
10
+ "Onnx输出路径": "Onnx Export Path:",
11
+ "RVC模型路径": "RVC Model Path:",
12
+ "ckpt处理": "ckpt Processing",
13
+ "harvest进程数": "Number of CPU processes used for harvest pitch algorithm",
14
+ "index文件路径不可包含中文": "index文件路径不可包含中文",
15
+ "pth文件路径不可包含中文": "pth文件路径不可包含中文",
16
+ "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "Enter the GPU index(es) separated by '-', e.g., 0-0-1 to use 2 processes in GPU0 and 1 process in GPU1",
17
+ "step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "Step 1: Fill in the experimental configuration. Experimental data is stored in the 'logs' folder, with each experiment having a separate folder. Manually enter the experiment name path, which contains the experimental configuration, logs, and trained model files.",
18
+ "step1:正在处理数据": "Step 1: Processing data",
19
+ "step2:正在提取音高&正在提取特征": "step2:Pitch extraction & feature extraction",
20
+ "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "Step 2a: Automatically traverse all files in the training folder that can be decoded into audio and perform slice normalization. Generates 2 wav folders in the experiment directory. Currently, only single-singer/speaker training is supported.",
21
+ "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "Step 2b: Use CPU to extract pitch (if the model has pitch), use GPU to extract features (select GPU index):",
22
+ "step3: 填写训练设置, 开始训练模型和索引": "Step 3: Fill in the training settings and start training the model and index",
23
+ "step3a:正在训练模型": "Step 3a: Model training started",
24
+ "一键训练": "One-click training",
25
+ "也可批量输入音频文件, 二选一, 优先读文件夹": "Multiple audio files can also be imported. If a folder path exists, this input is ignored.",
26
+ "人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单通道混响;<br>&emsp;(234)DeEcho:去除延迟效果。Aggressive比Normal去除得更彻底,DeReverb额外去除混响,可去除单声道混响,但是对高频重的板式混响去不干净。<br>去混响/去延迟,附:<br>1、DeEcho-DeReverb模型的耗时是另外2个DeEcho模型的接近2倍;<br>2、MDX-Net-Dereverb模型挺慢的;<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。": "Batch processing for vocal accompaniment separation using the UVR5 model.<br>Example of a valid folder path format: D:\\path\\to\\input\\folder (copy it from the file manager address bar).<br>The model is divided into three categories:<br>1. Preserve vocals: Choose this option for audio without harmonies. It preserves vocals better than HP5. It includes two built-in models: HP2 and HP3. HP3 may slightly leak accompaniment but preserves vocals slightly better than HP2.<br>2. Preserve main vocals only: Choose this option for audio with harmonies. It may weaken the main vocals. It includes one built-in model: HP5.<br>3. De-reverb and de-delay models (by FoxJoy):<br>  (1) MDX-Net: The best choice for stereo reverb removal but cannot remove mono reverb;<br>&emsp;(234) DeEcho: Removes delay effects. Aggressive mode removes more thoroughly than Normal mode. DeReverb additionally removes reverb and can remove mono reverb, but not very effectively for heavily reverberated high-frequency content.<br>De-reverb/de-delay notes:<br>1. The processing time for the DeEcho-DeReverb model is approximately twice as long as the other two DeEcho models.<br>2. The MDX-Net-Dereverb model is quite slow.<br>3. The recommended cleanest configuration is to apply MDX-Net first and then DeEcho-Aggressive.",
27
+ "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Enter the GPU index(es) separated by '-', e.g., 0-1-2 to use GPU 0, 1, and 2:",
28
+ "伴奏人声分离&去混响&去回声": "Vocals/Accompaniment Separation & Reverberation Removal",
29
+ "使用模型采样率": "使用模型采样率",
30
+ "使用设备采样率": "使用设备采样率",
31
+ "保存名": "Save name:",
32
+ "保存的文件名, 默认空为和源文件同名": "Save file name (default: same as the source file):",
33
+ "保存的模型名不带后缀": "Saved model name (without extension):",
34
+ "保存频率save_every_epoch": "Save frequency (save_every_epoch):",
35
+ "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy:",
36
+ "修改": "Modify",
37
+ "修改模型信息(仅支持weights文件夹下提取的小模型文件)": "Modify model information (only supported for small model files extracted from the 'weights' folder)",
38
+ "停止音频转换": "Stop audio conversion",
39
+ "全流程结束!": "All processes have been completed!",
40
+ "刷新音色列表和索引路径": "Refresh voice list and index path",
41
+ "加载模型": "Load model",
42
+ "加载预训练底模D路径": "Load pre-trained base model D path:",
43
+ "加载预训练底模G路径": "Load pre-trained base model G path:",
44
+ "单次推理": "Single Inference",
45
+ "卸载音色省显存": "Unload voice to save GPU memory:",
46
+ "变调(整数, 半音数量, 升八度12降八度-12)": "Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12):",
47
+ "后处理重采样至最终采样率,0为不进行重采样": "Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling:",
48
+ "否": "No",
49
+ "启用相位声码器": "启用相位声码器",
50
+ "响应阈值": "Response threshold",
51
+ "响度因子": "loudness factor",
52
+ "处理数据": "Process data",
53
+ "导出Onnx模型": "Export Onnx Model",
54
+ "导出文件格式": "Export file format",
55
+ "常见问题解答": "FAQ (Frequently Asked Questions)",
56
+ "常规设置": "General settings",
57
+ "开始音频转换": "Start audio conversion",
58
+ "很遗憾您这没有能用的显卡来支持您训练": "Unfortunately, there is no compatible GPU available to support your training.",
59
+ "性能设置": "Performance settings",
60
+ "总训练轮数total_epoch": "Total training epochs (total_epoch):",
61
+ "批量推理": "Batch Inference",
62
+ "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "Batch conversion. Enter the folder containing the audio files to be converted or upload multiple audio files. The converted audio will be output in the specified folder (default: 'opt').",
63
+ "指定输出主人声文件夹": "Specify the output folder for vocals:",
64
+ "指定输出文件夹": "Specify output folder:",
65
+ "指定输出非主人声文件夹": "Specify the output folder for accompaniment:",
66
+ "推理时间(ms):": "Inference time (ms):",
67
+ "推理音色": "Inferencing voice:",
68
+ "提取": "Extract",
69
+ "提取音高和处理数据使用的CPU进程数": "Number of CPU processes used for pitch extraction and data processing:",
70
+ "是": "Yes",
71
+ "是否仅保存最新的ckpt文件以节省硬盘空间": "Save only the latest '.ckpt' file to save disk space:",
72
+ "是否在每次保存时间点将最终小模型保存至weights文件夹": "Save a small final model to the 'weights' folder at each save point:",
73
+ "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "Cache all training sets to GPU memory. Caching small datasets (less than 10 minutes) can speed up training, but caching large datasets will consume a lot of GPU memory and may not provide much speed improvement:",
74
+ "显卡信息": "GPU Information",
75
+ "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "This software is open source under the MIT license. The author does not have any control over the software. Users who use the software and distribute the sounds exported by the software are solely responsible. <br>If you do not agree with this clause, you cannot use or reference any codes and files within the software package. See the root directory <b>Agreement-LICENSE.txt</b> for details.",
76
+ "查看": "View",
77
+ "查看模型信息(仅支持weights文件夹下提取的小模型文件)": "View model information (only supported for small model files extracted from the 'weights' folder)",
78
+ "检索特征占比": "Search feature ratio (controls accent strength, too high has artifacting):",
79
+ "模型": "Model",
80
+ "模型推理": "Model Inference",
81
+ "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "Model extraction (enter the path of the large file model under the 'logs' folder). This is useful if you want to stop training halfway and manually extract and save a small model file, or if you want to test an intermediate model:",
82
+ "模型是否带音高指导": "Whether the model has pitch guidance:",
83
+ "模型是否带音高指导(唱歌一定要, 语音可以不要)": "Whether the model has pitch guidance (required for singing, optional for speech):",
84
+ "模型是否带音高指导,1是0否": "Whether the model has pitch guidance (1: yes, 0: no):",
85
+ "模型版本型号": "Model architecture version:",
86
+ "模型融合, 可用于测试音色融合": "Model fusion, can be used to test timbre fusion",
87
+ "模型路径": "Path to Model:",
88
+ "每张显卡的batch_size": "Batch size per GPU:",
89
+ "淡入淡出长度": "Fade length",
90
+ "版本": "Version",
91
+ "特征提取": "Feature extraction",
92
+ "特征检索库文件路径,为空则使用下拉的选择结果": "Path to the feature index file. Leave blank to use the selected result from the dropdown:",
93
+ "独占 WASAPI 设备": "独占 WASAPI 设备",
94
+ "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Recommended +12 key for male to female conversion, and -12 key for female to male conversion. If the sound range goes too far and the voice is distorted, you can also adjust it to the appropriate range by yourself.",
95
+ "目标采样率": "Target sample rate:",
96
+ "算法延迟(ms):": "Algorithmic delays(ms):",
97
+ "自动检测index路径,下拉式选择(dropdown)": "Auto-detect index path and select from the dropdown:",
98
+ "融合": "Fusion",
99
+ "要改的模型信息": "Model information to be modified:",
100
+ "要置入的模型信息": "Model information to be placed:",
101
+ "训练": "Train",
102
+ "训练模型": "Train model",
103
+ "训练特征索引": "Train feature index",
104
+ "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Training complete. You can check the training logs in the console or the 'train.log' file under the experiment folder.",
105
+ "设备类型": "设备类型",
106
+ "请指定说话人id": "Please specify the speaker/singer ID:",
107
+ "请选择index文件": "Please choose the .index file",
108
+ "请选择pth文件": "Please choose the .pth file",
109
+ "请选择说话人id": "Select Speaker/Singer ID:",
110
+ "转换": "Convert",
111
+ "输入实验名": "Enter the experiment name:",
112
+ "输入待处理音频文件夹路径": "Enter the path of the audio folder to be processed:",
113
+ "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Enter the path of the audio folder to be processed (copy it from the address bar of the file manager):",
114
+ "输入待处理音频文件路径(默认是正确格式示例)": "Enter the path of the audio file to be processed (default is the correct format example):",
115
+ "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "Adjust the volume envelope scaling. Closer to 0, the more it mimicks the volume of the original vocals. Can help mask noise and make volume sound more natural when set relatively low. Closer to 1 will be more of a consistently loud volume:",
116
+ "输入监听": "Input voice monitor",
117
+ "输入训练文件夹路径": "Enter the path of the training folder:",
118
+ "输入设备": "Input device",
119
+ "输入降噪": "Input noise reduction",
120
+ "输出信息": "Output information",
121
+ "输出变声": "Output converted voice",
122
+ "输出设备": "Output device",
123
+ "输出降噪": "Output noise reduction",
124
+ "输出音频(右下角三个点,点了可以下载)": "Export audio (click on the three dots in the lower right corner to download)",
125
+ "选择.index文件": "Select the .index file",
126
+ "选择.pth文件": "Select the .pth file",
127
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
128
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Select the pitch extraction algorithm ('pm': faster extraction but lower-quality speech; 'harvest': better bass but extremely slow; 'crepe': better quality but GPU intensive), 'rmvpe': best quality, and little GPU requirement",
129
+ "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "Select the pitch extraction algorithm: when extracting singing, you can use 'pm' to speed up. For high-quality speech with fast performance, but worse CPU usage, you can use 'dio'. 'harvest' results in better quality but is slower. 'rmvpe' has the best results and consumes less CPU/GPU",
130
+ "采样率:": "采样率:",
131
+ "采样长度": "Sample length",
132
+ "重载设备列表": "Reload device list",
133
+ "音调设置": "Pitch settings",
134
+ "音频设备": "Audio device",
135
+ "音高算法": "pitch detection algorithm",
136
+ "额外推理时长": "Extra inference time"
137
+ }
RVC/i18n/locale/es_ES.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": "Si es >=3, entonces use el resultado del reconocimiento de tono de 'harvest' con filtro de mediana, el valor es el radio del filtro, su uso puede debilitar el sonido sordo",
3
+ "A模型权重": "Un peso modelo para el modelo A.",
4
+ "A模型路径": "Modelo A ruta.",
5
+ "B模型路径": "Modelo B ruta.",
6
+ "E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
7
+ "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Archivo de curva F0, opcional, un tono por línea, en lugar de F0 predeterminado y cambio de tono",
8
+ "Index Rate": "Tasa de índice",
9
+ "Onnx导出": "Exportar Onnx",
10
+ "Onnx输出路径": "Ruta de salida Onnx",
11
+ "RVC模型路径": "Ruta del modelo RVC",
12
+ "ckpt处理": "Procesamiento de recibos",
13
+ "harvest进程数": "Número de procesos",
14
+ "index文件路径不可包含中文": "La ruta del archivo .index no debe contener caracteres chinos.",
15
+ "pth文件路径不可包含中文": "La ruta del archivo .pth no debe contener caracteres chinos.",
16
+ "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "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.",
17
+ "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.",
18
+ "step1:正在处理数据": "Paso 1: Procesando datos",
19
+ "step2:正在提取音高&正在提取特征": "Paso 2: Extracción del tono y extracción de características",
20
+ "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.",
21
+ "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).",
22
+ "step3: 填写训练设置, 开始训练模型和索引": "Paso 3: Complete la configuración de entrenamiento y comience a entrenar el modelo y el índice.",
23
+ "step3a:正在训练模型": "Paso 3a: Entrenando el modelo",
24
+ "一键训练": "Entrenamiento con un clic",
25
+ "也可批量输入音频文件, 二选一, 优先读文件夹": "También se pueden importar varios archivos de audio. Si existe una ruta de carpeta, esta entrada se ignora.",
26
+ "人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单通道混响;<br>&emsp;(234)DeEcho:去除延迟效果。Aggressive比Normal去除得更彻底,DeReverb额外去除混响,可去除单声道混响,但是对高频重的板式混响去不干净。<br>去混响/去延迟,附:<br>1、DeEcho-DeReverb模型的耗时是另外2个DeEcho模型的接近2倍;<br>2、MDX-Net-Dereverb模型挺慢的;<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。": "Procesamiento por lotes para la separación de acompañamiento vocal utilizando el modelo UVR5.<br>Ejemplo de formato de ruta de carpeta válido: D:\\ruta\\a\\la\\carpeta\\de\\entrada (copiar desde la barra de direcciones del administrador de archivos).<br>El modelo se divide en tres categorías:<br>1. Preservar voces: Elija esta opción para audio sin armonías. Preserva las voces mejor que HP5. Incluye dos modelos incorporados: HP2 y HP3. HP3 puede filtrar ligeramente el acompañamiento pero conserva las voces un poco mejor que HP2.<br>2. Preservar solo voces principales: Elija esta opción para audio con armonías. Puede debilitar las voces principales. Incluye un modelo incorporado: HP5.<br>3. Modelos de des-reverberación y des-retardo (por FoxJoy):<br>  (1) MDX-Net: La mejor opción para la eliminación de reverberación estéreo pero no puede eliminar la reverberación mono;<br>&emsp;(234) DeEcho: Elimina efectos de retardo. El modo Agresivo elimina más a fondo que el modo Normal. DeReverb adicionalmente elimina la reverberación y puede eliminar la reverberación mono, pero no muy efectivamente para contenido de alta frecuencia fuertemente reverberado.<br>Notas de des-reverberación/des-retardo:<br>1. El tiempo de procesamiento para el modelo DeEcho-DeReverb es aproximadamente el doble que los otros dos modelos DeEcho.<br>2. El modelo MDX-Net-Dereverb es bastante lento.<br>3. La configuración más limpia recomendada es aplicar primero MDX-Net y luego DeEcho-Agresivo.",
27
+ "以-分隔输入使用的卡号, 例如 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.",
28
+ "伴奏人声分离&去混响&去回声": "Separación de voz acompañante & eliminación de reverberación & eco",
29
+ "使用模型采样率": "使用模型采样率",
30
+ "使用设备采样率": "使用设备采样率",
31
+ "保存名": "Guardar nombre",
32
+ "保存的文件名, 默认空为和源文件同名": "Nombre del archivo que se guardará, el valor predeterminado es el mismo que el nombre del archivo de origen",
33
+ "保存的模型名不带后缀": "Nombre del modelo guardado sin extensión.",
34
+ "保存频率save_every_epoch": "Frecuencia de guardado (save_every_epoch)",
35
+ "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "Proteger las consonantes claras y la respiración, prevenir artefactos como la distorsión de sonido electrónico, 0.5 no está activado, reducir aumentará la protección pero puede reducir el efecto del índice",
36
+ "修改": "Modificar",
37
+ "修改模型信息(仅支持weights文件夹下提取的小模型文件)": "Modificar la información del modelo (solo admite archivos de modelos pequeños extraídos en la carpeta weights)",
38
+ "停止音频转换": "Detener la conversión de audio",
39
+ "全流程结束!": "¡Todo el proceso ha terminado!",
40
+ "刷新音色列表和索引路径": "Actualizar la lista de modelos e índice de rutas",
41
+ "加载模型": "Cargar modelo",
42
+ "加载预训练底模D路径": "Cargue la ruta del modelo D base pre-entrenada.",
43
+ "加载预训练底模G路径": "Cargue la ruta del modelo G base pre-entrenada.",
44
+ "单次推理": "单次推理",
45
+ "卸载音色省显存": "Descargue la voz para ahorrar memoria GPU",
46
+ "变调(整数, 半音数量, 升八度12降八度-12)": "Cambio de tono (entero, número de semitonos, subir una octava +12 o bajar una octava -12)",
47
+ "后处理重采样至最终采样率,0为不进行重采样": "Remuestreo posterior al proceso a la tasa de muestreo final, 0 significa no remuestrear",
48
+ "否": "No",
49
+ "启用相位声码器": "启用相位声码器",
50
+ "响应阈值": "Umbral de respuesta",
51
+ "响度因子": "factor de sonoridad",
52
+ "处理数据": "Procesar datos",
53
+ "导出Onnx模型": "Exportar modelo Onnx",
54
+ "导出文件格式": "Formato de archivo de exportación",
55
+ "常见问题解答": "Preguntas frecuentes",
56
+ "常规设置": "Configuración general",
57
+ "开始音频转换": "Iniciar conversión de audio",
58
+ "很遗憾您这没有能用的显卡来支持您训练": "Lamentablemente, no tiene una tarjeta gráfica adecuada para soportar su entrenamiento",
59
+ "性能设置": "Configuración de rendimiento",
60
+ "总训练轮数total_epoch": "Total de épocas de entrenamiento (total_epoch)",
61
+ "批量推理": "批量推理",
62
+ "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认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).",
63
+ "指定输出主人声文件夹": "Especifique la carpeta de salida para la voz principal",
64
+ "指定输出文件夹": "Especificar carpeta de salida",
65
+ "指定输出非主人声文件夹": "Especifique la carpeta de salida para las voces no principales",
66
+ "推理时间(ms):": "Inferir tiempo (ms):",
67
+ "推理音色": "inferencia de voz",
68
+ "提取": "Extraer",
69
+ "提取音高和处理数据使用的CPU进程数": "Número de procesos de CPU utilizados para extraer el tono y procesar los datos",
70
+ "是": "Sí",
71
+ "是否仅保存最新的ckpt文件以节省硬盘空间": "Guardar solo el archivo ckpt más reciente para ahorrar espacio en disco",
72
+ "是否在每次保存时间点将最终小模型保存至weights文件夹": "Guardar pequeño modelo final en la carpeta 'weights' en cada punto de guardado",
73
+ "是否缓存所有训练集至显存. 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.",
74
+ "显卡信息": "información de la GPU",
75
+ "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</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.",
76
+ "查看": "Ver",
77
+ "查看模型信息(仅支持weights文件夹下提取的小模型文件)": "Ver información del modelo (solo aplicable a archivos de modelos pequeños extraídos de la carpeta 'pesos')",
78
+ "检索特征占比": "Proporción de función de búsqueda",
79
+ "模型": "Modelo",
80
+ "模型推理": "inferencia del modelo",
81
+ "模型提取(输入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",
82
+ "模型是否带音高指导": "Si el modelo tiene guía de tono.",
83
+ "模型是否带音高指导(唱歌一定要, 语音可以不要)": "Si el modelo tiene guía de tono (necesaria para cantar, pero no para hablar)",
84
+ "模型是否带音高指导,1是0否": "Si el modelo tiene guía de tono, 1 para sí, 0 para no",
85
+ "模型版本型号": "Versión y modelo del modelo",
86
+ "模型融合, 可用于测试音色融合": "Fusión de modelos, se puede utilizar para fusionar diferentes voces",
87
+ "模型路径": "Ruta del modelo",
88
+ "每张显卡的batch_size": "Tamaño del lote (batch_size) por tarjeta gráfica",
89
+ "淡入淡出长度": "Duración del fundido de entrada/salida",
90
+ "版本": "Versión",
91
+ "特征提取": "Extracción de características",
92
+ "特征检索库文件路径,为空则使用下拉的选择结果": "Ruta del archivo de la biblioteca de características, si está vacío, se utilizará el resultado de la selección desplegable",
93
+ "独占 WASAPI 设备": "独占 WASAPI 设备",
94
+ "男转女推荐+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.",
95
+ "目标采样率": "Tasa de muestreo objetivo",
96
+ "算法延迟(ms):": "算法延迟(ms):",
97
+ "自动检测index路径,下拉式选择(dropdown)": "Detección automática de la ruta del índice, selección desplegable (dropdown)",
98
+ "融合": "Fusión",
99
+ "要改的模型信息": "Información del modelo a modificar",
100
+ "要置入的模型信息": "Información del modelo a colocar.",
101
+ "训练": "Entrenamiento",
102
+ "训练模型": "Entrenar Modelo",
103
+ "训练特征索引": "Índice de características",
104
+ "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Entrenamiento finalizado, puede ver el registro de entrenamiento en la consola o en el archivo train.log en la carpeta del experimento",
105
+ "设备类型": "设备类型",
106
+ "请指定说话人id": "ID del modelo",
107
+ "请选择index文件": "Seleccione el archivo .index",
108
+ "请选择pth文件": "Seleccione el archivo .pth",
109
+ "请选择说话人id": "Seleccione una identificación de altavoz",
110
+ "转换": "Conversión",
111
+ "输入实验名": "Ingrese el nombre del modelo",
112
+ "输入待处理音频文件夹路径": "Ingrese la ruta a la carpeta de audio que se procesará",
113
+ "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Ingrese la ruta a la carpeta de audio que se procesará (simplemente cópiela desde la barra de direcciones del administrador de archivos)",
114
+ "输入待处理音频文件路径(默认是正确格式示例)": "Ingrese la ruta del archivo del audio que se procesará (el formato predeterminado es el ejemplo correcto)",
115
+ "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "Proporción de fusión para reemplazar el sobre de volumen de entrada con el sobre de volumen de salida, cuanto más cerca de 1, más se utiliza el sobre de salida",
116
+ "输入监听": "输入监听",
117
+ "输入训练文件夹路径": "Introduzca la ruta de la carpeta de entrenamiento",
118
+ "输入设备": "Dispositivo de entrada",
119
+ "输入降噪": "Reducción de ruido de entrada",
120
+ "输出信息": "Información de salida",
121
+ "输出变声": "输出变声",
122
+ "输出设备": "Dispositivo de salida",
123
+ "输出降噪": "Reducción de ruido de salida",
124
+ "输出音频(右下角三个点,点了可以下载)": "Salida de audio (haga clic en los tres puntos en la esquina inferior derecha para descargar)",
125
+ "选择.index文件": "Seleccione el archivo .index",
126
+ "选择.pth文件": "Seleccione el archivo .pth",
127
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "Seleccione el algoritmo de extracción de tono, las voces de entrada se pueden acelerar con pm, harvest tiene buenos graves pero es muy lento, crepe es bueno pero se come las GPUs",
128
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Seleccione el algoritmo de extracción de tono, use 'pm' para acelerar la entrada de canto, 'harvest' es bueno para los graves pero extremadamente lento, 'crepe' tiene buenos resultados pero consume GPU",
129
+ "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "Seleccione el algoritmo de extracción de tono: la canción de entrada se puede acelerar con pm, la voz de alta calidad pero CPU pobre se puede acelerar con dio, harvest es mejor pero más lento, rmvpe es el mejor y se come ligeramente la CPU/GPU",
130
+ "采样率:": "采样率:",
131
+ "采样长度": "Longitud de muestreo",
132
+ "重载设备列表": "Actualizar lista de dispositivos",
133
+ "音调设置": "Ajuste de tono",
134
+ "音频设备": "Dispositivo de audio",
135
+ "音高算法": "Algoritmo de tono",
136
+ "额外推理时长": "Tiempo de inferencia adicional"
137
+ }
RVC/i18n/locale/fr_FR.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": "Si >=3 : appliquer un filtrage médian aux résultats de la reconnaissance de la hauteur de récolte. La valeur représente le rayon du filtre et peut réduire la respiration.",
3
+ "A模型权重": "Poids (w) pour le modèle A :",
4
+ "A模型路径": "Chemin d'accès au modèle A :",
5
+ "B模型路径": "Chemin d'accès au modèle B :",
6
+ "E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
7
+ "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Fichier de courbe F0 (facultatif). Une hauteur par ligne. Remplace la fréquence fondamentale par défaut et la modulation de la hauteur :",
8
+ "Index Rate": "Taux d'indexation",
9
+ "Onnx导出": "Exporter en ONNX",
10
+ "Onnx输出路径": "Chemin d'exportation ONNX :",
11
+ "RVC模型路径": "Chemin du modèle RVC :",
12
+ "ckpt处理": "Traitement des fichiers .ckpt",
13
+ "harvest进程数": "Nombre de processus CPU utilisés pour l'algorithme de reconnaissance de la hauteur (pitch) dans le cadre de la récolte (harvest).",
14
+ "index文件路径不可包含中文": "Le chemin du fichier d'index ne doit pas contenir de caractères chinois.",
15
+ "pth文件路径不可包含中文": "Le chemin du fichier .pth ne doit pas contenir de caractères chinois.",
16
+ "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "Configuration des numéros de carte RMVPE : séparez les index GPU par des tirets \"-\", par exemple, 0-0-1 pour utiliser 2 processus sur GPU0 et 1 processus sur GPU1.",
17
+ "step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "Étape 1 : Remplissez la configuration expérimentale. Les données expérimentales sont stockées dans le dossier 'logs', avec chaque expérience ayant un dossier distinct. Entrez manuellement le chemin du nom de l'expérience, qui contient la configuration expérimentale, les journaux et les fichiers de modèle entraînés.",
18
+ "step1:正在处理数据": "Étape 1 : Traitement des données en cours.",
19
+ "step2:正在提取音高&正在提取特征": "Étape 2 : Extraction de la hauteur et extraction des caractéristiques en cours.",
20
+ "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "Étape 2a : Parcours automatique de tous les fichiers du dossier d'entraînement qui peuvent être décodés en fichiers audio et réalisation d'une normalisation par tranches. Génère 2 dossiers wav dans le répertoire de l'expérience. Actuellement, seule la formation avec un seul chanteur/locuteur est prise en charge.",
21
+ "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "Étape 2b : Utilisez le CPU pour extraire la hauteur (si le modèle le permet), utilisez le GPU pour extraire les caractéristiques (sélectionnez l'index du GPU) :",
22
+ "step3: 填写训练设置, 开始训练模型和索引": "Étape 3 : Remplissez les paramètres d'entraînement et démarrez l'entraînement du modèle ainsi que l'indexation.",
23
+ "step3a:正在训练模型": "Étape 3a : L'entraînement du modèle a commencé.",
24
+ "一键训练": "Entraînement en un clic",
25
+ "也可批量输入音频文件, 二选一, 优先读文件夹": "Il est également possible d'importer plusieurs fichiers audio. Si un chemin de dossier existe, cette entrée est ignorée.",
26
+ "人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单通道混响;<br>&emsp;(234)DeEcho:去除延迟效果。Aggressive比Normal去除得更彻底,DeReverb额外去除混响,可去除单声道混响,但是对高频重的板式混响去不干净。<br>去混响/去延迟,附:<br>1、DeEcho-DeReverb模型的耗时是另外2个DeEcho模型的接近2倍;<br>2、MDX-Net-Dereverb模型挺慢的;<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。": "Traitement en lot pour la séparation de la voix et de l'accompagnement vocal à l'aide du modèle UVR5.<br>Exemple d'un format de chemin de dossier valide : D:\\chemin\\vers\\dossier\\d'entrée (copiez-le depuis la barre d'adresse du gestionnaire de fichiers).<br>Le modèle est divisé en trois catégories :<br>1. Préserver la voix : Choisissez cette option pour l'audio sans harmonies. Elle préserve la voix mieux que HP5. Il comprend deux modèles intégrés : HP2 et HP3. HP3 peut légèrement laisser passer l'accompagnement mais préserve légèrement mieux la voix que HP2.<br>2. Préserver uniquement la voix principale : Choisissez cette option pour l'audio avec harmonies. Cela peut affaiblir la voix principale. Il comprend un modèle intégré : HP5.<br>3. Modèles de suppression de la réverbération et du délai (par FoxJoy) :<br>  (1) MDX-Net : Le meilleur choix pour la suppression de la réverbération stéréo, mais ne peut pas supprimer la réverbération mono.<br>  (234) DeEcho : Supprime les effets de délai. Le mode Aggressive supprime plus efficacement que le mode Normal. DeReverb supprime également la réverbération et peut supprimer la réverbération mono, mais pas très efficacement pour les contenus à haute fréquence fortement réverbérés.<br>Notes sur la suppression de la réverbération et du délai :<br>1. Le temps de traitement pour le modèle DeEcho-DeReverb est environ deux fois plus long que pour les autres deux modèles DeEcho.<br>2. Le modèle MDX-Net-Dereverb est assez lent.<br>3. La configuration la plus propre recommandée est d'appliquer d'abord MDX-Net, puis DeEcho-Aggressive.",
27
+ "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Entrez le(s) index GPU séparé(s) par '-', par exemple, 0-1-2 pour utiliser les GPU 0, 1 et 2 :",
28
+ "伴奏人声分离&去混响&去回声": "Séparation des voix/accompagnement et suppression de la réverbération",
29
+ "使用模型采样率": "使用模型采样率",
30
+ "使用设备采样率": "使用设备采样率",
31
+ "保存名": "Nom de sauvegarde :",
32
+ "保存的文件名, 默认空为和源文件同名": "Nom du fichier de sauvegarde (par défaut : identique au nom du fichier source) :",
33
+ "保存的模型名不带后缀": "Nom du modèle enregistré (sans extension) :",
34
+ "保存频率save_every_epoch": "Fréquence de sauvegarde (save_every_epoch) :",
35
+ "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "Protéger les consonnes sourdes et les bruits de respiration pour éviter les artefacts tels que le déchirement dans la musique électronique. Réglez à 0,5 pour désactiver. Diminuez la valeur pour renforcer la protection, mais cela peut réduire la précision de l'indexation :",
36
+ "修改": "Modifier",
37
+ "修改模型信息(仅支持weights文件夹下提取的小模型文件)": "Modifier les informations du modèle (uniquement pris en charge pour les petits fichiers de modèle extraits du dossier 'weights')",
38
+ "停止音频转换": "Arrêter la conversion audio",
39
+ "全流程结束!": "Toutes les étapes ont été terminées !",
40
+ "刷新音色列表和索引路径": "Actualiser la liste des voix et le vers l'index.",
41
+ "加载模型": "Charger le modèle.",
42
+ "加载预训练底模D路径": "Charger le chemin du modèle de base pré-entraîné D :",
43
+ "加载预训练底模G路径": "Charger le chemin du modèle de base pré-entraîné G :",
44
+ "单次推理": "单次推理",
45
+ "卸载音色省显存": "Décharger la voix pour économiser la mémoire GPU.",
46
+ "变调(整数, 半音数量, 升八度12降八度-12)": "Transposer (entier, nombre de demi-tons, monter d'une octave : 12, descendre d'une octave : -12) :",
47
+ "后处理重采样至最终采样率,0为不进行重采样": "Rééchantillonner l'audio de sortie en post-traitement à la fréquence d'échantillonnage finale. Réglez sur 0 pour ne pas effectuer de rééchantillonnage :",
48
+ "否": "Non",
49
+ "启用相位声码器": "启用相位声码器",
50
+ "响应阈值": "Seuil de réponse",
51
+ "响度因子": "Facteur de volume sonore",
52
+ "处理数据": "Traitement des données",
53
+ "导出Onnx模型": "Exporter le modèle au format ONNX.",
54
+ "导出文件格式": "Format de fichier d'exportation",
55
+ "常见问题解答": "FAQ (Foire Aux Questions)",
56
+ "常规设置": "Paramètres généraux",
57
+ "开始音频转换": "Démarrer la conversion audio.",
58
+ "很遗憾您这没有能用的显卡来支持您训练": "Malheureusement, il n'y a pas de GPU compatible disponible pour prendre en charge votre entrainement.",
59
+ "性能设置": "Paramètres de performance",
60
+ "总训练轮数total_epoch": "Nombre total d'époques d'entraînement (total_epoch) :",
61
+ "批量推理": "批量推理",
62
+ "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "Conversion en lot. Entrez le dossier contenant les fichiers audio à convertir ou téléchargez plusieurs fichiers audio. Les fichiers audio convertis seront enregistrés dans le dossier spécifié (par défaut : 'opt').",
63
+ "指定输出主人声文件夹": "Spécifiez le dossier de sortie pour les fichiers de voix :",
64
+ "指定输出文件夹": "Spécifiez le dossier de sortie :",
65
+ "指定输出非主人声文件夹": "Spécifiez le dossier de sortie pour l'accompagnement :",
66
+ "推理时间(ms):": "Temps d'inférence (ms) :",
67
+ "推理音色": "Voix pour l'inférence",
68
+ "提取": "Extraire",
69
+ "提取音高和处理数据使用的CPU进程数": "Nombre de processus CPU utilisés pour l'extraction de la hauteur et le traitement des données :",
70
+ "是": "Oui",
71
+ "是否仅保存最新的ckpt文件以节省硬盘空间": "Enregistrer uniquement le dernier fichier '.ckpt' pour économiser de l'espace disque :",
72
+ "是否在每次保存时间点将最终小模型保存至weights文件夹": "Enregistrer un petit modèle final dans le dossier 'weights' à chaque point de sauvegarde :",
73
+ "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "Mettre en cache tous les ensembles d'entrainement dans la mémoire GPU. Mettre en cache de petits ensembles de données (moins de 10 minutes) peut accélérer l'entrainement, mais mettre en cache de grands ensembles de données consommera beaucoup de mémoire GPU et peut ne pas apporter beaucoup d'amélioration de vitesse :",
74
+ "显卡信息": "Informations sur la carte graphique (GPU)",
75
+ "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "Ce logiciel est open source sous la licence MIT. L'auteur n'a aucun contrôle sur le logiciel. Les utilisateurs qui utilisent le logiciel et distribuent les sons exportés par le logiciel en sont entièrement responsables. <br>Si vous n'acceptez pas cette clause, vous ne pouvez pas utiliser ou faire référence à aucun code ni fichier contenu dans le package logiciel. Consultez le fichier <b>Agreement-LICENSE.txt</b> dans le répertoire racine pour plus de détails.",
76
+ "查看": "Voir",
77
+ "查看模型信息(仅支持weights文件夹下提取的小模型文件)": "Afficher les informations sur le modèle (uniquement pour les petits fichiers de modèle extraits du dossier \"weights\")",
78
+ "检索特征占比": "Rapport de recherche de caractéristiques (contrôle l'intensité de l'accent, un rapport trop élevé provoque des artefacts) :",
79
+ "模型": "Modèle",
80
+ "模型推理": "Inférence du modèle",
81
+ "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "Extraction du modèle (saisissez le chemin d'accès au modèle du grand fichier dans le dossier \"logs\"). Cette fonction est utile si vous souhaitez arrêter l'entrainement à mi-chemin et extraire et enregistrer manuellement un petit fichier de modèle, ou si vous souhaitez tester un modèle intermédiaire :",
82
+ "模型是否带音高指导": "Indique si le modèle dispose d'un guidage en hauteur :",
83
+ "模型是否带音高指导(唱歌一定要, 语音可以不要)": "Indique si le modèle dispose d'un système de guidage de la hauteur (obligatoire pour le chant, facultatif pour la parole) :",
84
+ "模型是否带音高指导,1是0否": "Le modèle dispose-t-il d'un guide de hauteur (1 : oui, 0 : non) ?",
85
+ "模型版本型号": "Version de l'architecture du modèle :",
86
+ "模型融合, 可用于测试音色融合": "Fusion de modèles, peut être utilisée pour tester la fusion de timbres",
87
+ "模型路径": "Le chemin vers le modèle :",
88
+ "每张显卡的batch_size": "Taille du batch par GPU :",
89
+ "淡入淡出长度": "Longueur de la transition",
90
+ "版本": "Version",
91
+ "特征提取": "Extraction des caractéristiques",
92
+ "特征检索库文件路径,为空则使用下拉的选择结果": "Chemin d'accès au fichier d'index des caractéristiques. Laisser vide pour utiliser le résultat sélectionné dans la liste déroulante :",
93
+ "独占 WASAPI 设备": "独占 WASAPI 设备",
94
+ "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Il est recommandé d'utiliser la clé +12 pour la conversion homme-femme et la clé -12 pour la conversion femme-homme. Si la plage sonore est trop large et que la voix est déformée, vous pouvez également l'ajuster vous-même à la plage appropriée.",
95
+ "目标采样率": "Taux d'échantillonnage cible :",
96
+ "算法延迟(ms):": "Délais algorithmiques (ms):",
97
+ "自动检测index路径,下拉式选择(dropdown)": "Détecter automatiquement le chemin d'accès à l'index et le sélectionner dans la liste déroulante :",
98
+ "融合": "Fusion",
99
+ "要改的模型信息": "Informations sur le modèle à modifier :",
100
+ "要置入的模型信息": "Informations sur le modèle à placer :",
101
+ "训练": "Entraîner",
102
+ "训练模型": "Entraîner le modèle",
103
+ "训练特征索引": "Entraîner l'index des caractéristiques",
104
+ "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Entraînement terminé. Vous pouvez consulter les rapports d'entraînement dans la console ou dans le fichier 'train.log' situé dans le dossier de l'expérience.",
105
+ "设备类型": "设备类型",
106
+ "请指定说话人id": "Veuillez spécifier l'ID de l'orateur ou du chanteur :",
107
+ "请选择index文件": "Veuillez sélectionner le fichier d'index",
108
+ "请选择pth文件": "Veuillez sélectionner le fichier pth",
109
+ "请选择说话人id": "Sélectionner l'ID de l'orateur ou du chanteur :",
110
+ "转换": "Convertir",
111
+ "输入实验名": "Saisissez le nom de l'expérience :",
112
+ "输入待处理音频文件夹路径": "Entrez le chemin du dossier audio à traiter :",
113
+ "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Entrez le chemin du dossier audio à traiter (copiez-le depuis la barre d'adresse du gestionnaire de fichiers) :",
114
+ "输入待处理音频文件路径(默认是正确格式示例)": "Entrez le chemin d'accès du fichier audio à traiter (par défaut, l'exemple de format correct) :",
115
+ "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "Ajustez l'échelle de l'enveloppe de volume. Plus il est proche de 0, plus il imite le volume des voix originales. Cela peut aider à masquer les bruits et à rendre le volume plus naturel lorsqu'il est réglé relativement bas. Plus le volume est proche de 1, plus le volume sera fort et constant :",
116
+ "输入监听": "Moniteur vocal d'entrée",
117
+ "输入训练文件夹路径": "Indiquez le chemin d'accès au dossier d'entraînement :",
118
+ "输入设备": "Dispositif d'entrée",
119
+ "输入降噪": "Réduction du bruit d'entrée",
120
+ "输出信息": "Informations sur la sortie",
121
+ "输出变声": "Sortie voix convertie",
122
+ "输出设备": "Dispositif de sortie",
123
+ "输出降噪": "Réduction du bruit de sortie",
124
+ "输出音频(右下角三个点,点了可以下载)": "Exporter l'audio (cliquer sur les trois points dans le coin inférieur droit pour télécharger)",
125
+ "选择.index文件": "Sélectionner le fichier .index",
126
+ "选择.pth文件": "Sélectionner le fichier .pth",
127
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "Sélection de l'algorithme d'extraction de la hauteur, les voix d'entrée peuvent être accélérées avec pm, harvest a de bonnes basses mais est très lent, crepe est bon mais consomme beaucoup de ressources GPU.",
128
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Sélectionnez l'algorithme d'extraction de la hauteur de ton (\"pm\" : extraction plus rapide mais parole de moindre qualité ; \"harvest\" : meilleure basse mais extrêmement lente ; \"crepe\" : meilleure qualité mais utilisation intensive du GPU), \"rmvpe\" : meilleure qualité et peu d'utilisation du GPU.",
129
+ "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "Sélection de l'algorithme d'extraction de la hauteur : la chanson d'entrée peut être traitée plus rapidement par pm, avec une voix de haute qualité mais un CPU médiocre, par dio, harvest est meilleur mais plus lent, rmvpe est le meilleur, mais consomme légèrement le CPU/GPU.",
130
+ "采样率:": "采样率:",
131
+ "采样长度": "Longueur de l'échantillon",
132
+ "重载设备列表": "Recharger la liste des dispositifs",
133
+ "音调设置": "Réglages de la hauteur",
134
+ "音频设备": "Périphérique audio",
135
+ "音高算法": "algorithme de détection de la hauteur",
136
+ "额外推理时长": "Temps d'inférence supplémentaire"
137
+ }
RVC/i18n/locale/it_IT.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": "Se >=3: applica il filtro mediano ai risultati del pitch raccolto. ",
3
+ "A模型权重": "Peso (w) per il modello A:",
4
+ "A模型路径": "Percorso per il modello A:",
5
+ "B模型路径": "Percorso per il modello B:",
6
+ "E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
7
+ "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "File curva F0 (opzionale). ",
8
+ "Index Rate": "Tasso di indice",
9
+ "Onnx导出": "Esporta Onnx",
10
+ "Onnx输出路径": "Percorso di esportazione Onnx:",
11
+ "RVC模型路径": "Percorso modello RVC:",
12
+ "ckpt处理": "Elaborazione ckpt",
13
+ "harvest进程数": "harvest进程数",
14
+ "index文件路径不可包含中文": "index文件路径不可包含中文",
15
+ "pth文件路径不可包含中文": "pth è un'app per il futuro",
16
+ "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程",
17
+ "step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "Passaggio 1: compilare la configurazione sperimentale. ",
18
+ "step1:正在处理数据": "Passaggio 1: elaborazione dei dati",
19
+ "step2:正在提取音高&正在提取特征": "step2:正在提取音高&正在提取特征",
20
+ "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "Passaggio 2a: attraversa automaticamente tutti i file nella cartella di addestramento che possono essere decodificati in audio ed esegui la normalizzazione delle sezioni. ",
21
+ "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "Passaggio 2b: utilizzare la CPU per estrarre il tono (se il modello ha il tono), utilizzare la GPU per estrarre le caratteristiche (selezionare l'indice GPU):",
22
+ "step3: 填写训练设置, 开始训练模型和索引": "Passaggio 3: compilare le impostazioni di addestramento e avviare l'addestramento del modello e dell'indice",
23
+ "step3a:正在训练模型": "Passaggio 3a: è iniziato l'addestramento del modello",
24
+ "一键训练": "Addestramento con un clic",
25
+ "也可批量输入音频文件, 二选一, 优先读文件夹": "也可批量输入音频文件, 二选一, 优先读文件夹",
26
+ "人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单通道混响;<br>&emsp;(234)DeEcho:去除延迟效果。Aggressive比Normal去除得更彻底,DeReverb额外去除混响,可去除单声道混响,但是对高频重的板式混响去不干净。<br>去混响/去延迟,附:<br>1、DeEcho-DeReverb模型的耗时是另外2个DeEcho模型的接近2倍;<br>2、MDX-Net-Dereverb模型挺慢的;<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。": "Elaborazione batch per la separazione dell'accompagnamento vocale utilizzando il modello UVR5.<br>Esempio di un formato di percorso di cartella valido: D:\\path\\to\\input\\folder (copialo dalla barra degli indirizzi del file manager).<br>Il modello è suddiviso in tre categorie:<br>1. Conserva la voce: scegli questa opzione per l'audio senza armonie. <br>2. Mantieni solo la voce principale: scegli questa opzione per l'audio con armonie. <br>3. Modelli di de-riverbero e de-delay (di FoxJoy):<br>  (1) MDX-Net: la scelta migliore per la rimozione del riverbero stereo ma non può rimuovere il riverbero mono;<br><br>Note di de-riverbero/de-delay:<br>1. Il tempo di elaborazione per il modello DeEcho-DeReverb è circa il doppio rispetto agli altri due modelli DeEcho.<br>2. Il modello MDX-Net-Dereverb è piuttosto lento.<br>3. La configurazione più pulita consigliata consiste nell'applicare prima MDX-Net e poi DeEcho-Aggressive.",
27
+ "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Inserisci gli indici GPU separati da '-', ad esempio 0-1-2 per utilizzare GPU 0, 1 e 2:",
28
+ "伴奏人声分离&去混响&去回声": "Separazione voce/accompagnamento",
29
+ "使用模型采样率": "使用模型采样率",
30
+ "使用设备采样率": "使用设备采样率",
31
+ "保存名": "Salva nome:",
32
+ "保存的文件名, 默认空为和源文件同名": "Salva il nome del file (predefinito: uguale al file di origine):",
33
+ "保存的模型名不带后缀": "Nome del modello salvato (senza estensione):",
34
+ "保存频率save_every_epoch": "Frequenza di salvataggio (save_every_epoch):",
35
+ "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "Proteggi le consonanti senza voce e i suoni del respiro per evitare artefatti come il tearing nella musica elettronica. ",
36
+ "修改": "Modificare",
37
+ "修改模型信息(仅支持weights文件夹下提取的小模型文件)": "Modifica le informazioni sul modello (supportato solo per i file di modello di piccole dimensioni estratti dalla cartella 'weights')",
38
+ "停止音频转换": "Arresta la conversione audio",
39
+ "全流程结束!": "Tutti i processi sono stati completati!",
40
+ "刷新音色列表和索引路径": "Aggiorna l'elenco delle voci e il percorso dell'indice",
41
+ "加载模型": "Carica modello",
42
+ "加载预训练底模D路径": "Carica il percorso D del modello base pre-addestrato:",
43
+ "加载预训练底模G路径": "Carica il percorso G del modello base pre-addestrato:",
44
+ "单次推理": "单次推理",
45
+ "卸载音色省显存": "Scarica la voce per risparmiare memoria della GPU:",
46
+ "变调(整数, 半音数量, 升八度12降八度-12)": "Trasposizione (numero intero, numero di semitoni, alza di un'ottava: 12, abbassa di un'ottava: -12):",
47
+ "后处理重采样至最终采样率,0为不进行重采样": "Ricampiona l'audio di output in post-elaborazione alla frequenza di campionamento finale. ",
48
+ "否": "NO",
49
+ "启用相位声码器": "启用相位声码器",
50
+ "响应阈值": "Soglia di risposta",
51
+ "响度因子": "fattore di sonorità",
52
+ "处理数据": "Processa dati",
53
+ "导出Onnx模型": "Esporta modello Onnx",
54
+ "导出文件格式": "Formato file di esportazione",
55
+ "常见问题解答": "FAQ (Domande frequenti)",
56
+ "常规设置": "Impostazioni generali",
57
+ "开始音频转换": "Avvia la conversione audio",
58
+ "很遗憾您这没有能用的显卡来支持您训练": "Sfortunatamente, non è disponibile alcuna GPU compatibile per supportare l'addestramento.",
59
+ "性能设置": "Impostazioni delle prestazioni",
60
+ "总训练轮数total_epoch": "Epoch totali di addestramento (total_epoch):",
61
+ "批量推理": "批量推理",
62
+ "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "Conversione massiva. Inserisci il percorso della cartella che contiene i file da convertire o carica più file audio. I file convertiti finiranno nella cartella specificata. (default: opt) ",
63
+ "指定输出主人声文件夹": "Specifica la cartella di output per le voci:",
64
+ "指定输出文件夹": "Specifica la cartella di output:",
65
+ "指定输出非主人声文件夹": "Specificare la cartella di output per l'accompagnamento:",
66
+ "推理时间(ms):": "Tempo di inferenza (ms):",
67
+ "推理音色": "Voce di inferenza:",
68
+ "提取": "Estrai",
69
+ "提取音高和处理数据使用的CPU进程数": "Numero di processi CPU utilizzati per l'estrazione del tono e l'elaborazione dei dati:",
70
+ "是": "SÌ",
71
+ "是否仅保存最新的ckpt文件以节省硬盘空间": "Salva solo l'ultimo file '.ckpt' per risparmiare spazio su disco:",
72
+ "是否在每次保存时间点将最终小模型保存至weights文件夹": "Salva un piccolo modello finale nella cartella \"weights\" in ogni punto di salvataggio:",
73
+ "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "Memorizza nella cache tutti i set di addestramento nella memoria della GPU. ",
74
+ "显卡信息": "Informazioni GPU",
75
+ "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "Questo software è open source con licenza MIT. <br>Se non si accetta questa clausola, non è possibile utilizzare o fare riferimento a codici e file all'interno del pacchetto software. <b>Contratto-LICENZA.txt</b> per dettagli.",
76
+ "查看": "Visualizzazione",
77
+ "查看模型信息(仅支持weights文件夹下提取的小模型文件)": "Visualizza le informazioni sul modello (supportato solo per file di modello piccoli estratti dalla cartella 'weights')",
78
+ "检索特征占比": "Rapporto funzionalità di ricerca (controlla la forza dell'accento, troppo alto ha artefatti):",
79
+ "模型": "Modello",
80
+ "模型推理": "Inferenza del modello",
81
+ "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "Estrazione del modello (inserire il percorso del modello di file di grandi dimensioni nella cartella \"logs\"). ",
82
+ "模型是否带音高指导": "Se il modello ha una guida del tono:",
83
+ "模型是否带音高指导(唱歌一定要, 语音可以不要)": "Se il modello ha una guida del tono (necessario per il canto, facoltativo per il parlato):",
84
+ "模型是否带音高指导,1是0否": "Se il modello ha una guida del tono (1: sì, 0: no):",
85
+ "模型版本型号": "Versione dell'architettura del modello:",
86
+ "模型融合, 可用于测试音色融合": "Model fusion, può essere utilizzato per testare la fusione timbrica",
87
+ "模型路径": "Percorso al modello:",
88
+ "每张显卡的batch_size": "Dimensione batch per GPU:",
89
+ "淡入淡出长度": "Lunghezza dissolvenza",
90
+ "版本": "Versione",
91
+ "特征提取": "Estrazione delle caratteristiche",
92
+ "特征检索库文件路径,为空则使用下拉的选择结果": "Percorso del file di indice delle caratteristiche. ",
93
+ "独占 WASAPI 设备": "独占 WASAPI 设备",
94
+ "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Tonalità +12 consigliata per la conversione da maschio a femmina e tonalità -12 per la conversione da femmina a maschio. ",
95
+ "目标采样率": "Frequenza di campionamento target:",
96
+ "算法延迟(ms):": "算法延迟(ms):",
97
+ "自动检测index路径,下拉式选择(dropdown)": "Rileva automaticamente il percorso dell'indice e seleziona dal menu a tendina:",
98
+ "融合": "Fusione",
99
+ "要改的模型信息": "Informazioni sul modello da modificare:",
100
+ "要置入的模型信息": "Informazioni sul modello da posizionare:",
101
+ "训练": "Addestramento",
102
+ "训练模型": "Addestra modello",
103
+ "训练特征索引": "Addestra indice delle caratteristiche",
104
+ "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Addestramento completato. ",
105
+ "设备类型": "设备类型",
106
+ "请指定说话人id": "Si prega di specificare l'ID del locutore/cantante:",
107
+ "请选择index文件": "请选择index文件",
108
+ "请选择pth文件": "请选择pth 文件",
109
+ "请选择说话人id": "Seleziona ID locutore/cantante:",
110
+ "转换": "Convertire",
111
+ "输入实验名": "Inserisci il nome dell'esperimento:",
112
+ "输入待处理音频文件夹路径": "Immettere il percorso della cartella audio da elaborare:",
113
+ "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Immettere il percorso della cartella audio da elaborare (copiarlo dalla barra degli indirizzi del file manager):",
114
+ "输入待处理音频文件路径(默认是正确格式示例)": "Immettere il percorso del file audio da elaborare (l'impostazione predefinita è l'esempio di formato corretto):",
115
+ "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "Regola il ridimensionamento dell'inviluppo del volume. ",
116
+ "输入监听": "输入监听",
117
+ "输入训练文件夹路径": "Inserisci il percorso della cartella di addestramento:",
118
+ "输入设备": "Dispositivo di input",
119
+ "输入降噪": "Riduzione del rumore in ingresso",
120
+ "输出信息": "Informazioni sull'uscita",
121
+ "输出变声": "输出变声",
122
+ "输出设备": "Dispositivo di uscita",
123
+ "输出降噪": "Riduzione del rumore in uscita",
124
+ "输出音频(右下角三个点,点了可以下载)": "Esporta audio (clicca sui tre puntini in basso a destra per scaricarlo)",
125
+ "选择.index文件": "Seleziona il file .index",
126
+ "选择.pth文件": "Seleziona il file .pth",
127
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
128
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Seleziona l'algoritmo di estrazione del tono (\"pm\": estrazione più veloce ma risultato di qualità inferiore; \"harvest\": bassi migliori ma estremamente lenti; \"crepe\": qualità migliore ma utilizzo intensivo della GPU):",
129
+ "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
130
+ "采样率:": "采样率:",
131
+ "采样长度": "Lunghezza del campione",
132
+ "重载设备列表": "Ricaricare l'elenco dei dispositivi",
133
+ "音调设置": "Impostazioni del tono",
134
+ "音频设备": "Dispositivo audio",
135
+ "音高算法": "音高算法",
136
+ "额外推理时长": "Tempo di inferenza extra"
137
+ }
RVC/i18n/locale/ja_JP.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": ">=3 次に、harvestピッチの認識結果に対してメディアンフィルタを使用します。値はフィルター半径で、ミュートを減衰させるために使用します。",
3
+ "A模型权重": "Aモデルの重み",
4
+ "A模型路径": "Aモデルのパス",
5
+ "B模型路径": "Bモデルのパス",
6
+ "E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
7
+ "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0(最低共振周波数)カーブファイル(オプション、1行に1ピッチ、デフォルトのF0(最低共振周波数)とエレベーションを置き換えます。)",
8
+ "Index Rate": "Index Rate",
9
+ "Onnx导出": "Onnxエクスポート",
10
+ "Onnx输出路径": "Onnx出力パス",
11
+ "RVC模型路径": "RVCモデルパス",
12
+ "ckpt处理": "ckptファイルの処理",
13
+ "harvest进程数": "harvestプロセス数",
14
+ "index文件路径不可包含中文": "indexファイルのパスに漢字を含んではいけません",
15
+ "pth文件路径不可包含中文": "pthファイルのパスに漢字を含んではいけません",
16
+ "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "rmvpeカード番号設定:異なるプロセスに使用するカード番号を入力する。例えば、0-0-1でカード0に2つのプロセス、カード1に1つのプロセスを実行する。",
17
+ "step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "ステップ1:実験設定を入力します。実験データはlogsに保存され、各実験にはフォルダーがあります。実験名のパスを手動で入力する必要があり、実験設定、ログ、トレーニングされたモデルファイルが含まれます。",
18
+ "step1:正在处理数据": "step1:処理中のデータ",
19
+ "step2:正在提取音高&正在提取特征": "step2:ピッチ抽出と特徴抽出",
20
+ "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "ステップ2a: 訓練フォルダー内のすべての音声ファイルを自動的に探索し、スライスと正規化を行い、2つのwavフォルダーを実験ディレクトリに生成します。現在は一人でのトレーニングのみをサポートしています。",
21
+ "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "ステップ2b: CPUを使用して音高を抽出する(モデルに音高がある場合)、GPUを使用して特徴を抽出する(GPUの番号を選択する)",
22
+ "step3: 填写训练设置, 开始训练模型和索引": "ステップ3: トレーニング設定を入力して、モデルとインデックスのトレーニングを開始します",
23
+ "step3a:正在训练模型": "step3a:トレーニング中のモデル",
24
+ "一键训练": "ワンクリックトレーニング",
25
+ "也可批量输入音频文件, 二选一, 优先读文件夹": "複数のオーディオファイルをインポートすることもできます。フォルダパスが存在する場合、この入力は無視されます。",
26
+ "人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单通道混响;<br>&emsp;(234)DeEcho:去除延迟效果。Aggressive比Normal去除得更彻底,DeReverb额外去除混响,可去除单声道混响,但是对高频重的板式混响去不干净。<br>去混响/去延迟,附:<br>1、DeEcho-DeReverb模型的耗时是另外2个DeEcho模型的接近2倍;<br>2、MDX-Net-Dereverb模型挺慢的;<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。": "UVR5モデルを使用したボーカル伴奏の分離バッチ処理。<br>有効なフォルダーパスフォーマットの例: D:\\path\\to\\input\\folder (エクスプローラーのアドレスバーからコピーします)。<br>モデルは三つのカテゴリに分かれています:<br>1. ボーカルを保持: ハーモニーのないオーディオに対してこれを選択します。HP5よりもボーカルをより良く保持します。HP2とHP3の二つの内蔵モデルが含まれています。HP3は伴奏をわずかに漏らす可能性がありますが、HP2よりもわずかにボーカルをより良く保持します。<br>2. 主なボーカルのみを保持: ハーモニーのあるオーディオに対してこれを選択します。主なボーカルを弱める可能性があります。HP5の一つの内蔵モデルが含まれています。<br>3. ディリバーブとディレイモデル (by FoxJoy):<br>  (1) MDX-Net: ステレオリバーブの除去に最適な選択肢ですが、モノリバーブは除去できません;<br>&emsp;(234) DeEcho: ディレイ効果を除去します。AggressiveモードはNormalモードよりも徹底的に除去します。DeReverbはさらにリバーブを除去し、モノリバーブを除去することができますが、高周波のリバーブが強い内容に対しては非常に効果的ではありません。<br>ディリバーブ/ディレイに関する注意点:<br>1. DeEcho-DeReverbモデルの処理時間は、他の二つのDeEchoモデルの約二倍です。<br>2. MDX-Net-Dereverbモデルは非常に遅いです。<br>3. 推奨される最もクリーンな設定は、最初にMDX-Netを適用し、その後にDeEcho-Aggressiveを適用することです。",
27
+ "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "ハイフンで区切って使用するGPUの番号を入力します。例えば0-1-2はGPU0、GPU1、GPU2を使用します",
28
+ "伴奏人声分离&去混响&去回声": "伴奏ボーカル分離&残響除去&エコー除去",
29
+ "使用模型采样率": "使用模型采样率",
30
+ "使用设备采样率": "使用设备采样率",
31
+ "保存名": "保存ファイル名",
32
+ "保存的文件名, 默认空为和源文件同名": "保存するファイル名、デフォルトでは空欄で元のファイル名と同じ名前になります",
33
+ "保存的模型名不带后缀": "拡張子のない保存するモデル名",
34
+ "保存频率save_every_epoch": "エポックごとの保存頻度",
35
+ "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "明確な子音と呼吸音を保護し、電子音の途切れやその他のアーティファクトを防止します。0.5でオフになります。下げると保護が強化されますが、indexの効果が低下する可能性があります。",
36
+ "修改": "変更",
37
+ "修改模型信息(仅支持weights文件夹下提取的小模型文件)": "モデル情報の修正(weightsフォルダから抽出された小さなモデルファイルのみ対応)",
38
+ "停止音频转换": "音声変換を停止",
39
+ "全流程结束!": "全工程が完了!",
40
+ "刷新音色列表和索引路径": "音源リストとインデックスパスの更新",
41
+ "加载模型": "モデルをロード",
42
+ "加载预训练底模D路径": "事前学習済みのDモデルのパス",
43
+ "加载预训练底模G路径": "事前学習済みのGモデルのパス",
44
+ "单次推理": "单次推理",
45
+ "卸载音色省显存": "音源を削除してメモリを節約",
46
+ "变调(整数, 半音数量, 升八度12降八度-12)": "ピッチ変更(整数、半音数、上下オクターブ12-12)",
47
+ "后处理重采样至最终采样率,0为不进行重采样": "最終的なサンプリングレートへのポストプロセッシングのリサンプリング リサンプリングしない場合は0",
48
+ "否": "いいえ",
49
+ "启用相位声码器": "启用相位声码器",
50
+ "响应阈值": "反応閾値",
51
+ "响度因子": "ラウドネス係数",
52
+ "处理数据": "データ処理",
53
+ "导出Onnx模型": "Onnxに変換",
54
+ "导出文件格式": "エクスポート形式",
55
+ "常见问题解答": "よくある質問",
56
+ "常规设置": "一般設定",
57
+ "开始音频转换": "音声変換を開始",
58
+ "很遗憾您这没有能用的显卡来支持您训练": "トレーニングに対応したGPUが動作しないのは残念です。",
59
+ "性能设置": "パフォーマンス設定",
60
+ "总训练轮数total_epoch": "総エポック数",
61
+ "批量推理": "批量推理",
62
+ "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "一括変換、変換する音声フォルダを入力、または複数の音声ファイルをアップロードし、指定したフォルダ(デフォルトのopt)に変換した音声を出力します。",
63
+ "指定输出主人声文件夹": "マスターの出力音声フォルダーを指定する",
64
+ "指定输出文件夹": "出力フォルダを指定してください",
65
+ "指定输出非主人声文件夹": "マスター以外の出力音声フォルダーを指定する",
66
+ "推理时间(ms):": "推論時間(ms):",
67
+ "推理音色": "音���推論",
68
+ "提取": "抽出",
69
+ "提取音高和处理数据使用的CPU进程数": "ピッチの抽出やデータ処理に使用するCPUスレッド数",
70
+ "是": "はい",
71
+ "是否仅保存最新的ckpt文件以节省硬盘空间": "ハードディスク容量を節約するため、最新のckptファイルのみを保存しますか?",
72
+ "是否在每次保存时间点将最终小模型保存至weights文件夹": "各保存時点の小モデルを全部weightsフォルダに保存するかどうか",
73
+ "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "すべてのトレーニングデータをメモリにキャッシュするかどうか。10分以下の小さなデータはキャッシュしてトレーニングを高速化できますが、大きなデータをキャッシュするとメモリが破裂し、あまり速度が上がりません。",
74
+ "显卡信息": "GPU情報",
75
+ "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "本ソフトウェアはMITライセンスに基づくオープンソースであり、製作者は本ソフトウェアに対していかなる責任を持ちません。本ソフトウェアの利用者および本ソフトウェアから派生した音源(成果物)を配布する者は、本ソフトウェアに対して自身で責任を負うものとします。 <br>この条項に同意しない場合、パッケージ内のコードやファイルを使用や参照を禁じます。詳しくは<b>LICENSE</b>をご覧ください。",
76
+ "查看": "表示",
77
+ "查看模型信息(仅支持weights文件夹下提取的小模型文件)": "モデル情報を表示する(小さいモデルファイルはweightsフォルダーからのみサポートされています)",
78
+ "检索特征占比": "検索特徴率",
79
+ "模型": "モデル",
80
+ "模型推理": "モデル推論",
81
+ "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "モデル抽出(ログフォルダー内の大きなファイルのモデルパスを入力)、モデルを半分までトレーニングし、自動的に小さいファイルモデルを保存しなかったり、中間モデルをテストしたい場合に適用されます。",
82
+ "模型是否带音高指导": "モデルに音高ガイドを付けるかどうか",
83
+ "模型是否带音高指导(唱歌一定要, 语音可以不要)": "モデルに音高ガイドがあるかどうか(歌唱には必要ですが、音声には必要ありません)",
84
+ "模型是否带音高指导,1是0否": "モデルに音高ガイドを付けるかどうか、1は付ける、0は付けない",
85
+ "模型版本型号": "モデルのバージョン",
86
+ "模型融合, 可用于测试音色融合": "モデルのマージ、音源のマージテストに使用できます",
87
+ "模型路径": "モデルパス",
88
+ "每张显卡的batch_size": "GPUごとのバッチサイズ",
89
+ "淡入淡出长度": "フェードイン/フェードアウト長",
90
+ "版本": "バージョン",
91
+ "特征提取": "特徴抽出",
92
+ "特征检索库文件路径,为空则使用下拉的选择结果": "特徴検索ライブラリへのパス 空の場合はドロップダウンで選択",
93
+ "独占 WASAPI 设备": "独占 WASAPI 设备",
94
+ "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性から女性へは+12キーをお勧めします。女性から男性へは-12キーをお勧めします。音域が広すぎて音質が劣化した場合は、適切な音域に自分で調整してください。",
95
+ "目标采样率": "目標サンプリングレート",
96
+ "算法延迟(ms):": "算法延迟(ms):",
97
+ "自动检测index路径,下拉式选择(dropdown)": "インデックスパスの自動検出 ドロップダウンで選択",
98
+ "融合": "マージ",
99
+ "要改的模型信息": "変更するモデル情報",
100
+ "要置入的模型信息": "挿入するモデル情報",
101
+ "训练": "トレーニング",
102
+ "训练模型": "モデルのトレーニング",
103
+ "训练特征索引": "特徴インデックスのトレーニング",
104
+ "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "トレーニング終了時に、トレーニングログやフォルダ内のtrain.logを確認することができます",
105
+ "设备类型": "设备类型",
106
+ "请指定说话人id": "話者IDを指定してください",
107
+ "请选择index文件": "indexファイルを選択してください",
108
+ "请选择pth文件": "pthファイルを選択してください",
109
+ "请选择说话人id": "話者IDを選択してください",
110
+ "转换": "変換",
111
+ "输入实验名": "モデル名",
112
+ "输入待处理音频文件夹路径": "処理するオーディオファイルのフォルダパスを入力してください",
113
+ "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "処理対象音声フォルダーのパスを入力してください(エクスプローラーのアドレスバーからコピーしてください)",
114
+ "输入待处理音频文件路径(默认是正确格式示例)": "処理対象音声ファイルのパスを入力してください(デフォルトは正しいフォーマットの例です)",
115
+ "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "入力ソースの音量エンベロープと出力音量エンベロープの融合率 1に近づくほど、出力音量エンベロープの割合が高くなる",
116
+ "输入监听": "输入监听",
117
+ "输入训练文件夹路径": "トレーニング用フォルダのパスを入力してください",
118
+ "输入设备": "入力デバイス",
119
+ "输入降噪": "入力ノイズの低減",
120
+ "输出信息": "出力情報",
121
+ "输出变声": "输出变声",
122
+ "输出设备": "出力デバイス",
123
+ "输出降噪": "出力ノイズの低減",
124
+ "输出音频(右下角三个点,点了可以下载)": "出力音声(右下の三点をクリックしてダウンロードできます)",
125
+ "选择.index文件": ".indexファイルを選択",
126
+ "选择.pth文件": ".pthファイルを選択",
127
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "ピッチ抽出アルゴリズムの選択、歌声はpmで高速化でき、harvestは低音が良いが信じられないほど遅く、crepeは良く動くがGPUを食います。",
128
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "ピッチ抽出アルゴリズムの選択、歌声はpmで高速化でき、harvestは低音が良いが信じられないほど遅く、crepeは良く動くがGPUを喰います",
129
+ "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "ピッチ抽出アルゴリズムの選択:歌声はpmで高速化でき、入力した音声が高音質でCPUが貧弱な場合はdioで高速化でき、harvestの方が良いが遅く、rmvpeがベストだがCPU/GPUを若干食います。",
130
+ "采样率:": "采样率:",
131
+ "采样长度": "サンプル長",
132
+ "重载设备列表": "デバイスリストをリロードする",
133
+ "音调设置": "音程設定",
134
+ "音频设备": "オーディオデバイス",
135
+ "音高算法": "ピッチアルゴリズム",
136
+ "额外推理时长": "追加推論時間"
137
+ }
RVC/i18n/locale/ko_KR.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音": ">=3인 경우 harvest 피치 인식 결과에 중간값 필터 적용, 필터 반경은 값으로 지정, 사용 시 무성음 감소 가능",
3
+ "A模型权重": "A 모델 가중치",
4
+ "A模型路径": "A 모델 경로",
5
+ "B模型路径": "B 모델 경로",
6
+ "E:\\语音音频+标注\\米津玄师\\src": "E:\\음성 오디오+표시\\米津玄师\\src",
7
+ "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0 곡선 파일, 선택적, 한 줄에 하나의 피치, 기본 F0 및 음높이 조절 대체",
8
+ "Index Rate": "인덱스 비율",
9
+ "Onnx导出": "Onnx 내보내기",
10
+ "Onnx输出路径": "Onnx 출력 경로",
11
+ "RVC模型路径": "RVC 모델 경로",
12
+ "ckpt处理": "ckpt 처리",
13
+ "harvest进程数": "harvest 프로세스 수",
14
+ "index文件路径不可包含中文": "index 파일 경로는 중국어를 포함할 수 없음",
15
+ "pth文件路径不可包含中文": "pth 파일 경로는 중국어를 포함할 수 없음",
16
+ "rmvpe卡号配置:以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "rmvpe 카드 번호 설정: -로 구분된 입력 사용 카드 번호, 예: 0-0-1은 카드 0에서 2개 프로세스, 카드 1에서 1개 프로세스 실행",
17
+ "step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "step1: 실험 구성 작성. 실험 데이터는 logs에 저장, 각 실험은 하나의 폴더, 수동으로 실험 이름 경로 입력 필요, 실험 구성, 로그, 훈련된 모델 파일 포함.",
18
+ "step1:正在处理数据": "step1: 데이터 처리 중",
19
+ "step2:正在提取音高&正在提取特征": "step2: 음높이 추출 & 특징 추출 중",
20
+ "step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a: 훈련 폴더 아래 모든 오디오로 디코딩 가능한 파일을 자동 순회하며 슬라이스 정규화 진행, 실험 디렉토리 아래 2개의 wav 폴더 생성; 현재 단일 사용자 훈련만 지원.",
21
+ "step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "step2b: CPU를 사용하여 음높이 추출(모델이 음높이 포함 시), GPU를 사용하여 특징 추출(카드 번호 선택)",
22
+ "step3: 填写训练设置, 开始训练模型和索引": "step3: 훈련 설정 작성, 모델 및 인덱스 훈련 시작",
23
+ "step3a:正在训练模型": "step3a: 모델 훈련 중",
24
+ "一键训练": "원클릭 훈련",
25
+ "也可批量输入音频文件, 二选一, 优先读文件夹": "여러 오디오 파일을 일괄 입력할 수도 있음, 둘 중 하나 선택, 폴더 우선 읽기",
26
+ "人声伴奏分离批量处理, 使用UVR5模型。 <br>合格的文件夹路径格式举例: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(去文件管理器地址栏拷就行了)。 <br>模型分为三类: <br>1、保留人声:不带和声的音频选这个,对主人声保留比HP5更好。内置HP2和HP3两个模型,HP3可能轻微漏伴奏但对主人声保留比HP2稍微好一丁点; <br>2、仅保留主人声:带和声的音频选这个,对主人声可能有削弱。内置HP5一个模型; <br> 3、去混响、去延迟模型(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb):对于双通道混响是最好的选择,不能去除单通道混响;<br>&emsp;(234)DeEcho:去除延迟效果。Aggressive比Normal去除得更彻底,DeReverb额外去除混响,可去除单声道混响,但是对高频重的板式混响去不干净。<br>去混响/去延迟,附:<br>1、DeEcho-DeReverb模型的耗时是另外2个DeEcho模型的接近2倍;<br>2、MDX-Net-Dereverb模型挺慢的;<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。": "인간 목소리와 반주 분리 배치 처리, UVR5 모델 사용. <br>적절한 폴더 경로 예시: E:\\codes\\py39\\vits_vc_gpu\\白鹭霜华测试样例(파일 관리자 주소 표시줄에서 복사하면 됨). <br>모델은 세 가지 유형으로 나뉨: <br>1. 인간 목소리 보존: 화음이 없는 오디오에 이것을 선택, HP5보다 주된 인간 목소리 보존에 더 좋음. 내장된 HP2와 HP3 두 모델, HP3는 약간의 반주 누락 가능성이 있지만 HP2보다 주된 인간 목소리 보존이 약간 더 좋음; <br>2. 주된 인간 목소리만 보존: 화음이 있는 오디오에 이것을 선택, 주된 인간 목소리에 약간의 약화 가능성 있음. 내장된 HP5 모델 하나; <br>3. 혼효음 제거, 지연 제거 모델(by FoxJoy):<br>  (1)MDX-Net(onnx_dereverb): 이중 채널 혼효음에는 최선의 선택, 단일 채널 혼효음은 제거할 수 없음;<br>&emsp;(234)DeEcho: 지연 제거 효과. Aggressive는 Normal보다 더 철저하게 제거, DeReverb는 추가로 혼효음을 제거, 단일 채널 혼효음은 제거 가능하지만 고주파 중심의 판 혼효음은 완전히 제거하기 어려움.<br>혼효음/지연 제거, 부록: <br>1. DeEcho-DeReverb 모델의 처리 시간은 다른 두 개의 DeEcho 모델의 거의 2배임;<br>2. MDX-Net-Dereverb 모델은 상당히 느림;<br>3. 개인적으로 추천하는 가장 깨끗한 구성은 MDX-Net 다음에 DeEcho-Aggressive 사용.",
27
+ "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "-로 구분하여 입력하는 카드 번호, 예: 0-1-2는 카드 0, 카드 1, 카드 2 사용",
28
+ "伴奏人声分离&去混响&去回声": "반주 인간 목소리 분리 & 혼효음 제거 & 에코 제거",
29
+ "使用模型采样率": "모델 샘플링 레이트 사용",
30
+ "使用设备采样率": "장치 샘플링 레이트 사용",
31
+ "保存名": "저장 이름",
32
+ "保存的文件名, 默认空为和源文件同名": "저장될 파일명, 기본적으로 빈 공간은 원본 파일과 동일한 이름으로",
33
+ "保存的模型名不带后缀": "저장된 모델명은 접미사 없음",
34
+ "保存频率save_every_epoch": "저장 빈도 save_every_epoch",
35
+ "保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果": "청자음과 호흡 소리를 보호, 전자음 찢김 등의 아티팩트 방지, 0.5까지 올려서 비활성화, 낮추면 보호 강도 증가하지만 인덱스 효과 감소 가능성 있음",
36
+ "修改": "수정",
37
+ "修改模型信息(仅支持weights文件夹下提取的小模型文件)": "모델 정보 수정(오직 weights 폴더 아래에서 추출된 작은 모델 파일만 지원)",
38
+ "停止音频转换": "오디오 변환 중지",
39
+ "全流程结束!": "전체 과정 완료!",
40
+ "刷新音色列表和索引路径": "음색 목록 및 인덱스 경로 새로고침",
41
+ "加载模型": "모델 로드",
42
+ "加载预训练底模D路径": "미리 훈련된 베이스 모델 D 경로 로드",
43
+ "加载预训练底模G路径": "미리 훈련된 베이스 모델 G 경로 로드",
44
+ "单次推理": "단일 추론",
45
+ "卸载音色省显存": "음색 언로드로 디스플레이 메모리 절약",
46
+ "变调(整数, 半音数量, 升八度12降八度-12)": "키 변경(정수, 반음 수, 옥타브 상승 12, 옥타브 하강 -12)",
47
+ "后处理重采样至最终采样率,0为不进行重采样": "후처리 재샘플링을 최종 샘플링 레이트로, 0은 재샘플링하지 않음",
48
+ "否": "아니오",
49
+ "启用相位声码器": "위상 보코더 활성화",
50
+ "响应阈值": "응답 임계값",
51
+ "响度因子": "음량 인자",
52
+ "处理数据": "데이터 처리",
53
+ "导出Onnx模型": "Onnx 모델 내보내기",
54
+ "导出文件格式": "내보낼 파일 형식",
55
+ "常见问题解答": "자주 묻는 질문",
56
+ "常规设置": "일반 설정",
57
+ "开始音频转换": "오디오 변환 시작",
58
+ "很遗憾您这没有能用的显卡来支持您训练": "사용 가능한 그래픽 카드가 없어 훈련을 지원할 수 없습니다",
59
+ "性能设置": "성능 설정",
60
+ "总训练轮数total_epoch": "총 훈련 라운드 수 total_epoch",
61
+ "批量推理": "일괄 추론",
62
+ "批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "일괄 변환, 변환할 오디오 파일 폴더 입력 또는 여러 오디오 파일 업로드, 지정된 폴더(기본값 opt)에 변환된 오디오 출력.",
63
+ "指定输出主人声文件夹": "주된 목소리 출력 폴더 지정",
64
+ "指定输出文件夹": "출력 파일 폴더 지정",
65
+ "指定输出非主人声文件夹": "주된 목소리가 아닌 출력 폴더 지정",
66
+ "推理时间(ms):": "추론 시간(ms):",
67
+ "推理音色": "추론 음색",
68
+ "提取": "추출",
69
+ "提取音高和处理数据使用的CPU进程数": "음높이 추출 및 데이터 처리에 사용되는 CPU 프로세스 수",
70
+ "是": "예",
71
+ "是否仅保存最新的ckpt文件以节省硬盘空间": "디스크 공간을 절약하기 위해 최신 ckpt 파일만 저장할지 여부",
72
+ "是否在每次保存时间点将最终小模型保存至weights文件夹": "저장 시마다 최종 소형 모델을 weights 폴더에 저장할지 여부",
73
+ "是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "모든 훈련 세트를 VRAM에 캐시할지 여부. 10분 미만의 소량 데이터는 캐시하여 훈련 속도를 높일 수 있지만, 대량 데이터 캐시는 VRAM을 과부하시키고 속도를 크게 향상시키지 못함",
74
+ "显卡信息": "그래픽 카드 정보",
75
+ "本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自��全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "이 소프트웨어는 MIT 라이선스로 공개되며, 저자는 소프트웨어에 대해 어떠한 통제권도 가지지 않습니다. 모든 귀책사유는 소프트웨어 사용자 및 소프트웨어에서 생성된 결과물을 사용하는 당사자에게 있습니다. <br>해당 조항을 인정하지 않는 경우, 소프트웨어 패키지의 어떠한 코드나 파일도 사용하거나 인용할 수 없습니다. 자세한 내용은 루트 디렉토리의 <b>LICENSE</b>를 참조하세요.",
76
+ "查看": "보기",
77
+ "查看模型信息(仅支持weights文件夹下提取的小模型文件)": "모델 정보 보기(오직 weights 폴더에서 추출된 소형 모델 파일만 지원)",
78
+ "检索特征占比": "검색 특징 비율",
79
+ "模型": "모델",
80
+ "模型推理": "모델 추론",
81
+ "模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "모델 추출(logs 폴더 아래의 큰 파일 모델 경로 입력), 훈련 중간에 중단한 모델의 자동 추출 및 소형 파일 모델 저장이 안 되거나 중간 모델을 테스트하고 싶은 경우에 적합",
82
+ "模型是否带音高指导": "모델이 음높이 지도를 포함하는지 여부",
83
+ "模型是否带音高指导(唱歌一定要, 语音可以不要)": "모델이 음높이 지도를 포함하는지 여부(노래에는 반드시 필요, 음성에는 필요 없음)",
84
+ "模型是否带音高指导,1是0否": "모델이 음높이 지도를 포함하는지 여부, 1은 예, 0은 아니오",
85
+ "模型版本型号": "모델 버전 및 모델",
86
+ "模型融合, 可用于测试音色融合": "모델 융합, 음색 융합 테스트에 사용 가능",
87
+ "模型路径": "모델 경로",
88
+ "每张显卡的batch_size": "각 그래픽 카드의 batch_size",
89
+ "淡入淡出长度": "페이드 인/아웃 길이",
90
+ "版本": "버전",
91
+ "特征提取": "특징 추출",
92
+ "特征检索库文件路径,为空则使用下拉的选择结果": "특징 검색 라이브러리 파일 경로, 비어 있으면 드롭다운 선택 결과 사용",
93
+ "独占 WASAPI 设备": "独占 WASAPI 设备",
94
+ "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "남성에서 여성으로 변경 시 +12 키 권장, 여성에서 남성으로 변경 시 -12 키 권장, 음역대 폭발로 음색이 왜곡되면 적절한 음역대로 조정 가능.",
95
+ "目标采样率": "목표 샘플링률",
96
+ "算法延迟(ms):": "알고리즘 지연(ms):",
97
+ "自动检测index路径,下拉式选择(dropdown)": "자동으로 index 경로 감지, 드롭다운 선택(dropdown)",
98
+ "融合": "융합",
99
+ "要改的模型信息": "변경할 모델 정보",
100
+ "要置入的模型信息": "삽입할 모델 정보",
101
+ "训练": "훈련",
102
+ "训练模型": "모델 훈련",
103
+ "训练特征索引": "특징 인덱스 훈련",
104
+ "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "훈련 완료, 콘솔 훈련 로그 또는 실험 폴더 내의 train.log 확인 가능",
105
+ "设备类型": "设备类型",
106
+ "请指定说话人id": "화자 ID 지정 필요",
107
+ "请选择index文件": "index 파일 선택",
108
+ "请选择pth文件": "pth 파일 선택",
109
+ "请选择说话人id": "화자 ID 선택",
110
+ "转换": "변환",
111
+ "输入实验名": "실험명 입력",
112
+ "输入待处理音频文件夹路径": "처리할 오디오 파일 폴더 경로 입력",
113
+ "输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "처리할 오디오 파일 폴더 경로 입력(파일 탐색기 주소 표시줄에서 복사)",
114
+ "输入待处理音频文件路径(默认是正确格式示例)": "처리할 오디오 파일 경로 입력(기본적으로 올바른 형식 예시)",
115
+ "输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络": "입력 소스 볼륨 엔벨로프와 출력 볼륨 엔벨로프의 결합 비율 입력, 1에 가까울수록 출력 엔벨로프 사용",
116
+ "输入监听": "입력 모니터링",
117
+ "输入训练文件夹路径": "훈련 파일 폴더 경로 입력",
118
+ "输入设备": "입력 장치",
119
+ "输入降噪": "입력 노이즈 감소",
120
+ "输出信息": "출력 정보",
121
+ "输出变声": "출력 음성 변조",
122
+ "输出设备": "출력 장치",
123
+ "输出降噪": "출력 노이즈 감소",
124
+ "输出音频(右下角三个点,点了可以下载)": "출력 오디오(오른쪽 하단 세 개의 점, 클릭하면 다운로드 가능)",
125
+ "选择.index文件": ".index 파일 선택",
126
+ "选择.pth文件": ".pth 파일 선택",
127
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "음높이 추출 알���리즘 선택, 노래 입력 시 pm으로 속도 향상, harvest는 저음이 좋지만 매우 느림, crepe는 효과가 좋지만 GPU 사용",
128
+ "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "음높이 추출 알고리즘 선택, 노래 입력 시 pm으로 속도 향상, harvest는 저음이 좋지만 매우 느림, crepe는 효과가 좋지만 GPU 사용, rmvpe는 효과가 가장 좋으며 GPU를 적게 사용",
129
+ "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "음높이 추출 알고리즘 선택: 노래 입력 시 pm으로 속도 향상, 고품질 음성에는 CPU가 부족할 때 dio 사용, harvest는 품질이 더 좋지만 느림, rmvpe는 효과가 가장 좋으며 CPU/GPU를 적게 사용",
130
+ "采样率:": "샘플링률:",
131
+ "采样长度": "샘플링 길이",
132
+ "重载设备列表": "장치 목록 재로드",
133
+ "音调设置": "음조 설정",
134
+ "音频设备": "音频设备",
135
+ "音高算法": "음높이 알고리즘",
136
+ "额外推理时长": "추가 추론 시간"
137
+ }