Compare commits

...

173 Commits

Author SHA1 Message Date
Ναρουσέ·μ·γιουμεμί·Χινακάννα
7ef1986778
Add warnings for files related to Onnx exports (#2385)
* Fix Onnx Export And Support TensorRT

* Add files via upload

* Update attentions_onnx.py

* Update models_onnx.py

* Update models_onnx.py

* Add files via upload

* Add files via upload
2024-11-24 23:09:44 +08:00
yxlllc
709bbbac1a
optimize nsf inference (#2387) 2024-11-24 21:36:41 +08:00
Ναρουσέ·μ·γιουμεμί·Χινακάννα
1376ce739d
Fix onnx export & Support TensorRT (#2384)
* Fix Onnx Export And Support TensorRT

* Add files via upload
2024-11-24 00:27:28 +08:00
纸巾
9ae3af4a7d
移除音频文件路径 Unicode 控制字符 (#2334) 2024-11-23 20:46:42 +08:00
RVC-Boss
3548b4f1a5
Update requirements-ipex.txt 2024-09-05 13:57:11 +08:00
RVC-Boss
1963b7d5e4
Update requirements-win-for-realtime_vc_gui-dml.txt 2024-09-05 11:53:11 +08:00
RVC-Boss
e954fa98d3
Update requirements-win-for-realtime_vc_gui.txt 2024-09-05 11:53:07 +08:00
Coming
cfc1e24489
fix: dlmodels.sh exits after download single file (#2175) 2024-08-28 16:41:39 +08:00
Dafterfly
b405aed417
Translate Chinese text in English README (#2172) 2024-08-28 16:40:41 +08:00
pato-pan
7e3965c673
Update requirements.txt (#2203)
aria2 needs to be required.
2024-08-28 16:40:28 +08:00
T-NEX
4d1379989f
Update README.ja.md (#2231)
This commit changed the single quotes to back quotes where they were used in the Markdown.
2024-08-28 16:38:15 +08:00
keitarou
7a81606a03
fixed pip version (#2238) 2024-08-28 16:36:43 +08:00
NaGaii1994
22473bac0e
fix poetry (#2246) 2024-08-28 16:36:23 +08:00
RVC-Boss
94e5c40f79
Merge pull request #2256 from mannanshukla/patch-1
fix spelling
2024-08-28 16:36:04 +08:00
Mannan Shukla
7d897dbf60
fix spelling 2024-08-16 22:16:31 -04:00
RVC-Boss
85829da3a0
Rollback 231006 version,fix "forcing fp32 infer"
Rollback 231006 version,fix "forcing fp32 infer"
2024-07-28 16:47:43 +08:00
RVC-Boss
413fa2591f
Rollback 231006 version,fix "forcing fp32 infer"
Rollback 231006 version,fix "forcing fp32 infer"
2024-07-28 16:46:05 +08:00
RVC-Boss
b8361c92d0
Rollback 231006 version,fix "forcing fp32 infer"
Rollback 231006 version,fix "forcing fp32 infer"
2024-07-28 16:45:47 +08:00
RVC-Boss
4aa2a89374
Merge pull request #2177 from AurevoirXavier/main
fix: allow path name contains special characters
2024-07-28 16:32:06 +08:00
RVC-Boss
5524451963
Update requirements.txt 2024-07-05 18:41:23 +08:00
Xavier Lau
81ca3253c7
Allow path name contains special characters 2024-07-03 18:42:58 +08:00
RVC-Boss
83d6a64e67
Merge pull request #2159 from tkyaji/upgrade_librosa
fix: Updated librosa to version 0.10.2
2024-07-01 10:08:22 +08:00
RVC-Boss
9899757d07
Merge pull request #2164 from FChin39/main
feat: Add API Code for Enhanced Functionality
2024-06-30 15:06:09 +08:00
RVC-Boss
c31c7bce4e
Merge pull request #2160 from tkyaji/missing_traceback
fix: The import for traceback is missing.
2024-06-30 15:05:40 +08:00
Freidrichin
ce66d5b40e Update API code for release version
API code for 240604 version and 231006 version
2024-06-27 19:32:34 +08:00
tkyaji
d8ec4e1fee The import for traceback is missing. 2024-06-26 22:15:01 +09:00
tkyaji
330bdd9692 fix: Updated librosa to version 0.10.2
There is a bug in librosa 0.9.1.
https://github.com/librosa/librosa/pull/1594

As a result, an error occurs when executing the "Vocals/Accompaniment Separation & Reverberation Removal" function.

To address this issue, librosa has been upgraded to version 0.10.2.
Additionally, torchcrepe has been upgraded due to its dependency on librosa.
2024-06-26 21:59:55 +09:00
Freidrichin
c44a81b39e Update api.py 2024-06-25 19:05:05 +08:00
Freidrichin
39fc6f2c10 Create api.py
Create the initial API Python file for easy expansion and use.
2024-06-24 22:19:42 +08:00
RVC-Boss
1f1755fe3d
Update audio.py 2024-06-14 19:56:10 +08:00
RVC-Boss
776d28c66f
Update PULL_REQUEST_TEMPLATE.md 2024-06-09 16:09:12 +08:00
RVC-Boss
2ac522f4ca
Merge pull request #2117 from HuanLinOTO/feat-fallback-encoding
feat: fallback to system encoding when fail to read file with utf-8
2024-06-09 00:20:50 +08:00
多玩幻灵qwq
f0dd73a419
feat: fallback to system encoding when fail to read file with utf-8 2024-06-09 00:05:12 +08:00
源文雨
64b78bed3b 20240604 2024-06-05 18:10:59 +09:00
github-actions[bot]
6061f636f8
chore(format): run black on main (#1851)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-01 18:26:12 +09:00
RVC-Boss
a3ee455191
Add files via upload 2024-03-01 17:23:43 +08:00
RVC-Boss
c22b912576
Merge pull request #1850 from RVC-Project/dev
chore(sync): merge dev into main
2024-03-01 16:08:14 +08:00
RVC-Boss
3dcd78855b
Merge branch 'main' into dev 2024-03-01 16:07:24 +08:00
RVC-Boss
67f934539b
Merge pull request #1803 from Butyllithium/dev
修复所有语言REARMED中更新日志的链接错误
2024-03-01 15:04:40 +08:00
CatMatrix
bf17b8b758 修复所有语言更新日志的链接错误 2024-02-09 04:37:39 +08:00
Zzzyt
f513f0b2e0
Fix half argument (#1683) (#1775)
* for GTX1650

* testing torch-profiler

* no more profiler & change default audio

* longer slice

* fluid container

* cache rmvpe and ui tweaks

* get my changes back after merge

* format code

* only load rmvpe when necessary

* fix rmvpe & config bug

* fix is_half again

* manual sync with upstream

* fix bool() for is_half

* revert changes for PR

* revert again

* typo

* match lower case
2024-01-30 12:51:40 +09:00
Albert Softie
401db68aba
make dlmodels.sh executable before running (#1771) 2024-01-27 16:13:34 +09:00
RVC-Boss
8c0cec1c9e
Merge pull request #1768 from RVC-Project/formatter-main
chore(format): run black on main
2024-01-26 16:10:24 +08:00
RVC-Boss
c09d1bcfac
Merge pull request #1769 from RVC-Project/formatter-dev
chore(format): run black on dev
2024-01-26 16:10:23 +08:00
github-actions[bot]
005f097fec chore(format): run black on main 2024-01-26 08:10:04 +00:00
github-actions[bot]
738e55f05c chore(format): run black on dev 2024-01-26 08:09:56 +00:00
RVC-Boss
8790ab69e0
Update infer-web.py 2024-01-26 16:09:42 +08:00
RVC-Boss
850ec480d0
Update infer-web.py 2024-01-26 16:09:39 +08:00
RVC-Boss
9602ea649c
Update train.py 2024-01-26 16:03:00 +08:00
RVC-Boss
b304564c9e
Update train.py 2024-01-26 16:01:14 +08:00
github-actions[bot]
35c83e88df
chore(format): run black on dev (#1763)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-25 21:55:23 +09:00
源文雨
3b2a1d081c feat(gui): trained_xxxx.index hint (fix #1070) 2024-01-25 21:53:29 +09:00
github-actions[bot]
918ab7b62f
chore(format): run black on dev (#1758)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-25 21:05:02 +09:00
Ftps
5c55d5378b
fix run.sh on mac (#1755) 2024-01-25 21:04:29 +09:00
RVC-Boss
5dbdbab2c1
Update audio.py 2024-01-23 15:15:11 +08:00
RVC-Boss
d187257944
Update audio.py 2024-01-23 15:15:04 +08:00
github-actions[bot]
267192fd92
chore(format): run black on dev (#1750)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-22 22:31:55 +09:00
源文雨
380fd52085 optimize(infer-web): silent httpx INFO logging
and add rmvpe downloading in dlmodels.bat
2024-01-22 22:28:09 +09:00
源文雨
55b3fad19e chore(pip): add requirements-py311.txt (fix #1155) 2024-01-22 21:58:12 +09:00
源文雨
03692a261e chore(pip): remove some unnecessary version restrictions
in order to enable installation on pyver>3.11
2024-01-22 21:33:17 +09:00
源文雨
6141253fba drop: overwrite of config jsons & feat: read index from assets/indices 2024-01-22 17:18:59 +09:00
github-actions[bot]
3a80032e74
chore(i18n): sync locale on dev (#1748)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-21 20:20:25 +09:00
Pengoose
f29f39cdef
chore(docs): update docs(ko, ja) & i18n ko translation data (#1744)
* add i18n translation data(ko_KR.json)

* update README.ko.md

* update README.ja.md

* update Changelog_KO.md

* add Changelog_JA.md

* add faq_ko.md

* add faq_ja.md
2024-01-21 20:18:59 +09:00
源文雨
b7d02d3cf2 chore: link Português to READMEs 2024-01-18 00:04:37 +09:00
github-actions[bot]
7dd326c97a
chore(i18n): sync locale on dev (#1733)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-17 23:57:14 +09:00
nr1a
68f286b6a1
Added support for L4&RTX6000 GPU in WebUI (#1738)
* support L4

* add RTX6000
2024-01-17 23:56:35 +09:00
Rafael Godoy
016e8754b9
Translation of RVC into Portuguese in i18n (#1719)
* Translation of RVC into Portuguese in i18n

Added the Brazilian Portuguese language to the project.

* Removal of external links

Removed external links to approve the request.

* Removed external links and translated in real time

More other links I found and removed and fixed some translations that were missing in realtime-gui

* Translation of doc

* FAQ with original and adapted questions:

- All translated original FAQs
- Additional new FAQs adapted to the reality of my country

* adding translated images
2024-01-17 02:02:38 +09:00
github-actions[bot]
8d5c34601b
chore(format): run black on dev (#1731)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-16 20:32:37 +09:00
github-actions[bot]
4e8e235024
chore(i18n): sync locale on dev (#1730)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-16 20:31:53 +09:00
Sơn Phan Trung
53051852f1
refactor(dlmodels.sh): get the script posix compliant, rework functions. (#1723) 2024-01-16 20:31:10 +09:00
Chengjia Jiang
49434901d8
fix: 多显卡训练时logger未赋值引用 (#1722)
modified:   infer/modules/train/train.py
2024-01-16 20:30:10 +09:00
Adachi
f6fa0c9cd9
typo: README.md (#1725) 2024-01-16 20:23:42 +09:00
yxlllc
c3e65cdf96
optimize: realtime inference (#1693)
* update real-time gui

* update real-time gui

* update real-time gui
2024-01-16 20:22:55 +09:00
NightWatcher314
26e2805f0e
fix poetry part for README.md (#1715)
* Update README.md

* Delete pyproject.toml

* Delete poetry.lock

* Update README.md
2024-01-14 17:04:30 +09:00
github-actions[bot]
4f7b6b2b9e
chore(format): run black on dev (#1717)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-14 16:43:14 +09:00
Rice Cake
bb4d185a57
Update README.en.md (#1716)
Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com>
2024-01-14 16:42:19 +09:00
源文雨
b8bc2b6d60 drop: preprocess.py overwrite & optimize log printing 2024-01-14 16:37:55 +09:00
Allen Li
2d0307dc6a
Docs: Update README.fr.md (#1712)
* fix broken links in french README and add its link to other languages README

* improve french README
2024-01-14 15:35:05 +09:00
源文雨
e88c713895
Merge pull request #1703 from RVC-Project/main
sync main
2024-01-12 08:57:21 +08:00
dependabot[bot]
c1838623d4
chore(deps): bump gradio from 3.34.0 to 4.11.0 (#1699)
Bumps [gradio](https://github.com/gradio-app/gradio) from 3.34.0 to 4.11.0.
- [Release notes](https://github.com/gradio-app/gradio/releases)
- [Changelog](https://github.com/gradio-app/gradio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gradio-app/gradio/commits)

---
updated-dependencies:
- dependency-name: gradio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-11 23:55:02 +09:00
dependabot[bot]
9d3bd6f6d7
chore(deps): bump fonttools from 4.41.1 to 4.43.0 (#1698)
Bumps [fonttools](https://github.com/fonttools/fonttools) from 4.41.1 to 4.43.0.
- [Release notes](https://github.com/fonttools/fonttools/releases)
- [Changelog](https://github.com/fonttools/fonttools/blob/main/NEWS.rst)
- [Commits](https://github.com/fonttools/fonttools/compare/4.41.1...4.43.0)

---
updated-dependencies:
- dependency-name: fonttools
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-11 23:45:35 +09:00
github-actions[bot]
322ce9b940
chore(format): run black on dev (#1697)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-11 22:42:26 +09:00
Zzzyt
c2ab680e18
add is_half argument to extract_feature_print.py (#1683)
* for GTX1650

* testing torch-profiler

* no more profiler & change default audio

* longer slice

* fluid container

* cache rmvpe and ui tweaks

* get my changes back after merge

* format code

* only load rmvpe when necessary

* fix rmvpe & config bug

* fix is_half again

* manual sync with upstream

* revert other changes for pull request
2024-01-11 22:40:34 +09:00
源文雨
0de6505324
sync (#1663)
* 优化README头图显示格式

* 大幅优化README

* Update README.md

* Update README.md

* 删除过时文档
2023-12-29 01:29:57 +09:00
源文雨
f3281d1e37
Merge branch 'main' into dev 2023-12-29 00:29:44 +08:00
源文雨
f2e18f1366
删除过时文档 2023-12-29 01:27:17 +09:00
源文雨
50890e4f44
Update README.md 2023-12-29 01:26:10 +09:00
源文雨
cd051e345b
Update README.md 2023-12-29 01:25:21 +09:00
源文雨
57cb626334
Update README.md 2023-12-29 01:24:08 +09:00
源文雨
b9fbce73a9
大幅优化README 2023-12-29 01:23:16 +09:00
源文雨
1ff9e8c3e6
优化README头图显示格式 (#1662) 2023-12-29 00:52:57 +09:00
源文雨
1669821386
优化README头图显示格式 2023-12-29 00:52:10 +09:00
RVC-Boss
f54ceb4dc4
Merge pull request #1661 from RVC-Project/dev
chore(sync): merge dev into main
2023-12-28 23:41:38 +08:00
RVC-Boss
4cf6ed50cb
Merge branch 'main' into dev 2023-12-28 23:41:27 +08:00
RVC-Boss
43b5be3189
Update README.md 2023-12-28 23:37:36 +08:00
RVC-Boss
4769472ba2
Merge pull request #1660 from RVC-Project/formatter-dev
chore(format): run black on dev
2023-12-28 22:48:08 +08:00
RVC-Boss
cbdab9c0c9
Update README.md 2023-12-28 22:28:33 +08:00
github-actions[bot]
8f31203b46 chore(format): run black on dev 2023-12-28 10:14:41 +00:00
RVC-Boss
d766298065
Merge pull request #1659 from yxlllc/dev
optimize stream logic
2023-12-28 18:14:22 +08:00
yxlllc
6bc929abea optimize stream logic 2023-12-28 18:02:41 +08:00
RVC-Boss
443a04bc66
Merge pull request #1653 from RVC-Project/dev
chore(sync): merge dev into main
2023-12-26 22:27:32 +08:00
RVC-Boss
c90b252e94
Merge pull request #1651 from everypizza1/patch-1
Fix: pdate README.en.md
2023-12-26 22:24:53 +08:00
RVC-Boss
e56584c6e2
Add files via upload 2023-12-26 22:24:04 +08:00
Derry Tutt
1b680a9690
Update README.en.md
Made it seem more human.
2023-12-26 07:52:02 -06:00
Sơn Phan Trung
8bd34d1881
chore: get run.sh to be POSIX Compliant (#1649)
* Create CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* fix: get run.sh posix compliant

* Update venv.sh

* Delete CONTRIBUTING.md

---------

Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com>
2023-12-26 22:11:16 +09:00
dependabot[bot]
1ff1a183ea
chore(deps-dev): bump aiohttp from 3.8.5 to 3.9.0 (#1636)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.5 to 3.9.0.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.5...v3.9.0)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 22:08:17 +09:00
github-actions[bot]
5449f84f06
chore(format): run black on dev (#1638)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-26 22:03:02 +09:00
github-actions[bot]
997a956f4f
chore(i18n): sync locale on dev (#1650)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-26 22:01:20 +09:00
RVC-Boss
2fb732da62
Merge pull request #1647 from yxlllc/dev
Optimize real-time functions
2023-12-26 20:57:01 +08:00
yxlllc
aed19c3c6b optimize real-time vc 2023-12-26 17:41:25 +08:00
yxlllc
21775b187a optimize real-time vc 2023-12-26 17:05:42 +08:00
源文雨
9ebe62b3e9
Update CONTRIBUTING.md 2023-12-26 17:50:42 +09:00
yxlllc
d7fb651f7c optimize real-time vc 2023-12-26 16:26:01 +08:00
源文雨
c478586872
Update CONTRIBUTING.md 2023-12-26 02:05:46 +09:00
源文雨
350a9b49b8
Create CONTRIBUTING.md 2023-12-26 02:04:13 +09:00
yxlllc
d62e80fb83 optimize real-time vc 2023-12-26 00:28:49 +08:00
yxlllc
3dec36568c optimize real-time vc 2023-12-26 00:23:36 +08:00
Blaise
78f03e7dc0
Fix return_complex warning on training (#1627)
* Fix return_complex warning on training

* remove unused prints
2023-12-22 10:35:51 +09:00
github-actions[bot]
0f8a5facd9
chore(format): run black on dev (#1619)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-20 14:47:37 +09:00
RVC-Boss
d269d14768
Merge pull request #1618 from CNChTu/main
add fcpe for realtime
2023-12-15 00:20:04 +08:00
CN_ChiTu
e6cda00fcf
add fcpe for realtime 2023-12-14 21:09:41 +08:00
CN_ChiTu
8974660560
add fcpe for realtime 2023-12-14 21:08:36 +08:00
CN_ChiTu
e7e9d5934d
add fcpe for realtime 2023-12-14 21:01:46 +08:00
RVC-Boss
5a3ad60558
Merge pull request #1607 from Tps-F/fix_harvest_onnx
Fix F0 predictor for Harvest
2023-12-10 20:07:19 +08:00
Ftps
45133bc752 FIx F0 predictor for Harvet 2023-12-10 19:33:12 +09:00
Ftps
786005f0de
fix flow (#1605) 2023-12-10 15:32:44 +08:00
github-actions[bot]
7c753e6ac1
chore(i18n): sync locale on dev (#1585)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-30 20:34:39 +09:00
David Edwards
45da3644f4
feat: add en_US translations and missing i18n in web client (#1576)
* chore(format): run black on main (#1448)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* translate untranslated english

* Fix trainset_dir4 default value in infer-web.py

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com>
2023-11-30 20:32:24 +09:00
Ftps
fe0f32c6a6
swap description (#1554)
Co-authored-by: donghyeop son <42092560+sondonghup@users.noreply.github.com>
2023-11-26 21:03:10 +09:00
RVC-Boss
ff093ad88f
Merge pull request #1534 from RVC-Project/dev
chore(sync): merge dev into main
2023-11-12 17:51:55 +08:00
RVC-Boss
e2d494d1a7
Merge pull request #1533 from RVC-Project/formatter-dev
chore(format): run black on dev
2023-11-12 17:43:46 +08:00
github-actions[bot]
f1552e143b chore(format): run black on dev 2023-11-12 09:40:59 +00:00
RVC-Boss
e4ef99aa62
Merge pull request #1532 from yxlllc/dev
fix alignments of f0 and hubert
2023-11-12 17:40:42 +08:00
yxlllc
4303c5b18d fix alignments of f0 and hubert 2023-11-12 17:21:25 +08:00
github-actions[bot]
ee6c50bdbc
chore(format): run black on dev (#1484)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-06 15:42:26 +09:00
CNajm
3f7644b56a
Fix error in index file path (#1502) 2023-11-06 15:41:25 +09:00
RVC-Boss
2b0971e917
Merge pull request #1483 from THE-SINDOL/main
French language in fr_FR.json
2023-10-29 12:37:07 +08:00
RVC-Boss
6567289a35
Merge branch 'dev' into main 2023-10-29 12:36:54 +08:00
RVC-Boss
dabbe708f7
Update README.md 2023-10-29 12:36:00 +08:00
THE-SINDOL
a51746555c
Update fr_FR.json
Changed chinese simplified language in french
2023-10-28 23:05:08 +02:00
github-actions[bot]
9c2afdbbc8
chore(format): run black on dev (#1447)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-23 23:01:18 +09:00
github-actions[bot]
f431f8fb3f
chore(format): run black on main (#1448)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-23 23:01:02 +09:00
RVC-Boss
318e8fd8cf
Add files via upload 2023-10-20 14:14:25 +08:00
RVC-Boss
ec1ccae300
Add files via upload 2023-10-20 14:13:57 +08:00
RVC-Boss
c8b6be0a53
Update train.py 2023-10-16 23:45:00 +08:00
RVC-Boss
3cc0964600
Update train.py 2023-10-16 23:44:41 +08:00
Ftps
0472bc5283
Update PULL_REQUEST_TEMPLATE.md (#1417) 2023-10-13 00:08:58 +09:00
RVC-Boss
cbe7934184
Merge pull request #1414 from RVC-Project/formatter-dev
chore(format): run black on dev
2023-10-11 10:23:58 +08:00
RVC-Boss
08b22f036e
Merge pull request #1413 from RVC-Project/formatter-main
chore(format): run black on main
2023-10-11 10:23:46 +08:00
github-actions[bot]
11b1cdded8 chore(format): run black on dev 2023-10-11 02:22:28 +00:00
RVC-Boss
3cc778ba6a
Add files via upload 2023-10-11 10:22:11 +08:00
github-actions[bot]
73078a3d24 chore(format): run black on main 2023-10-11 02:22:09 +00:00
RVC-Boss
45f868acad
Add files via upload 2023-10-11 10:21:51 +08:00
RVC-Boss
5e22271924
Merge pull request #1410 from RVC-Project/dev
chore(sync): merge dev into main
2023-10-10 17:23:18 +08:00
RVC-Boss
beb2f0d1d8
Merge pull request #1409 from RVC-Project/formatter-dev
chore(format): run black on dev
2023-10-10 17:22:18 +08:00
github-actions[bot]
886eeb0547 chore(format): run black on dev 2023-10-10 09:10:46 +00:00
RVC-Boss
7e4992eb22
Add files via upload 2023-10-10 17:10:18 +08:00
github-actions[bot]
c08426ac51
chore(sync): merge dev into main (#1408)
* Update mdxnet.py

* Update modules.py

* Rename preprocess.py to vr.py

* Add files via upload

* deps: add av lib (#1391)

* Add files via upload

* chore(format): run black on dev (#1398)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: sync dev to mian (#1404)

* Add files via upload

* Update rvc_for_realtime.py

* Add files via upload

* Add files via upload

* chore(format): run black on dev (#1407)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com>
Co-authored-by: Hiroto N <hironow365@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com>
2023-10-10 10:57:55 +08:00
github-actions[bot]
1e2648804c
chore(format): run black on dev (#1407)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-10 10:57:00 +08:00
RVC-Boss
9cdc185c3a
Add files via upload 2023-10-10 10:56:07 +08:00
RVC-Boss
87f814659d
Add files via upload 2023-10-10 10:54:54 +08:00
RVC-Boss
392e5ac493
Update rvc_for_realtime.py 2023-10-09 21:21:35 +08:00
RVC-Boss
03ccd53ffe
Add files via upload 2023-10-09 15:38:59 +08:00
源文雨
d91cbec9f7
chore: sync dev to mian (#1404) 2023-10-09 15:23:11 +09:00
github-actions[bot]
1696c5356b
chore(sync): merge dev into main (#1399)
* Update mdxnet.py

* Update modules.py

* Rename preprocess.py to vr.py

* Add files via upload

* deps: add av lib (#1391)

* Add files via upload

* chore(format): run black on dev (#1398)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com>
Co-authored-by: Hiroto N <hironow365@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-08 18:54:58 +08:00
github-actions[bot]
634ba76cfa
chore(format): run black on dev (#1398)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-08 18:54:15 +08:00
RVC-Boss
5c609190a2
Add files via upload 2023-10-08 18:40:45 +08:00
Hiroto N
891a81cd8d
deps: add av lib (#1391) 2023-10-08 18:31:39 +08:00
RVC-Boss
ec29cf8d65
Add files via upload 2023-10-08 18:31:09 +08:00
RVC-Boss
361e674054
Rename preprocess.py to vr.py 2023-10-08 18:30:54 +08:00
RVC-Boss
330ea00e5c
Update modules.py 2023-10-08 18:11:48 +08:00
RVC-Boss
04e03decc3
Update mdxnet.py 2023-10-08 18:09:59 +08:00
dependabot[bot]
1fdbb94811
chore(deps): bump urllib3 from 1.26.16 to 1.26.17 (#1374)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.16 to 1.26.17.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.16...1.26.17)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-07 14:24:16 +09:00
92 changed files with 9315 additions and 5262 deletions

1
.env
View File

@ -5,4 +5,5 @@ no_proxy = localhost, 127.0.0.1, ::1
weight_root = assets/weights
weight_uvr5_root = assets/uvr5_weights
index_root = logs
outside_index_root = assets/indices
rmvpe_root = assets/rmvpe

View File

@ -1,14 +1,20 @@
# Pull request checklist
- [ ] The PR has a proper title. Use [Semantic Commit Messages](https://seesparkbox.com/foundry/semantic_commit_messages). (No more branch-name title please)
- [ ] Make sure you are requesting the right branch: `dev`.
- [ ] 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.
- [ ] Ensure all tests are passing.
- [ ] Ensure linting is passing.
- [ ] Ensure you can run the codes you submitted succesfully. These submissions will be prioritized for review:
Introduce improvements in program execution speed;
Introduce improvements in synthesis quality;
Fix existing bugs reported by user feedback (or you met);
Introduce more convenient user operations.
# PR type
- Bug fix / new feature / chore
- Bug fix / new feature / synthesis quality improvement / program execution speed improvement
# Description
@ -18,13 +24,3 @@
# Screenshot
- Please include a screenshot if applicable
# Localhost url to test on
- Please include a url on localhost to test.
# Jira Link
- Please include a link to the ticket if applicable.
[Ticket]()

View File

@ -33,4 +33,4 @@ jobs:
python infer/modules/train/preprocess.py logs/mute/0_gt_wavs 48000 8 logs/mi-test True 3.7
touch logs/mi-test/extract_f0_feature.log
python infer/modules/train/extract/extract_f0_print.py logs/mi-test $(nproc) pm
python infer/modules/train/extract_feature_print.py cpu 1 0 0 logs/mi-test v1
python infer/modules/train/extract_feature_print.py cpu 1 0 0 logs/mi-test v1 True

5
.gitignore vendored
View File

@ -21,3 +21,8 @@ rmvpe.pt
# To set a Python version for the project
.tool-versions
/runtime
/assets/weights/*
ffmpeg.*
ffprobe.*

11
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,11 @@
# 贡献规则
1. 一般来说,作者`@RVC-Boss`将拒绝所有的算法更改,除非它是为了修复某个代码层面的错误或警告
2. 您可以贡献本仓库的其他位置如翻译和WebUI但请尽量作最小更改
3. 所有更改都需要由`@RVC-Boss`批准因此您的PR可能会被搁置
4. 由此带来的不便请您谅解
# Contributing Rules
1. Generally, the author `@RVC-Boss` will reject all algorithm changes unless what is to fix a code-level error or warning.
2. You can contribute to other parts of this repo like translations and WebUI, but please minimize your changes as much as possible.
3. All changes need to be approved by `@RVC-Boss`, so your PR may be put on hold.
4. Please accept our apologies for any inconvenience caused.

View File

@ -28,6 +28,7 @@ RUN apt-get update && \
# Set Python 3.9 as the default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
RUN python3 -m pip install --upgrade pip==24.0
RUN python3 -m pip install --no-cache-dir -r requirements.txt
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

192
README.md
View File

@ -14,28 +14,35 @@
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
[**更新日志**](https://github.com/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://huggingface.co/spaces/Ricecake123/RVC-demo)
[**更新日志**](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)
[**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)
</div>
------
[**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)
点此查看我们的[演示视频](https://www.bilibili.com/video/BV1pm4y1z7Gm/) !
训练推理界面go-web.bat
![image](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/092e5c12-0d49-4168-a590-0b0ef6a4f630)
实时变声界面go-realtime-gui.bat
![image](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/143246a9-8b42-4dd1-a197-430ede4d15d7)
> 底模使用接近50小时的开源高质量VCTK训练集训练无版权方面的顾虑请大家放心使用
> 请期待RVCv3的底模参数更大数据更大效果更好基本持平的推理速度需要训练数据量更少。
<table>
<tr>
<td align="center">训练推理界面</td>
<td align="center">实时变声界面</td>
</tr>
<tr>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/092e5c12-0d49-4168-a590-0b0ef6a4f630"></td>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/730b4114-8805-44a1-ab1a-04668f3c30a6"></td>
</tr>
<tr>
<td align="center">go-web.bat</td>
<td align="center">go-realtime-gui.bat</td>
</tr>
<tr>
<td align="center">可以自由选择想要执行的操作。</td>
<td align="center">我们已经实现端到端170ms延迟。如使用ASIO输入输出设备已能实现端到端90ms延迟但非常依赖硬件驱动支持。</td>
</tr>
</table>
## 简介
本仓库具有以下特点
+ 使用top1检索替换输入源特征为训练集特征来杜绝音色泄漏
@ -47,47 +54,55 @@
+ 使用最先进的[人声音高提取算法InterSpeech2023-RMVPE](#参考项目)根绝哑音问题。效果最好显著地但比crepe_full更快、资源占用更小
+ A卡I卡加速支持
点此查看我们的[演示视频](https://www.bilibili.com/video/BV1pm4y1z7Gm/) !
## 环境配置
以下指令需在 Python 版本大于3.8的环境中执行。
(Windows/Linux)
首先通过 pip 安装主要依赖:
### Windows/Linux/MacOS等平台通用方法
下列方法任选其一。
#### 1. 通过 pip 安装依赖
1. 安装Pytorch及其核心依赖若已安装则跳过。参考自: https://pytorch.org/get-started/locally/
```bash
# 安装Pytorch及其核心依赖若已安装则跳过
# 参考自: https://pytorch.org/get-started/locally/
pip install torch torchvision torchaudio
#如果是win系统+Nvidia Ampere架构(RTX30xx),根据 #21 的经验需要指定pytorch对应的cuda版本
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
```
2. 如果是 win 系统 + Nvidia Ampere 架构(RTX30xx),根据 #21 的经验,需要指定 pytorch 对应的 cuda 版本
```bash
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
```
3. 根据自己的显卡安装对应依赖
- N卡
```bash
pip install -r requirements.txt
```
- A卡/I卡
```bash
pip install -r requirements-dml.txt
```
- A卡ROCM(Linux)
```bash
pip install -r requirements-amd.txt
```
- I卡IPEX(Linux)
```bash
pip install -r requirements-ipex.txt
```
可以使用 poetry 来安装依赖:
#### 2. 通过 poetry 来安装依赖
安装 Poetry 依赖管理工具,若已安装则跳过。参考自: https://python-poetry.org/docs/#installation
```bash
# 安装 Poetry 依赖管理工具, 若已安装则跳过
# 参考自: https://python-poetry.org/docs/#installation
curl -sSL https://install.python-poetry.org | python3 -
# 通过poetry安装依赖
poetry install
```
你也可以通过 pip 来安装依赖:
通过 Poetry 安装依赖时python 建议使用 3.7-3.10 版本,其余版本在安装 llvmlite==0.39.0 时会出现冲突
```bash
N卡
pip install -r requirements.txt
A卡/I卡
pip install -r requirements-dml.txt
A卡RocmLinux
pip install -r requirements-amd.txt
I卡IPEXLinux
pip install -r requirements-ipex.txt
poetry init -n
poetry env use "path to your python.exe"
poetry run pip install -r requirments.txt
```
------
Mac 用户可以通过 `run.sh` 来安装依赖
### MacOS
可以通过 `run.sh` 来安装依赖
```bash
sh ./run.sh
```
@ -97,48 +112,48 @@ RVC需要其他一些预模型来推理和训练。
你可以从我们的[Hugging Face space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)下载到这些模型。
以下是一份清单包括了所有RVC所需的预模型和其他文件的名称:
### 1. 下载 assets
以下是一份清单包括了所有RVC所需的预模型和其他文件的名称。你可以在`tools`文件夹找到下载它们的脚本。
- ./assets/hubert/hubert_base.pt
- ./assets/pretrained
- ./assets/uvr5_weights
想使用v2版本模型的话需要额外下载
- ./assets/pretrained_v2
### 2. 安装 ffmpeg
若ffmpeg和ffprobe已安装则跳过。
#### Ubuntu/Debian 用户
```bash
./assets/hubert/hubert_base.pt
./assets/pretrained
./assets/uvr5_weights
想测试v2版本模型的话需要额外下载
./assets/pretrained_v2
如果你正在使用Windows则你可能需要这个文件若ffmpeg和ffprobe已安装则跳过; ubuntu/debian 用户可以通过apt install ffmpeg来安装这2个库, Mac 用户则可以通过brew install ffmpeg来安装 (需要预先安装brew)
./ffmpeg
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe
./ffprobe
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe
如果你想使用最新的RMVPE人声音高提取算法则你需要下载音高提取模型参数并放置于RVC根目录
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt
A卡I卡用户需要的dml环境要请下载
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx
sudo apt install ffmpeg
```
之后使用以下指令来启动WebUI:
#### MacOS 用户
```bash
python infer-web.py
brew install ffmpeg
```
如果你正在使用Windows 或 macOS你可以直接下载并解压`RVC-beta.7z`,前者可以运行`go-web.bat`以启动WebUI后者则运行命令`sh ./run.sh`以启动WebUI。
#### Windows 用户
下载后放置在根目录。
- 下载[ffmpeg.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe)
对于需要使用IPEX技术的I卡用户请先在终端执行`source /opt/intel/oneapi/setvars.sh`仅Linux
- 下载[ffprobe.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe)
仓库内还有一份`小白简易教程.doc`以供参考。
### 3. 下载 rmvpe 人声音高提取算法所需文件
如果你想使用最新的RMVPE人声音高提取算法则你需要下载音高提取模型参数并放置于RVC根目录。
- 下载[rmvpe.pt](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt)
#### 下载 rmvpe 的 dml 环境(可选, A卡/I卡用户)
- 下载[rmvpe.onnx](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx)
### 4. AMD显卡Rocm(可选, 仅Linux)
## AMD显卡Rocm相关仅Linux
如果你想基于AMD的Rocm技术在Linux系统上运行RVC请先在[这里](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html)安装所需的驱动。
若你使用的是Arch Linux可以使用pacman来安装所需驱动
@ -155,11 +170,32 @@ export HSA_OVERRIDE_GFX_VERSION=10.3.0
sudo usermod -aG render $USERNAME
sudo usermod -aG video $USERNAME
````
之后运行WebUI
## 开始使用
### 直接启动
使用以下指令来启动 WebUI
```bash
python infer-web.py
```
若先前使用 Poetry 安装依赖则可以通过以下方式启动WebUI
```bash
poetry run python infer-web.py
```
### 使用整合包
下载并解压`RVC-beta.7z`
#### Windows 用户
双击`go-web.bat`
#### MacOS 用户
```bash
sh ./run.sh
```
### 对于需要使用IPEX技术的I卡用户(仅Linux)
```bash
source /opt/intel/oneapi/setvars.sh
```
## 参考项目
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
+ [VITS](https://github.com/jaywalnut310/vits)

View File

@ -290,7 +290,7 @@
"\n",
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
"\n",
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}"
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME} True"
]
},
{

View File

@ -309,7 +309,7 @@
"\n",
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
"\n",
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME}"
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME} True"
]
},
{

440
api_231006.py Normal file
View File

@ -0,0 +1,440 @@
#api for 231006 release version by Xiaokai
import os
import sys
import json
import re
import time
import librosa
import torch
import numpy as np
import torch.nn.functional as F
import torchaudio.transforms as tat
import sounddevice as sd
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import threading
import uvicorn
import logging
# Initialize the logger
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Define FastAPI app
app = FastAPI()
class GUIConfig:
def __init__(self) -> None:
self.pth_path: str = ""
self.index_path: str = ""
self.pitch: int = 0
self.samplerate: int = 40000
self.block_time: float = 1.0 # s
self.buffer_num: int = 1
self.threhold: int = -60
self.crossfade_time: float = 0.05
self.extra_time: float = 2.5
self.I_noise_reduce = False
self.O_noise_reduce = False
self.rms_mix_rate = 0.0
self.index_rate = 0.3
self.f0method = "rmvpe"
self.sg_input_device = ""
self.sg_output_device = ""
class ConfigData(BaseModel):
pth_path: str
index_path: str
sg_input_device: str
sg_output_device: str
threhold: int = -60
pitch: int = 0
index_rate: float = 0.3
rms_mix_rate: float = 0.0
block_time: float = 0.25
crossfade_length: float = 0.05
extra_time: float = 2.5
n_cpu: int = 4
I_noise_reduce: bool = False
O_noise_reduce: bool = False
class AudioAPI:
def __init__(self) -> None:
self.gui_config = GUIConfig()
self.config = None # Initialize Config object as None
self.flag_vc = False
self.function = "vc"
self.delay_time = 0
self.rvc = None # Initialize RVC object as None
def load(self):
input_devices, output_devices, _, _ = self.get_devices()
try:
with open("configs/config.json", "r", encoding='utf-8') as j:
data = json.load(j)
data["rmvpe"] = True # Ensure rmvpe is the only f0method
if data["sg_input_device"] not in input_devices:
data["sg_input_device"] = input_devices[sd.default.device[0]]
if data["sg_output_device"] not in output_devices:
data["sg_output_device"] = output_devices[sd.default.device[1]]
except Exception as e:
logger.error(f"Failed to load configuration: {e}")
with open("configs/config.json", "w", encoding='utf-8') as j:
data = {
"pth_path": " ",
"index_path": " ",
"sg_input_device": input_devices[sd.default.device[0]],
"sg_output_device": output_devices[sd.default.device[1]],
"threhold": "-60",
"pitch": "0",
"index_rate": "0",
"rms_mix_rate": "0",
"block_time": "0.25",
"crossfade_length": "0.05",
"extra_time": "2.5",
"f0method": "rmvpe",
"use_jit": False,
}
data["rmvpe"] = True # Ensure rmvpe is the only f0method
json.dump(data, j, ensure_ascii=False)
return data
def set_values(self, values):
logger.info(f"Setting values: {values}")
if not values.pth_path.strip():
raise HTTPException(status_code=400, detail="Please select a .pth file")
if not values.index_path.strip():
raise HTTPException(status_code=400, detail="Please select an index file")
self.set_devices(values.sg_input_device, values.sg_output_device)
self.config.use_jit = False
self.gui_config.pth_path = values.pth_path
self.gui_config.index_path = values.index_path
self.gui_config.threhold = values.threhold
self.gui_config.pitch = values.pitch
self.gui_config.block_time = values.block_time
self.gui_config.crossfade_time = values.crossfade_length
self.gui_config.extra_time = values.extra_time
self.gui_config.I_noise_reduce = values.I_noise_reduce
self.gui_config.O_noise_reduce = values.O_noise_reduce
self.gui_config.rms_mix_rate = values.rms_mix_rate
self.gui_config.index_rate = values.index_rate
self.gui_config.n_cpu = values.n_cpu
self.gui_config.f0method = "rmvpe"
return True
def start_vc(self):
torch.cuda.empty_cache()
self.flag_vc = True
self.rvc = rvc_for_realtime.RVC(
self.gui_config.pitch,
self.gui_config.pth_path,
self.gui_config.index_path,
self.gui_config.index_rate,
0,
0,
0,
self.config,
self.rvc if self.rvc else None,
)
self.gui_config.samplerate = self.rvc.tgt_sr
self.zc = self.rvc.tgt_sr // 100
self.block_frame = (
int(
np.round(
self.gui_config.block_time
* self.gui_config.samplerate
/ self.zc
)
)
* self.zc
)
self.block_frame_16k = 160 * self.block_frame // self.zc
self.crossfade_frame = (
int(
np.round(
self.gui_config.crossfade_time
* self.gui_config.samplerate
/ self.zc
)
)
* self.zc
)
self.sola_search_frame = self.zc
self.extra_frame = (
int(
np.round(
self.gui_config.extra_time
* self.gui_config.samplerate
/ self.zc
)
)
* self.zc
)
self.input_wav = torch.zeros(
self.extra_frame + self.crossfade_frame + self.sola_search_frame + self.block_frame,
device=self.config.device,
dtype=torch.float32,
)
self.input_wav_res = torch.zeros(
160 * self.input_wav.shape[0] // self.zc,
device=self.config.device,
dtype=torch.float32,
)
self.pitch = np.zeros(self.input_wav.shape[0] // self.zc, dtype="int32")
self.pitchf = np.zeros(self.input_wav.shape[0] // self.zc, dtype="float64")
self.sola_buffer = torch.zeros(self.crossfade_frame, device=self.config.device, dtype=torch.float32)
self.nr_buffer = self.sola_buffer.clone()
self.output_buffer = self.input_wav.clone()
self.res_buffer = torch.zeros(2 * self.zc, device=self.config.device, dtype=torch.float32)
self.valid_rate = 1 - (self.extra_frame - 1) / self.input_wav.shape[0]
self.fade_in_window = (
torch.sin(0.5 * np.pi * torch.linspace(0.0, 1.0, steps=self.crossfade_frame, device=self.config.device, dtype=torch.float32)) ** 2
)
self.fade_out_window = 1 - self.fade_in_window
self.resampler = tat.Resample(
orig_freq=self.gui_config.samplerate,
new_freq=16000,
dtype=torch.float32,
).to(self.config.device)
self.tg = TorchGate(
sr=self.gui_config.samplerate, n_fft=4 * self.zc, prop_decrease=0.9
).to(self.config.device)
thread_vc = threading.Thread(target=self.soundinput)
thread_vc.start()
def soundinput(self):
channels = 1 if sys.platform == "darwin" else 2
with sd.Stream(
channels=channels,
callback=self.audio_callback,
blocksize=self.block_frame,
samplerate=self.gui_config.samplerate,
dtype="float32",
) as stream:
global stream_latency
stream_latency = stream.latency[-1]
while self.flag_vc:
time.sleep(self.gui_config.block_time)
logger.info("Audio block passed.")
logger.info("Ending VC")
def audio_callback(self, indata: np.ndarray, outdata: np.ndarray, frames, times, status):
start_time = time.perf_counter()
indata = librosa.to_mono(indata.T)
if self.gui_config.threhold > -60:
rms = librosa.feature.rms(y=indata, frame_length=4 * self.zc, hop_length=self.zc)
db_threhold = (librosa.amplitude_to_db(rms, ref=1.0)[0] < self.gui_config.threhold)
for i in range(db_threhold.shape[0]):
if db_threhold[i]:
indata[i * self.zc : (i + 1) * self.zc] = 0
self.input_wav[: -self.block_frame] = self.input_wav[self.block_frame :].clone()
self.input_wav[-self.block_frame :] = torch.from_numpy(indata).to(self.config.device)
self.input_wav_res[: -self.block_frame_16k] = self.input_wav_res[self.block_frame_16k :].clone()
if self.gui_config.I_noise_reduce and self.function == "vc":
input_wav = self.input_wav[-self.crossfade_frame - self.block_frame - 2 * self.zc :]
input_wav = self.tg(input_wav.unsqueeze(0), self.input_wav.unsqueeze(0))[0, 2 * self.zc :]
input_wav[: self.crossfade_frame] *= self.fade_in_window
input_wav[: self.crossfade_frame] += self.nr_buffer * self.fade_out_window
self.nr_buffer[:] = input_wav[-self.crossfade_frame :]
input_wav = torch.cat((self.res_buffer[:], input_wav[: self.block_frame]))
self.res_buffer[:] = input_wav[-2 * self.zc :]
self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(input_wav)[160:]
else:
self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(self.input_wav[-self.block_frame - 2 * self.zc :])[160:]
if self.function == "vc":
f0_extractor_frame = self.block_frame_16k + 800
if self.gui_config.f0method == "rmvpe":
f0_extractor_frame = (5120 * ((f0_extractor_frame - 1) // 5120 + 1) - 160)
infer_wav = self.rvc.infer(
self.input_wav_res,
self.input_wav_res[-f0_extractor_frame:].cpu().numpy(),
self.block_frame_16k,
self.valid_rate,
self.pitch,
self.pitchf,
self.gui_config.f0method,
)
infer_wav = infer_wav[-self.crossfade_frame - self.sola_search_frame - self.block_frame :]
else:
infer_wav = self.input_wav[-self.crossfade_frame - self.sola_search_frame - self.block_frame :].clone()
if (self.gui_config.O_noise_reduce and self.function == "vc") or (self.gui_config.I_noise_reduce and self.function == "im"):
self.output_buffer[: -self.block_frame] = self.output_buffer[self.block_frame :].clone()
self.output_buffer[-self.block_frame :] = infer_wav[-self.block_frame :]
infer_wav = self.tg(infer_wav.unsqueeze(0), self.output_buffer.unsqueeze(0)).squeeze(0)
if self.gui_config.rms_mix_rate < 1 and self.function == "vc":
rms1 = librosa.feature.rms(y=self.input_wav_res[-160 * infer_wav.shape[0] // self.zc :].cpu().numpy(), frame_length=640, hop_length=160)
rms1 = torch.from_numpy(rms1).to(self.config.device)
rms1 = F.interpolate(rms1.unsqueeze(0), size=infer_wav.shape[0] + 1, mode="linear", align_corners=True)[0, 0, :-1]
rms2 = librosa.feature.rms(y=infer_wav[:].cpu().numpy(), frame_length=4 * self.zc, hop_length=self.zc)
rms2 = torch.from_numpy(rms2).to(self.config.device)
rms2 = F.interpolate(rms2.unsqueeze(0), size=infer_wav.shape[0] + 1, mode="linear", align_corners=True)[0, 0, :-1]
rms2 = torch.max(rms2, torch.zeros_like(rms2) + 1e-3)
infer_wav *= torch.pow(rms1 / rms2, torch.tensor(1 - self.gui_config.rms_mix_rate))
conv_input = infer_wav[None, None, : self.crossfade_frame + self.sola_search_frame]
cor_nom = F.conv1d(conv_input, self.sola_buffer[None, None, :])
cor_den = torch.sqrt(F.conv1d(conv_input**2, torch.ones(1, 1, self.crossfade_frame, device=self.config.device)) + 1e-8)
if sys.platform == "darwin":
_, sola_offset = torch.max(cor_nom[0, 0] / cor_den[0, 0])
sola_offset = sola_offset.item()
else:
sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
logger.info(f"sola_offset = {sola_offset}")
infer_wav = infer_wav[sola_offset : sola_offset + self.block_frame + self.crossfade_frame]
infer_wav[: self.crossfade_frame] *= self.fade_in_window
infer_wav[: self.crossfade_frame] += self.sola_buffer * self.fade_out_window
self.sola_buffer[:] = infer_wav[-self.crossfade_frame :]
if sys.platform == "darwin":
outdata[:] = infer_wav[: -self.crossfade_frame].cpu().numpy()[:, np.newaxis]
else:
outdata[:] = infer_wav[: -self.crossfade_frame].repeat(2, 1).t().cpu().numpy()
total_time = time.perf_counter() - start_time
logger.info(f"Infer time: {total_time:.2f}")
def get_devices(self, update: bool = True):
if update:
sd._terminate()
sd._initialize()
devices = sd.query_devices()
hostapis = sd.query_hostapis()
for hostapi in hostapis:
for device_idx in hostapi["devices"]:
devices[device_idx]["hostapi_name"] = hostapi["name"]
input_devices = [
f"{d['name']} ({d['hostapi_name']})"
for d in devices
if d["max_input_channels"] > 0
]
output_devices = [
f"{d['name']} ({d['hostapi_name']})"
for d in devices
if d["max_output_channels"] > 0
]
input_devices_indices = [
d["index"] if "index" in d else d["name"]
for d in devices
if d["max_input_channels"] > 0
]
output_devices_indices = [
d["index"] if "index" in d else d["name"]
for d in devices
if d["max_output_channels"] > 0
]
return (
input_devices,
output_devices,
input_devices_indices,
output_devices_indices,
)
def set_devices(self, input_device, output_device):
(
input_devices,
output_devices,
input_device_indices,
output_device_indices,
) = self.get_devices()
logger.debug(f"Available input devices: {input_devices}")
logger.debug(f"Available output devices: {output_devices}")
logger.debug(f"Selected input device: {input_device}")
logger.debug(f"Selected output device: {output_device}")
if input_device not in input_devices:
logger.error(f"Input device '{input_device}' is not in the list of available devices")
raise HTTPException(status_code=400, detail=f"Input device '{input_device}' is not available")
if output_device not in output_devices:
logger.error(f"Output device '{output_device}' is not in the list of available devices")
raise HTTPException(status_code=400, detail=f"Output device '{output_device}' is not available")
sd.default.device[0] = input_device_indices[input_devices.index(input_device)]
sd.default.device[1] = output_device_indices[output_devices.index(output_device)]
logger.info(f"Input device set to {sd.default.device[0]}: {input_device}")
logger.info(f"Output device set to {sd.default.device[1]}: {output_device}")
audio_api = AudioAPI()
@app.get("/inputDevices", response_model=list)
def get_input_devices():
try:
input_devices, _, _, _ = audio_api.get_devices()
return input_devices
except Exception as e:
logger.error(f"Failed to get input devices: {e}")
raise HTTPException(status_code=500, detail="Failed to get input devices")
@app.get("/outputDevices", response_model=list)
def get_output_devices():
try:
_, output_devices, _, _ = audio_api.get_devices()
return output_devices
except Exception as e:
logger.error(f"Failed to get output devices: {e}")
raise HTTPException(status_code=500, detail="Failed to get output devices")
@app.post("/config")
def configure_audio(config_data: ConfigData):
try:
logger.info(f"Configuring audio with data: {config_data}")
if audio_api.set_values(config_data):
settings = config_data.dict()
settings["use_jit"] = False
settings["f0method"] = "rmvpe"
with open("configs/config.json", "w", encoding='utf-8') as j:
json.dump(settings, j, ensure_ascii=False)
logger.info("Configuration set successfully")
return {"message": "Configuration set successfully"}
except HTTPException as e:
logger.error(f"Configuration error: {e.detail}")
raise
except Exception as e:
logger.error(f"Configuration failed: {e}")
raise HTTPException(status_code=400, detail=f"Configuration failed: {e}")
@app.post("/start")
def start_conversion():
try:
if not audio_api.flag_vc:
audio_api.start_vc()
return {"message": "Audio conversion started"}
else:
logger.warning("Audio conversion already running")
raise HTTPException(status_code=400, detail="Audio conversion already running")
except HTTPException as e:
logger.error(f"Start conversion error: {e.detail}")
raise
except Exception as e:
logger.error(f"Failed to start conversion: {e}")
raise HTTPException(status_code=500, detail=f"Failed to start conversion: {e}")
@app.post("/stop")
def stop_conversion():
try:
if audio_api.flag_vc:
audio_api.flag_vc = False
global stream_latency
stream_latency = -1
return {"message": "Audio conversion stopped"}
else:
logger.warning("Audio conversion not running")
raise HTTPException(status_code=400, detail="Audio conversion not running")
except HTTPException as e:
logger.error(f"Stop conversion error: {e.detail}")
raise
except Exception as e:
logger.error(f"Failed to stop conversion: {e}")
raise HTTPException(status_code=500, detail=f"Failed to stop conversion: {e}")
if __name__ == "__main__":
if sys.platform == "win32":
from multiprocessing import freeze_support
freeze_support()
load_dotenv()
os.environ["OMP_NUM_THREADS"] = "4"
if sys.platform == "darwin":
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
from tools.torchgate import TorchGate
import tools.rvc_for_realtime as rvc_for_realtime
from configs.config import Config
audio_api.config = Config()
uvicorn.run(app, host="0.0.0.0", port=6242)

565
api_240604.py Normal file
View File

@ -0,0 +1,565 @@
#api for 240604 release version by Xiaokai
import os
import sys
import json
import re
import time
import librosa
import torch
import numpy as np
import torch.nn.functional as F
import torchaudio.transforms as tat
import sounddevice as sd
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import threading
import uvicorn
import logging
from multiprocessing import Queue, Process, cpu_count, freeze_support
# Initialize the logger
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Define FastAPI app
app = FastAPI()
class GUIConfig:
def __init__(self) -> None:
self.pth_path: str = ""
self.index_path: str = ""
self.pitch: int = 0
self.formant: float = 0.0
self.sr_type: str = "sr_model"
self.block_time: float = 0.25 # s
self.threhold: int = -60
self.crossfade_time: float = 0.05
self.extra_time: float = 2.5
self.I_noise_reduce: bool = False
self.O_noise_reduce: bool = False
self.use_pv: bool = False
self.rms_mix_rate: float = 0.0
self.index_rate: float = 0.0
self.n_cpu: int = 4
self.f0method: str = "fcpe"
self.sg_input_device: str = ""
self.sg_output_device: str = ""
class ConfigData(BaseModel):
pth_path: str
index_path: str
sg_input_device: str
sg_output_device: str
threhold: int = -60
pitch: int = 0
formant: float = 0.0
index_rate: float = 0.3
rms_mix_rate: float = 0.0
block_time: float = 0.25
crossfade_length: float = 0.05
extra_time: float = 2.5
n_cpu: int = 4
I_noise_reduce: bool = False
O_noise_reduce: bool = False
use_pv: bool = False
f0method: str = "fcpe"
class Harvest(Process):
def __init__(self, inp_q, opt_q):
super(Harvest, self).__init__()
self.inp_q = inp_q
self.opt_q = opt_q
def run(self):
import numpy as np
import pyworld
while True:
idx, x, res_f0, n_cpu, ts = self.inp_q.get()
f0, t = pyworld.harvest(
x.astype(np.double),
fs=16000,
f0_ceil=1100,
f0_floor=50,
frame_period=10,
)
res_f0[idx] = f0
if len(res_f0.keys()) >= n_cpu:
self.opt_q.put(ts)
class AudioAPI:
def __init__(self) -> None:
self.gui_config = GUIConfig()
self.config = None # Initialize Config object as None
self.flag_vc = False
self.function = "vc"
self.delay_time = 0
self.rvc = None # Initialize RVC object as None
self.inp_q = None
self.opt_q = None
self.n_cpu = min(cpu_count(), 8)
def initialize_queues(self):
self.inp_q = Queue()
self.opt_q = Queue()
for _ in range(self.n_cpu):
p = Harvest(self.inp_q, self.opt_q)
p.daemon = True
p.start()
def load(self):
input_devices, output_devices, _, _ = self.get_devices()
try:
with open("configs/config.json", "r", encoding='utf-8') as j:
data = json.load(j)
if data["sg_input_device"] not in input_devices:
data["sg_input_device"] = input_devices[sd.default.device[0]]
if data["sg_output_device"] not in output_devices:
data["sg_output_device"] = output_devices[sd.default.device[1]]
except Exception as e:
logger.error(f"Failed to load configuration: {e}")
with open("configs/config.json", "w", encoding='utf-8') as j:
data = {
"pth_path": "",
"index_path": "",
"sg_input_device": input_devices[sd.default.device[0]],
"sg_output_device": output_devices[sd.default.device[1]],
"threhold": -60,
"pitch": 0,
"formant": 0.0,
"index_rate": 0,
"rms_mix_rate": 0,
"block_time": 0.25,
"crossfade_length": 0.05,
"extra_time": 2.5,
"n_cpu": 4,
"f0method": "fcpe",
"use_jit": False,
"use_pv": False,
}
json.dump(data, j, ensure_ascii=False)
return data
def set_values(self, values):
logger.info(f"Setting values: {values}")
if not values.pth_path.strip():
raise HTTPException(status_code=400, detail="Please select a .pth file")
if not values.index_path.strip():
raise HTTPException(status_code=400, detail="Please select an index file")
self.set_devices(values.sg_input_device, values.sg_output_device)
self.config.use_jit = False
self.gui_config.pth_path = values.pth_path
self.gui_config.index_path = values.index_path
self.gui_config.threhold = values.threhold
self.gui_config.pitch = values.pitch
self.gui_config.formant = values.formant
self.gui_config.block_time = values.block_time
self.gui_config.crossfade_time = values.crossfade_length
self.gui_config.extra_time = values.extra_time
self.gui_config.I_noise_reduce = values.I_noise_reduce
self.gui_config.O_noise_reduce = values.O_noise_reduce
self.gui_config.rms_mix_rate = values.rms_mix_rate
self.gui_config.index_rate = values.index_rate
self.gui_config.n_cpu = values.n_cpu
self.gui_config.use_pv = values.use_pv
self.gui_config.f0method = values.f0method
return True
def start_vc(self):
torch.cuda.empty_cache()
self.flag_vc = True
self.rvc = rvc_for_realtime.RVC(
self.gui_config.pitch,
self.gui_config.pth_path,
self.gui_config.index_path,
self.gui_config.index_rate,
self.gui_config.n_cpu,
self.inp_q,
self.opt_q,
self.config,
self.rvc if self.rvc else None,
)
self.gui_config.samplerate = (
self.rvc.tgt_sr
if self.gui_config.sr_type == "sr_model"
else self.get_device_samplerate()
)
self.zc = self.gui_config.samplerate // 100
self.block_frame = (
int(
np.round(
self.gui_config.block_time
* self.gui_config.samplerate
/ self.zc
)
)
* self.zc
)
self.block_frame_16k = 160 * self.block_frame // self.zc
self.crossfade_frame = (
int(
np.round(
self.gui_config.crossfade_time
* self.gui_config.samplerate
/ self.zc
)
)
* self.zc
)
self.sola_buffer_frame = min(self.crossfade_frame, 4 * self.zc)
self.sola_search_frame = self.zc
self.extra_frame = (
int(
np.round(
self.gui_config.extra_time
* self.gui_config.samplerate
/ self.zc
)
)
* self.zc
)
self.input_wav = torch.zeros(
self.extra_frame
+ self.crossfade_frame
+ self.sola_search_frame
+ self.block_frame,
device=self.config.device,
dtype=torch.float32,
)
self.input_wav_denoise = self.input_wav.clone()
self.input_wav_res = torch.zeros(
160 * self.input_wav.shape[0] // self.zc,
device=self.config.device,
dtype=torch.float32,
)
self.rms_buffer = np.zeros(4 * self.zc, dtype="float32")
self.sola_buffer = torch.zeros(
self.sola_buffer_frame, device=self.config.device, dtype=torch.float32
)
self.nr_buffer = self.sola_buffer.clone()
self.output_buffer = self.input_wav.clone()
self.skip_head = self.extra_frame // self.zc
self.return_length = (
self.block_frame + self.sola_buffer_frame + self.sola_search_frame
) // self.zc
self.fade_in_window = (
torch.sin(
0.5
* np.pi
* torch.linspace(
0.0,
1.0,
steps=self.sola_buffer_frame,
device=self.config.device,
dtype=torch.float32,
)
)
** 2
)
self.fade_out_window = 1 - self.fade_in_window
self.resampler = tat.Resample(
orig_freq=self.gui_config.samplerate,
new_freq=16000,
dtype=torch.float32,
).to(self.config.device)
if self.rvc.tgt_sr != self.gui_config.samplerate:
self.resampler2 = tat.Resample(
orig_freq=self.rvc.tgt_sr,
new_freq=self.gui_config.samplerate,
dtype=torch.float32,
).to(self.config.device)
else:
self.resampler2 = None
self.tg = TorchGate(
sr=self.gui_config.samplerate, n_fft=4 * self.zc, prop_decrease=0.9
).to(self.config.device)
thread_vc = threading.Thread(target=self.soundinput)
thread_vc.start()
def soundinput(self):
channels = 1 if sys.platform == "darwin" else 2
with sd.Stream(
channels=channels,
callback=self.audio_callback,
blocksize=self.block_frame,
samplerate=self.gui_config.samplerate,
dtype="float32",
) as stream:
global stream_latency
stream_latency = stream.latency[-1]
while self.flag_vc:
time.sleep(self.gui_config.block_time)
logger.info("Audio block passed.")
logger.info("Ending VC")
def audio_callback(self, indata: np.ndarray, outdata: np.ndarray, frames, times, status):
start_time = time.perf_counter()
indata = librosa.to_mono(indata.T)
if self.gui_config.threhold > -60:
indata = np.append(self.rms_buffer, indata)
rms = librosa.feature.rms(y=indata, frame_length=4 * self.zc, hop_length=self.zc)[:, 2:]
self.rms_buffer[:] = indata[-4 * self.zc :]
indata = indata[2 * self.zc - self.zc // 2 :]
db_threhold = (
librosa.amplitude_to_db(rms, ref=1.0)[0] < self.gui_config.threhold
)
for i in range(db_threhold.shape[0]):
if db_threhold[i]:
indata[i * self.zc : (i + 1) * self.zc] = 0
indata = indata[self.zc // 2 :]
self.input_wav[: -self.block_frame] = self.input_wav[self.block_frame :].clone()
self.input_wav[-indata.shape[0] :] = torch.from_numpy(indata).to(self.config.device)
self.input_wav_res[: -self.block_frame_16k] = self.input_wav_res[self.block_frame_16k :].clone()
# input noise reduction and resampling
if self.gui_config.I_noise_reduce:
self.input_wav_denoise[: -self.block_frame] = self.input_wav_denoise[self.block_frame :].clone()
input_wav = self.input_wav[-self.sola_buffer_frame - self.block_frame :]
input_wav = self.tg(input_wav.unsqueeze(0), self.input_wav.unsqueeze(0)).squeeze(0)
input_wav[: self.sola_buffer_frame] *= self.fade_in_window
input_wav[: self.sola_buffer_frame] += self.nr_buffer * self.fade_out_window
self.input_wav_denoise[-self.block_frame :] = input_wav[: self.block_frame]
self.nr_buffer[:] = input_wav[self.block_frame :]
self.input_wav_res[-self.block_frame_16k - 160 :] = self.resampler(
self.input_wav_denoise[-self.block_frame - 2 * self.zc :]
)[160:]
else:
self.input_wav_res[-160 * (indata.shape[0] // self.zc + 1) :] = (
self.resampler(self.input_wav[-indata.shape[0] - 2 * self.zc :])[160:]
)
# infer
if self.function == "vc":
infer_wav = self.rvc.infer(
self.input_wav_res,
self.block_frame_16k,
self.skip_head,
self.return_length,
self.gui_config.f0method,
)
if self.resampler2 is not None:
infer_wav = self.resampler2(infer_wav)
elif self.gui_config.I_noise_reduce:
infer_wav = self.input_wav_denoise[self.extra_frame :].clone()
else:
infer_wav = self.input_wav[self.extra_frame :].clone()
# output noise reduction
if self.gui_config.O_noise_reduce and self.function == "vc":
self.output_buffer[: -self.block_frame] = self.output_buffer[self.block_frame :].clone()
self.output_buffer[-self.block_frame :] = infer_wav[-self.block_frame :]
infer_wav = self.tg(infer_wav.unsqueeze(0), self.output_buffer.unsqueeze(0)).squeeze(0)
# volume envelop mixing
if self.gui_config.rms_mix_rate < 1 and self.function == "vc":
if self.gui_config.I_noise_reduce:
input_wav = self.input_wav_denoise[self.extra_frame :]
else:
input_wav = self.input_wav[self.extra_frame :]
rms1 = librosa.feature.rms(
y=input_wav[: infer_wav.shape[0]].cpu().numpy(),
frame_length=4 * self.zc,
hop_length=self.zc,
)
rms1 = torch.from_numpy(rms1).to(self.config.device)
rms1 = F.interpolate(
rms1.unsqueeze(0),
size=infer_wav.shape[0] + 1,
mode="linear",
align_corners=True,
)[0, 0, :-1]
rms2 = librosa.feature.rms(
y=infer_wav[:].cpu().numpy(),
frame_length=4 * self.zc,
hop_length=self.zc,
)
rms2 = torch.from_numpy(rms2).to(self.config.device)
rms2 = F.interpolate(
rms2.unsqueeze(0),
size=infer_wav.shape[0] + 1,
mode="linear",
align_corners=True,
)[0, 0, :-1]
rms2 = torch.max(rms2, torch.zeros_like(rms2) + 1e-3)
infer_wav *= torch.pow(
rms1 / rms2, torch.tensor(1 - self.gui_config.rms_mix_rate)
)
# SOLA algorithm from https://github.com/yxlllc/DDSP-SVC
conv_input = infer_wav[None, None, : self.sola_buffer_frame + self.sola_search_frame]
cor_nom = F.conv1d(conv_input, self.sola_buffer[None, None, :])
cor_den = torch.sqrt(
F.conv1d(
conv_input**2,
torch.ones(1, 1, self.sola_buffer_frame, device=self.config.device),
)
+ 1e-8
)
if sys.platform == "darwin":
_, sola_offset = torch.max(cor_nom[0, 0] / cor_den[0, 0])
sola_offset = sola_offset.item()
else:
sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
logger.info(f"sola_offset = {sola_offset}")
infer_wav = infer_wav[sola_offset:]
if "privateuseone" in str(self.config.device) or not self.gui_config.use_pv:
infer_wav[: self.sola_buffer_frame] *= self.fade_in_window
infer_wav[: self.sola_buffer_frame] += self.sola_buffer * self.fade_out_window
else:
infer_wav[: self.sola_buffer_frame] = phase_vocoder(
self.sola_buffer,
infer_wav[: self.sola_buffer_frame],
self.fade_out_window,
self.fade_in_window,
)
self.sola_buffer[:] = infer_wav[
self.block_frame : self.block_frame + self.sola_buffer_frame
]
if sys.platform == "darwin":
outdata[:] = infer_wav[: self.block_frame].cpu().numpy()[:, np.newaxis]
else:
outdata[:] = infer_wav[: self.block_frame].repeat(2, 1).t().cpu().numpy()
total_time = time.perf_counter() - start_time
logger.info(f"Infer time: {total_time:.2f}")
def get_devices(self, update: bool = True):
if update:
sd._terminate()
sd._initialize()
devices = sd.query_devices()
hostapis = sd.query_hostapis()
for hostapi in hostapis:
for device_idx in hostapi["devices"]:
devices[device_idx]["hostapi_name"] = hostapi["name"]
input_devices = [
f"{d['name']} ({d['hostapi_name']})"
for d in devices
if d["max_input_channels"] > 0
]
output_devices = [
f"{d['name']} ({d['hostapi_name']})"
for d in devices
if d["max_output_channels"] > 0
]
input_devices_indices = [
d["index"] if "index" in d else d["name"]
for d in devices
if d["max_input_channels"] > 0
]
output_devices_indices = [
d["index"] if "index" in d else d["name"]
for d in devices
if d["max_output_channels"] > 0
]
return (
input_devices,
output_devices,
input_devices_indices,
output_devices_indices,
)
def set_devices(self, input_device, output_device):
(
input_devices,
output_devices,
input_device_indices,
output_device_indices,
) = self.get_devices()
logger.debug(f"Available input devices: {input_devices}")
logger.debug(f"Available output devices: {output_devices}")
logger.debug(f"Selected input device: {input_device}")
logger.debug(f"Selected output device: {output_device}")
if input_device not in input_devices:
logger.error(f"Input device '{input_device}' is not in the list of available devices")
raise HTTPException(status_code=400, detail=f"Input device '{input_device}' is not available")
if output_device not in output_devices:
logger.error(f"Output device '{output_device}' is not in the list of available devices")
raise HTTPException(status_code=400, detail=f"Output device '{output_device}' is not available")
sd.default.device[0] = input_device_indices[input_devices.index(input_device)]
sd.default.device[1] = output_device_indices[output_devices.index(output_device)]
logger.info(f"Input device set to {sd.default.device[0]}: {input_device}")
logger.info(f"Output device set to {sd.default.device[1]}: {output_device}")
audio_api = AudioAPI()
@app.get("/inputDevices", response_model=list)
def get_input_devices():
try:
input_devices, _, _, _ = audio_api.get_devices()
return input_devices
except Exception as e:
logger.error(f"Failed to get input devices: {e}")
raise HTTPException(status_code=500, detail="Failed to get input devices")
@app.get("/outputDevices", response_model=list)
def get_output_devices():
try:
_, output_devices, _, _ = audio_api.get_devices()
return output_devices
except Exception as e:
logger.error(f"Failed to get output devices: {e}")
raise HTTPException(status_code=500, detail="Failed to get output devices")
@app.post("/config")
def configure_audio(config_data: ConfigData):
try:
logger.info(f"Configuring audio with data: {config_data}")
if audio_api.set_values(config_data):
settings = config_data.dict()
settings["use_jit"] = False
with open("configs/config.json", "w", encoding='utf-8') as j:
json.dump(settings, j, ensure_ascii=False)
logger.info("Configuration set successfully")
return {"message": "Configuration set successfully"}
except HTTPException as e:
logger.error(f"Configuration error: {e.detail}")
raise
except Exception as e:
logger.error(f"Configuration failed: {e}")
raise HTTPException(status_code=400, detail=f"Configuration failed: {e}")
@app.post("/start")
def start_conversion():
try:
if not audio_api.flag_vc:
audio_api.start_vc()
return {"message": "Audio conversion started"}
else:
logger.warning("Audio conversion already running")
raise HTTPException(status_code=400, detail="Audio conversion already running")
except HTTPException as e:
logger.error(f"Start conversion error: {e.detail}")
raise
except Exception as e:
logger.error(f"Failed to start conversion: {e}")
raise HTTPException(status_code=500, detail="Failed to start conversion: {e}")
@app.post("/stop")
def stop_conversion():
try:
if audio_api.flag_vc:
audio_api.flag_vc = False
global stream_latency
stream_latency = -1
return {"message": "Audio conversion stopped"}
else:
logger.warning("Audio conversion not running")
raise HTTPException(status_code=400, detail="Audio conversion not running")
except HTTPException as e:
logger.error(f"Stop conversion error: {e.detail}")
raise
except Exception as e:
logger.error(f"Failed to stop conversion: {e}")
raise HTTPException(status_code=500, detail="Failed to stop conversion: {e}")
if __name__ == "__main__":
if sys.platform == "win32":
freeze_support()
load_dotenv()
os.environ["OMP_NUM_THREADS"] = "4"
if sys.platform == "darwin":
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
from tools.torchgate import TorchGate
import tools.rvc_for_realtime as rvc_for_realtime
from configs.config import Config
audio_api.config = Config()
audio_api.initialize_queues()
uvicorn.run(app, host="0.0.0.0", port=6242)

2
assets/indices/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1 +1 @@
{"pth_path": "assets/weights/kikiV1.pth", "index_path": "logs/kikiV1.index", "sg_input_device": "VoiceMeeter Output (VB-Audio Vo (MME)", "sg_output_device": "VoiceMeeter Input (VB-Audio Voi (MME)", "threhold": -45.0, "pitch": 2.0, "rms_mix_rate": 0.0, "index_rate": 0.0, "block_time": 0.52, "crossfade_length": 0.15, "extra_time": 2.46, "n_cpu": 6.0, "use_jit": false, "f0method": "rmvpe"}
{"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"}

View File

@ -2,6 +2,7 @@ import argparse
import os
import sys
import json
import shutil
from multiprocessing import cpu_count
import torch
@ -58,13 +59,17 @@ class Config:
self.dml,
) = self.arg_parse()
self.instead = ""
self.preprocess_per = 3.7
self.x_pad, self.x_query, self.x_center, self.x_max = self.device_config()
@staticmethod
def load_config_json() -> dict:
d = {}
for config_file in version_config_list:
with open(f"configs/{config_file}", "r") as f:
p = f"configs/inuse/{config_file}"
if not os.path.exists(p):
shutil.copy(f"configs/{config_file}", p)
with open(f"configs/inuse/{config_file}", "r") as f:
d[config_file] = json.load(f)
return d
@ -123,15 +128,13 @@ class Config:
def use_fp32_config(self):
for config_file in version_config_list:
self.json_config[config_file]["train"]["fp16_run"] = False
with open(f"configs/{config_file}", "r") as f:
with open(f"configs/inuse/{config_file}", "r") as f:
strr = f.read().replace("true", "false")
with open(f"configs/{config_file}", "w") as f:
with open(f"configs/inuse/{config_file}", "w") as f:
f.write(strr)
with open("infer/modules/train/preprocess.py", "r") as f:
strr = f.read().replace("3.7", "3.0")
with open("infer/modules/train/preprocess.py", "w") as f:
f.write(strr)
print("overwrite preprocess and configs.json")
logger.info("overwrite " + config_file)
self.preprocess_per = 3.0
logger.info("overwrite preprocess_per to %d" % (self.preprocess_per))
def device_config(self) -> tuple:
if torch.cuda.is_available():
@ -161,10 +164,7 @@ class Config:
+ 0.4
)
if self.gpu_mem <= 4:
with open("infer/modules/train/preprocess.py", "r") as f:
strr = f.read().replace("3.7", "3.0")
with open("infer/modules/train/preprocess.py", "w") as f:
f.write(strr)
self.preprocess_per = 3.0
elif self.has_mps():
logger.info("No supported Nvidia GPU found")
self.device = self.instead = "mps"
@ -247,5 +247,8 @@ class Config:
)
except:
pass
print("is_half:%s, device:%s" % (self.is_half, self.device))
logger.info(
"Half-precision floating-point: %s, device: %s"
% (self.is_half, self.device)
)
return x_pad, x_query, x_center, x_max

4
configs/inuse/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*
!.gitignore
!v1
!v2

2
configs/inuse/v1/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
configs/inuse/v2/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -14,44 +14,52 @@ An easy-to-use Voice Conversion framework based on VITS.<br><br>
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
</div>
------
[**Changelog**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_EN.md) | [**FAQ (Frequently Asked Questions)**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/FAQ-(Frequently-Asked-Questions))
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Türkçe**](../tr/README.tr.md)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Français**](../fr/README.fr.md) | [**Türkçe**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
</div>
Check our [Demo Video](https://www.bilibili.com/video/BV1pm4y1z7Gm/) here!
> Check out our [Demo Video](https://www.bilibili.com/video/BV1pm4y1z7Gm/) here!
Training/Inference WebUIgo-web.bat
<table>
<tr>
<td align="center">Training and inference Webui</td>
<td align="center">Real-time voice changing GUI</td>
</tr>
<tr>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/092e5c12-0d49-4168-a590-0b0ef6a4f630"></td>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/730b4114-8805-44a1-ab1a-04668f3c30a6"></td>
</tr>
<tr>
<td align="center">go-web.bat</td>
<td align="center">go-realtime-gui.bat</td>
</tr>
<tr>
<td align="center">You can freely choose the action you want to perform.</td>
<td align="center">We have achieved an end-to-end latency of 170ms. With the use of ASIO input and output devices, we have managed to achieve an end-to-end latency of 90ms, but it is highly dependent on hardware driver support.</td>
</tr>
</table>
![image](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/00387c1c-51b1-4010-947d-3f3ecac95b87)
> The dataset for the pre-training model uses nearly 50 hours of high quality audio from the VCTK open source dataset.
Realtime Voice Conversion GUIgo-realtime-gui.bat
![image](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/143246a9-8b42-4dd1-a197-430ede4d15d7)
> The dataset for the pre-training model uses nearly 50 hours of high quality VCTK open source dataset.
> High quality licensed song datasets will be added to training-set one after another for your use, without worrying about copyright infringement.
> High quality licensed song datasets will be added to the training-set often for your use, without having to worry about copyright infringement.
> Please look forward to the pretrained base model of RVCv3, which has larger parameters, more training data, better results, unchanged inference speed, and requires less training data for training.
## Summary
This repository has the following features:
## Features:
+ Reduce tone leakage by replacing the source feature to training-set feature using top1 retrieval;
+ Easy and fast training, even on relatively poor graphics cards;
+ Training with a small amount of data also obtains relatively good results (>=10min low noise speech recommended);
+ Supporting model fusion to change timbres (using ckpt processing tab->ckpt merge);
+ Easy-to-use Webui interface;
+ Use the UVR5 model to quickly separate vocals and instruments.
+ Use the most powerful High-pitch Voice Extraction Algorithm [InterSpeech2023-RMVPE](#Credits) to prevent the muted sound problem. Provides the best results (significantly) and is faster, with even lower resource consumption than Crepe_full.
+ AMD/Intel graphics cards acceleration supported.
+ Easy + fast training, even on poor graphics cards;
+ Training with a small amounts of data (>=10min low noise speech recommended);
+ Model fusion to change timbres (using ckpt processing tab->ckpt merge);
+ Easy-to-use WebUI;
+ UVR5 model to quickly separate vocals and instruments;
+ High-pitch Voice Extraction Algorithm [InterSpeech2023-RMVPE](#Credits) to prevent a muted sound problem. Provides the best results (significantly) and is faster with lower resource consumption than Crepe_full;
+ AMD/Intel graphics cards acceleration supported;
+ Intel ARC graphics cards acceleration with IPEX supported.
## Preparing the environment
The following commands need to be executed in the environment of Python version 3.8 or higher.
The following commands need to be executed with Python 3.8 or higher.
(Windows/Linux)
First install the main dependencies through pip:
@ -125,15 +133,6 @@ If you want to test the v2 version model (the v2 version model has changed the i
./assets/pretrained_v2
#If you are using Windows, you may also need these two files, skip if FFmpeg and FFprobe are installed
ffmpeg.exe
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe
ffprobe.exe
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe
If you want to use the latest SOTA RMVPE vocal pitch extraction algorithm, you need to download the RMVPE weights and place them in the RVC root directory
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt
@ -144,14 +143,22 @@ https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt
```
Intel ARC graphics cards users needs to run `source /opt/intel/oneapi/setvars.sh` command before starting Webui.
### 2. Install FFmpeg
If you have FFmpeg and FFprobe installed on your computer, you can skip this step.
Then use this command to start Webui:
#### For Ubuntu/Debian users
```bash
python infer-web.py
sudo apt install ffmpeg
```
#### For MacOS users
```bash
brew install ffmpeg
```
#### For Windows users
Download these files and place them in the root folder:
- [ffmpeg.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe)
If you are using Windows or macOS, you can download and extract `RVC-beta.7z` to use RVC directly by using `go-web.bat` on windows or `sh ./run.sh` on macOS to start Webui.
- [ffprobe.exe](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe)
## ROCm Support for AMD graphic cards (Linux only)
To use ROCm on Linux install all required drivers as described [here](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html).
@ -166,16 +173,30 @@ You might also need to set these environment variables (e.g. on a RX6700XT):
export ROCM_PATH=/opt/rocm
export HSA_OVERRIDE_GFX_VERSION=10.3.0
````
Also make sure your user is part of the `render` and `video` group:
Make sure your user is part of the `render` and `video` group:
````
sudo usermod -aG render $USERNAME
sudo usermod -aG video $USERNAME
````
After that you can run the WebUI:
## Get started
### start up directly
Use the following command to start WebUI:
```bash
python infer-web.py
```
### Use the integration package
Download and extract file `RVC-beta.7z`, then follow the steps below according to your system:
#### For Windows users
Double click `go-web.bat`
#### For MacOS users
```bash
sh ./run.sh
```
### For Intel IPEX users (Linux Only)
```bash
source /opt/intel/oneapi/setvars.sh
```
## Credits
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
+ [VITS](https://github.com/jaywalnut310/vits)

View File

@ -14,13 +14,13 @@ Un framework simple et facile à utiliser pour la conversion vocale (modificateu
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
[**Journal de mise à jour**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_CN.md) | [**FAQ**](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·Formation d'un chanteur AI pour 5 centimes**](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) | [**Enregistrement des expériences comparatives**](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)) | [**Démonstration en ligne**](https://huggingface.co/spaces/Ricecake123/RVC-demo)
[**Journal de mise à jour**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_CN.md) | [**FAQ**](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·Formation d'un chanteur AI pour 5 centimes**](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) | [**Enregistrement des expériences comparatives**](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) | [**Démonstration en ligne**](https://huggingface.co/spaces/Ricecake123/RVC-demo)
</div>
------
[**English**](./docs/en/README.en.md) |[ **中文简体**](./docs/cn/README.md) | [**日本語**](./docs/jp/README.ja.md) | [**한국어**](./docs/kr/README.ko.md) ([**韓國語**](./docs/kr/README.ko.han.md)) | [**Turc**](./docs/tr/README.tr.md)
[**English**](../en/README.en.md) | [ **中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Français**](../fr/README.fr.md) | [**Turc**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
Cliquez ici pour voir notre [vidéo de démonstration](https://www.bilibili.com/video/BV1pm4y1z7Gm/) !
@ -39,10 +39,10 @@ Ce dépôt a les caractéristiques suivantes :
+ Interface web simple et facile à utiliser.
+ Peut appeler le modèle UVR5 pour séparer rapidement la voix et l'accompagnement.
+ Utilise l'algorithme de pitch vocal le plus avancé [InterSpeech2023-RMVPE](#projets-référencés) pour éliminer les problèmes de voix muette. Meilleurs résultats, plus rapide que crepe_full, et moins gourmand en ressources.
+ Support d'accélération pour les cartes A et I.
+ Support d'accélération pour les cartes AMD et Intel.
## Configuration de l'environnement
Exécutez les commandes suivantes dans un environnement Python de version supérieure à 3.8.
Exécutez les commandes suivantes dans un environnement Python de version 3.8 ou supérieure.
(Windows/Linux)
Installez d'abord les dépendances principales via pip :
@ -52,7 +52,10 @@ Installez d'abord les dépendances principales via pip :
pip install torch torchvision torchaudio
# Pour les utilisateurs de Windows avec une architecture Nvidia Ampere (RTX30xx), en se basant sur l'expérience #21, spécifiez la version CUDA correspondante pour Pytorch.
# pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
# Pour Linux + carte AMD, utilisez cette version de Pytorch:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2
```
Vous pouvez utiliser poetry pour installer les dépendances :
@ -67,15 +70,17 @@ poetry install
Ou vous pouvez utiliser pip pour installer les dépendances :
```bash
Cartes Nvidia :
# Cartes Nvidia :
pip install -r requirements.txt
Cartes AMD/Intel :
pip install -
# Cartes AMD/Intel :
pip install -r requirements-dml.txt
r requirements-dml.txt
# Cartes Intel avec IPEX
pip install -r requirements-ipex.txt
# Cartes AMD sur Linux (ROCm)
pip install -r requirements-amd.txt
```
------
@ -87,7 +92,12 @@ sh ./run.sh
## Préparation d'autres modèles pré-entraînés
RVC nécessite d'autres modèles pré-entraînés pour l'inférence et la formation.
Vous pouvez télécharger ces modèles depuis notre [espace Hugging Face](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/).
```bash
#Télécharger tous les modèles depuis https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/
python tools/download_models.py
```
Ou vous pouvez télécharger ces modèles depuis notre [espace Hugging Face](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/).
Voici une liste des modèles et autres fichiers requis par RVC :
```bash
@ -97,29 +107,30 @@ Voici une liste des modèles et autres fichiers requis par RVC :
./assets/uvr5_weights
Pour tester la version v2 du modèle, téléchargez également :
# Pour tester la version v2 du modèle, téléchargez également :
./assets/pretrained_v2
Si vous utilisez Windows, vous pourriez avoir besoin de ces fichiers pour ffmpeg et ffprobe, sautez cette étape si vous avez déjà installé ffmpeg et ffprobe. Les utilisateurs d'ubuntu/debian peuvent installer ces deux bibliothèques avec apt install ffmpeg. Les utilisateurs de Mac peuvent les installer avec brew install ffmpeg (prérequis : avoir installé brew).
# Si vous utilisez Windows, vous pourriez avoir besoin de ces fichiers pour ffmpeg et ffprobe, sautez cette étape si vous avez déjà installé ffmpeg et ffprobe. Les utilisateurs d'ubuntu/debian peuvent installer ces deux bibliothèques avec apt install ffmpeg. Les utilisateurs de Mac peuvent les installer avec brew install ffmpeg (prérequis : avoir installé brew).
./ffmpeg
# ./ffmpeg
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe
./ffprobe
# ./ffprobe
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe
Si vous souhaitez utiliser le dernier algorithme RMVPE de pitch vocal, téléchargez les paramètres du modèle de pitch et placez-les dans le répertoire racine de RVC.
# Si vous souhaitez utiliser le dernier algorithme RMVPE de pitch vocal, téléchargez les paramètres du modèle de pitch et placez-les dans le répertoire racine de RVC.
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt
Les utilisateurs de cartes AMD/Intel nécessitant l'environnement DML doivent télécharger :
# Les utilisateurs de cartes AMD/Intel nécessitant l'environnement DML doivent télécharger :
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx
```
Pour les utilisateurs d'Intel ARC avec IPEX, exécutez d'abord `source /opt/intel/oneapi/setvars.sh`.
Ensuite, exécutez la commande suivante pour démarrer WebUI :
```bash
python infer-web.py
@ -127,7 +138,28 @@ python infer-web.py
Si vous utilisez Windows ou macOS, vous pouvez télécharger et extraire `RVC-beta.7z`. Les utilisateurs de Windows peuvent exécuter `go-web.bat` pour démarrer WebUI, tandis que les utilisateurs de macOS peuvent exécuter `sh ./run.sh`.
Il y a également un `Guide facile pour les débutants.doc` inclus pour référence.
## Compatibilité ROCm pour les cartes AMD (seulement Linux)
Installez tous les pilotes décrits [ici](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html).
Sur Arch utilisez pacman pour installer le pilote:
````
pacman -S rocm-hip-sdk rocm-opencl-sdk
````
Vous devrez peut-être créer ces variables d'environnement (par exemple avec RX6700XT):
````
export ROCM_PATH=/opt/rocm
export HSA_OVERRIDE_GFX_VERSION=10.3.0
````
Assurez-vous que votre utilisateur est dans les groupes `render` et `video`:
````
sudo usermod -aG render $USERNAME
sudo usermod -aG video $USERNAME
````
Enfin vous pouvez exécuter WebUI:
```bash
python infer-web.py
```
## Crédits
+ [ContentVec](https://github.com/auspicious3000/contentvec/)

123
docs/jp/Changelog_JA.md Normal file
View File

@ -0,0 +1,123 @@
### 2023 年 10 月 6 日更新
リアルタイム声変換のためのインターフェース go-realtime-gui.bat/gui_v1.py を作成しました実際には既に存在していました。今回のアップデートでは、リアルタイム声変換のパフォーマンスを重点的に最適化しました。0813 版との比較:
- 1. インターフェース操作の最適化:パラメータのホット更新(パラメータ調整時に中断して再起動する必要がない)、レイジーロードモデル(既にロードされたモデルは再ロードする必要がない)、音量因子パラメータ追加(音量を入力オーディオに近づける)
- 2. 内蔵ノイズリダクション効果と速度の最適化
- 3. 推論速度の大幅な最適化
入出力デバイスは同じタイプを選択する必要があります。例えば、両方とも MME タイプを選択します。
1006 バージョンの全体的な更新は:
- 1. rmvpe 音声ピッチ抽出アルゴリズムの効果をさらに向上、特に男性の低音部分で大きな改善
- 2. 推論インターフェースレイアウトの最適化
### 2023 年 8 月 13 日更新
1-通常のバグ修正
- 保存頻度と総ラウンド数の最小値を 1 に変更。総ラウンド数の最小値を 2 に変更
- pretrain モデルなしでのトレーニングエラーを修正
- 伴奏とボーカルの分離完了後の VRAM クリア
- faiss 保存パスを絶対パスから相対パスに変更
- パスに空白が含まれる場合のサポート(トレーニングセットのパス+実験名がサポートされ、エラーにならない)
- filelist の強制的な utf8 エンコーディングをキャンセル
- リアルタイム声変換中にインデックスを有効にすることによる CPU の大幅な使用問題を解決
2-重要なアップデート
- 現在最も強力なオープンソースの人間の声のピッチ抽出モデル RMVPE をトレーニングし、RVC のトレーニング、オフライン/リアルタイム推論に使用。pytorch/onnx/DirectML をサポート
- pytorch-dml を通じて A カードと I カードのサポート
1リアルタイム声変換2推論3ボーカルと伴奏の分離4トレーニングはまだサポートされておらず、CPU でのトレーニングに切り替わります。onnx_dml を通じて rmvpe_gpu の推論をサポート
### 2023 年 6 月 18 日更新
- v2 に 32k と 48k の 2 つの新しい事前トレーニングモデルを追加
- 非 f0 モデルの推論エラーを修正
- 1 時間を超えるトレーニングセットのインデックス構築フェーズでは、自動的に kmeans で特徴を縮小し、インデックスのトレーニングを加速し、検索に追加
- 人間の声をギターに変換するおもちゃのリポジトリを添付
- データ処理で異常値スライスを除外
- onnx エクスポートオプションタブ
失敗した実験:
- ~~特徴検索に時間次元を追加:ダメ、効果がない~~
- ~~特徴検索に PCAR 次元削減オプションを追加:ダメ、大きなデータは kmeans でデータ量を減らし、小さいデータは次元削減の時間が節約するマッチングの時間よりも長い~~
- ~~onnx 推論のサポート推論のみの小さな圧縮パッケージ付きダメ、nsf の生成には pytorch が必要~~
- ~~トレーニング中に音声、ジェンダー、eq、イズなどで入力をランダムに増強ダメ、効果がない~~
- ~~小型声码器の接続調査:ダメ、効果が悪化~~
todolist
- ~~トレーニングセットの音声ピッチ認識に crepe をサポート:既に RMVPE に置き換えられているため不要~~
- ~~多プロセス harvest 推論:既に RMVPE に置き換えられているため不要~~
- ~~crepe の精度サポートと RVC-config の同期:既に RMVPE に置き換えられているため不要。これをサポートするには torchcrepe ライブラリも同期する必要があり、面倒~~
- F0 エディタとの連携
### 2023 年 5 月 28 日更新
- v2 の jupyter notebook を追加、韓国語の changelog を追加、いくつかの環境依存関係を追加
- 呼吸、清辅音、歯音の保護モードを追加
- crepe-full 推論をサポート
- UVR5 人間の声と伴奏の分離に 3 つの遅延除去モデルと MDX-Net の混响除去モデルを追加、HP3 人声抽出モデルを追加
- インデックス名にバージョンと実験名を追加
- 人間の声と伴奏の分離、推論のバッチエクスポートにオーディオエクスポートフォーマットオプションを追加
- 32k モデルのトレーニングを廃止
### 2023 年 5 月 13 日更新
- ワンクリックパッケージ内の古いバージョンの runtime 内の lib.infer_pack と uvr5_pack の残骸をクリア
- トレーニングセットの事前処理の擬似マルチプロセスバグを修正
- harvest による音声ピッチ認識で無声音現象を弱めるために中間値フィルターを追加、中間値フィルターの半径を調整可能
- 音声エクスポートにポストプロセスリサンプリングを追加
- トレーニング時の n_cpu プロセス数を「F0 抽出のみ調整」から「データ事前処理と F0 抽出の調整」に変更
- logs フォルダ下の index パスを自動検出し、ドロップダウンリスト機能を提供
- タブページに「よくある質問」を追加(または github-rvc-wiki を参照)
- 同じパスの入力音声推論に音声ピッチキャッシュを追加用途harvest 音声ピッチ抽出を使用すると、全体のパイプラインが長く繰り返される音声ピッチ抽出プロセスを経験し、キャッシュを使用しない場合、異なる音色、インデックス、音声ピッチ中間値フィルター半径パラメーターをテストするユーザーは、最初のテスト後の待機結果が非常に苦痛になります)
### 2023 年 5 月 14 日更新
- 音量エンベロープのアライメント入力ミックス「入力が無音で出力がわずかなイズ」の問題を緩和することができます。入力音声の背景イズが大きい場合は、オンにしないことをお勧めします。デフォルトではオフ1 として扱われる))
- 指定された頻度で抽出された小型モデルを保存する機能をサポート(異なるエポックでの推論効果を試したいが、すべての大きなチェックポイントを保存して手動で小型モデルを抽出するのが面倒な場合、この機能は非常に便利です)
- システム全体のプロキシが開かれている場合にブラウザの接続エラーが発生する問題を環境変数の設定で解決
- v2 事前訓練モデルをサポート(現在、テストのために 40k バージョンのみが公開されており、他の 2 つのサンプリングレートはまだ完全に訓練されていません)
- 推論前に 1 を超える過大な音量を制限
- データ事前処理パラメーターを微調整
### 2023 年 4 月 9 日更新
- トレーニングパラメーターを修正し、GPU の平均利用率を向上させる。A100 は最高 25から約 90に、V100 は 50から約 90に、2060S は 60から約 85に、P40 は 25から約 95に向上し、トレーニング速度が大幅に向上
- パラメーターを修正:全体の batch_size を各カードの batch_size に変更
- total_epoch を修正:最大制限 100 から 1000 に解除; デフォルト 10 からデフォルト 20 に引き上げ
- ckpt 抽出時に音声ピッチの有無を誤って認識し、推論が異常になる問題を修正
- 分散トレーニングで各ランクが ckpt を 1 回ずつ保存する問題を修正
- 特徴抽出で nan 特徴をフィルタリング
- 入力が無音で出力がランダムな子音またはノイズになる問題を修正(旧バージョンのモデルはトレーニングセットを作り直して再トレーニングする必要があります)
### 2023 年 4 月 16 日更新
- ローカルリアルタイム音声変換ミニ GUI を新設、go-realtime-gui.bat をダブルクリックで起動
- トレーニングと推論で 50Hz 以下の周波数帯をフィルタリング
- トレーニングと推論の音声ピッチ抽出 pyworld の最低音声ピッチをデフォルトの 80 から 50 に下げ、50-80hz の男性低音声が無声にならないように
- WebUI がシステムの地域に基づいて言語を変更する機能をサポート(現在サポートされているのは en_US、ja_JP、zh_CN、zh_HK、zh_SG、zh_TW、サポートされていない場合はデフォルトで en_US になります)
- 一部のグラフィックカードの認識を修正(例えば V100-16G の認識失敗、P4 の認識失敗)
### 2023 年 4 月 28 日更新
- faiss インデックス設定をアップグレードし、速度が速く、品質が高くなりました
- total_npy 依存をキャンセルし、今後のモデル共有では total_npy の記入は不要
- 16 シリーズの制限を解除。4G メモリ GPU に 4G の推論設定を提供
- 一部のオーディオ形式で UVR5 の人声伴奏分離のバグを修正
- リアルタイム音声変換ミニ gui に 40k 以外のモデルと妥協のない音声ピッチモデルのサポートを追加
### 今後の計画:
機能:
- 複数人のトレーニングタブのサポート(最大 4 人)
底層モデル:
- 呼吸 wav をトレーニングセットに追加し、呼吸が音声変換の電子音の問題を修正
- 歌声トレーニングセットを追加した底層モデルをトレーニングしており、将来的には公開する予定です

View File

@ -3,107 +3,255 @@
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
VITSに基づく使いやすい音声変換voice changerframework<br><br>
[![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange
)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
[![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
[![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)
[![Licence](https://img.shields.io/github/license/RVC-Project/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/LICENSE)
[![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)
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
[**更新日誌**](./Changelog_JA.md) | [**よくある質問**](./faq_ja.md) | [**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/%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)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Français**](../fr/README.fr.md) | [**Türkçe**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
</div>
------
[**更新日誌**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_CN.md)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Türkçe**](../tr/README.tr.md)
> デモ動画は[こちら](https://www.bilibili.com/video/BV1pm4y1z7Gm/)でご覧ください。
> RVCによるリアルタイム音声変換: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
> RVC によるリアルタイム音声変換: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
> 著作権侵害を心配することなく使用できるように、基底モデルは約50時間の高品質なオープンソースデータセットで訓練されています。
> 著作権侵害を心配することなく使用できるように、基底モデルは約 50 時間の高品質なオープンソースデータセットで訓練されています。
> 今後も、次々と使用許可のある高品質な歌声の資料集を追加し、基底モデルを訓練する予定です。
> RVCv3 の基底モデルルをご期待ください。より大きなパラメータ、より大きなデータ、より良い効果を提供し、基本的に同様の推論速度を維持しながら、トレーニングに必要なデータ量はより少なくなります。
<table>
<tr>
<td align="center">トレーニングと推論インターフェース</td>
<td align="center">リアルタイム音声変換インターフェース</td>
</tr>
<tr>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/092e5c12-0d49-4168-a590-0b0ef6a4f630"></td>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/730b4114-8805-44a1-ab1a-04668f3c30a6"></td>
</tr>
<tr>
<td align="center">go-web.bat</td>
<td align="center">go-realtime-gui.bat</td>
</tr>
<tr>
<td align="center">実行したい操作を自由に選択できます。</td>
<td align="center">既に端から端までの170msの遅延を実現しました。ASIO入出力デバイスを使用すれば、端から端までの90msの遅延を達成できますが、ハードウェアドライバーのサポートに非常に依存しています。</td>
</tr>
</table>
## はじめに
本リポジトリには下記の特徴があります。
+ Top1検索を用いることで、生の特徴量を訓練用データセット特徴量に変換し、トーンリーケージを削減します。
+ 比較的貧弱なGPUでも、高速かつ簡単に訓練できます。
+ 少量のデータセットからでも、比較的良い結果を得ることができます。10分以上のイズの少ない音声を推奨します。
+ モデルを融合することで、音声を混ぜることができます。ckpt processingタブの、ckpt mergeを使用します。
+ 使いやすいWebUI。
+ UVR5 Modelも含んでいるため、人の声とBGMを素早く分離できます。
- Top1 検索を用いることで、生の特徴量を訓練用データセット特徴量に変換し、トーンリーケージを削減します。
- 比較的貧弱な GPU でも、高速かつ簡単に訓練できます。
- 少量のデータセットからでも、比較的良い結果を得ることができます。10 分以上のノイズの少ない音声を推奨します。)
- モデルを融合することで、音声を混ぜることができます。ckpt processing タブの、ckpt merge を使用します。)
- 使いやすい WebUI。
- UVR5 Model も含んでいるため、人の声と BGM を素早く分離できます。
- 最先端の[人間の声のピッチ抽出アルゴリズム InterSpeech2023-RMVPE](#参照プロジェクト)を使用して無声音問題を解決します。効果は最高著しくで、crepe_full よりも速く、リソース使用が少ないです。
- A カードと I カードの加速サポート
私たちの[デモビデオ](https://www.bilibili.com/video/BV1pm4y1z7Gm/)をチェックしてください!
## 環境構築
Poetryで依存関係をインストールすることをお勧めします。
下記のコマンドは、Python3.8以上の環境で実行する必要があります:
下記のコマンドは、Python3.8 以上の環境で実行する必要があります:
### Windows/Linux/MacOS などのプラットフォーム共通方法
以下の方法のいずれかを選択してください。
#### 1. pip を通じた依存関係のインストール
1. Pytorch 及びその主要な依存関係のインストール、すでにインストールされている場合はスキップ。参照https://pytorch.org/get-started/locally/
```bash
# PyTorch関連の依存関係をインストール。インストール済の場合は省略。
# 参照先: https://pytorch.org/get-started/locally/
pip install torch torchvision torchaudio
#Windows Nvidia Ampere Architecture(RTX30xx)の場合、 #21 に従い、pytorchに対応するcuda versionを指定する必要があります。
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
# PyTorch関連の依存関係をインストール。インストール済の場合は省略。
# 参照先: https://python-poetry.org/docs/#installation
curl -sSL https://install.python-poetry.org | python3 -
# Poetry経由で依存関係をインストール
poetry install
```
pipでも依存関係のインストールが可能です:
2. win システム + Nvidia Ampere アーキテクチャRTX30xxの場合、#21 の経験に基づいて pytorch に対応する cuda バージョンを指定
```bash
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
```
3. 自分のグラフィックカードに合わせた依存関係のインストール
- N カード
```bash
pip install -r requirements.txt
```
## 基底modelsを準備
RVCは推論/訓練のために、様々な事前訓練を行った基底モデルを必要とします。
- A カード/I カード
modelsは[Hugging Face space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)からダウンロードできます。
以下は、RVCに必要な基底モデルやその他のファイルの一覧です。
```bash
./assets/hubert/hubert_base.pt
./assets/pretrained
./assets/uvr5_weights
V2のモデルを使用するには、追加でファイルをダウンロードする必要があります
./assets/pretrained_v2
# ffmpegがすでにinstallされている場合は省略
./ffmpeg
pip install -r requirements-dml.txt
```
その後、下記のコマンドでWebUIを起動します。
- A カード ROCM(Linux)
```bash
pip install -r requirements-amd.txt
```
- I カード IPEX(Linux)
```bash
pip install -r requirements-ipex.txt
```
#### 2. poetry を通じた依存関係のインストール
Poetry 依存関係管理ツールのインストール、すでにインストールされている場合はスキップ。参照https://python-poetry.org/docs/#installation
```bash
curl -sSL https://install.python-poetry.org | python3 -
```
poetry を使って依存関係をインストール
```bash
poetry install
```
### MacOS
`run.sh`を使って依存関係をインストールできます
```bash
sh ./run.sh
```
## その他の事前訓練されたモデルの準備
RVC は推論とトレーニングのために他のいくつかの事前訓練されたモデルが必要です。
これらのモデルは私たちの[Hugging Face space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)でダウンロードできます。
### 1. assets のダウンロード
以下は、RVC に必要なすべての事前学習モデルとその他のファイルのリストです。`tools`フォルダーにこれらをダウンロードするスクリプトがあります。
- ./assets/hubert/hubert_base.pt
- ./assets/pretrained
- ./assets/uvr5_weights
v2 バージョンのモデルを使用する場合、追加で以下をダウンロードする必要があります。
- ./assets/pretrained_v2
### 2. ffmpeg のインストール
ffmpeg と ffprobe が既にインストールされている場合はスキップします。
#### Ubuntu/Debian ユーザー
```bash
sudo apt install ffmpeg
```
#### MacOS ユーザー
```bash
brew install ffmpeg
```
#### Windows ユーザー
ダウンロード後、ルートディレクトリに配置してください。
- [ffmpeg.exe をダウンロード](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe)
- [ffprobe.exe をダウンロード](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe)
### 3. RMVPE 人間の声のピッチ抽出アルゴリズムに必要なファイルのダウンロード
最新の RMVPE 人間の声のピッチ抽出アルゴリズムを使用する場合、ピッチ抽出モデルのパラメータをダウンロードして RVC のルートディレクトリに配置する必要があります。
- [rmvpe.pt をダウンロード](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt)
#### dml 環境の RMVPE をダウンロード(オプション、A カード/I カードユーザー)
- [rmvpe.onnx をダウンロード](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx)
### 4. AMD グラフィックカード Rocm(オプション、Linux のみ)
Linux システムで AMD の Rocm 技術をベースに RVC を実行したい場合、[こちら](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html)で必要なドライバーを先にインストールしてください。
Arch Linux を使用している場合、pacman を使用して必要なドライバーをインストールできます。
```
pacman -S rocm-hip-sdk rocm-opencl-sdk
```
一部のモデルのグラフィックカードRX6700XTの場合、以下のような環境変数を追加で設定する必要があるかもしれません。
```
export ROCM_PATH=/opt/rocm
export HSA_OVERRIDE_GFX_VERSION=10.3.0
```
同時に、現在のユーザーが`render`および`video`ユーザーグループに属していることを確認してください。
```
sudo usermod -aG render $USERNAME
sudo usermod -aG video $USERNAME
```
## 使用開始
### 直接起動
以下のコマンドで WebUI を起動します
```bash
python infer-web.py
```
Windowsをお使いの方は、直接`RVC-beta.7z`をダウンロード後に展開し、`go-web.bat`をクリックすることで、WebUIを起動することができます。(7zipが必要です。)
また、リポジトリに[小白简易教程.doc](./小白简易教程.doc)がありますので、参考にしてください(中国語版のみ)。
### 統合パッケージの使用
`RVC-beta.7z`をダウンロードして解凍
#### Windows ユーザー
`go-web.bat`をダブルクリック
#### MacOS ユーザー
```bash
sh ./run.sh
```
### IPEX 技術が必要な I カードユーザー向け(Linux のみ)
```bash
source /opt/intel/oneapi/setvars.sh
```
## 参考プロジェクト
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
+ [VITS](https://github.com/jaywalnut310/vits)
+ [HIFIGAN](https://github.com/jik876/hifi-gan)
+ [Gradio](https://github.com/gradio-app/gradio)
+ [FFmpeg](https://github.com/FFmpeg/FFmpeg)
+ [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
+ [audio-slicer](https://github.com/openvpi/audio-slicer)
## 貢献者(contributor)の皆様の尽力に感謝します
- [ContentVec](https://github.com/auspicious3000/contentvec/)
- [VITS](https://github.com/jaywalnut310/vits)
- [HIFIGAN](https://github.com/jik876/hifi-gan)
- [Gradio](https://github.com/gradio-app/gradio)
- [FFmpeg](https://github.com/FFmpeg/FFmpeg)
- [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
- [audio-slicer](https://github.com/openvpi/audio-slicer)
- [Vocal pitch extraction:RMVPE](https://github.com/Dream-High/RMVPE)
- 事前訓練されたモデルは[yxlllc](https://github.com/yxlllc/RMVPE)と[RVC-Boss](https://github.com/RVC-Boss)によって訓練され、テストされました。
## すべての貢献者の努力に感謝します
<a href="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=RVC-Project/Retrieval-based-Voice-Conversion-WebUI" />
</a>

122
docs/jp/faq_ja.md Normal file
View File

@ -0,0 +1,122 @@
## Q1: ffmpeg error/utf8 error
大体の場合、ffmpeg の問題ではなく、音声パスの問題です。<br>
ffmpeg は空白や()などの特殊文字を含むパスを読み込む際に ffmpeg error が発生する可能性があります。トレーニングセットの音声が中国語のパスを含む場合、filelist.txt に書き込む際に utf8 error が発生する可能性があります。<br>
## Q2: ワンクリックトレーニングが終わってもインデックスがない
"Training is done. The program is closed."と表示された場合、モデルトレーニングは成功しています。その直後のエラーは誤りです。<br>
ワンクリックトレーニングが終了しても added で始まるインデックスファイルがない場合、トレーニングセットが大きすぎてインデックス追加のステップが停止している可能性があります。バッチ処理 add インデックスでメモリの要求が高すぎる問題を解決しました。一時的に「トレーニングインデックス」ボタンをもう一度クリックしてみてください。<br>
## Q3: トレーニングが終了してもトレーニングセットの音色が見えない
音色をリフレッシュしてもう一度確認してください。それでも見えない場合は、トレーニングにエラーがなかったか、コンソールと WebUI のスクリーンショット、logs/実験名の下のログを開発者に送って確認してみてください。<br>
## Q4: モデルをどのように共有するか
rvc_root/logs/実験名の下に保存されている pth は、推論に使用するために共有するためのものではなく、実験の状態を保存して再現およびトレーニングを続けるためのものです。共有するためのモデルは、weights フォルダの下にある 60MB 以上の pth ファイルです。<br>
今後、weights/exp_name.pth と logs/exp_name/added_xxx.index を組み合わせて weights/exp_name.zip にパッケージ化し、インデックスの記入ステップを省略します。その場合、zip ファイルを共有し、pth ファイルは共有しないでください。別のマシンでトレーニングを続ける場合を除きます。<br>
logs フォルダの数百 MB の pth ファイルを weights フォルダにコピー/共有して推論に強制的に使用すると、f0、tgt_sr などのさまざまなキーが存在しないというエラーが発生する可能性があります。ckpt タブの一番下で、音高、目標オーディオサンプリングレートを手動または自動(ローカルの logs に関連情報が見つかる場合は自動的にで選択してから、ckpt の小型モデルを抽出する必要があります(入力パスに G で始まるものを記入。抽出が完了すると、weights フォルダに 60MB 以上の pth ファイルが表示され、音色をリフレッシュした後に使用できます。<br>
## Q5: Connection Error
コンソール(黒いウィンドウ)を閉じた可能性があります。<br>
## Q6: WebUI が Expecting value: line 1 column 1 (char 0)と表示する
システムのローカルネットワークプロキシ/グローバルプロキシを閉じてください。<br>
これはクライアントのプロキシだけでなく、サーバー側のプロキシも含まれます(例えば autodl で http_proxy と https_proxy を設定して学術的な加速を行っている場合、使用する際には unset でオフにする必要があります)。<br>
## Q7: WebUI を使わずにコマンドでトレーニングや推論を行うには
トレーニングスクリプト:<br>
まず WebUI を実行し、メッセージウィンドウにデータセット処理とトレーニング用のコマンドラインが表示されます。<br>
推論スクリプト:<br>
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py<br>
例:<br>
runtime\python.exe myinfer.py 0 "E:\codes\py39\RVC-beta\todo-songs\1111.wav" "E:\codes\py39\logs\mi-test\added_IVF677_Flat_nprobe_7.index" harvest "test.wav" "weights/mi-test.pth" 0.6 cuda:0 True<br>
f0up_key=sys.argv[1]<br>
input_path=sys.argv[2]<br>
index_path=sys.argv[3]<br>
f0method=sys.argv[4]#harvest or pm<br>
opt_path=sys.argv[5]<br>
model_path=sys.argv[6]<br>
index_rate=float(sys.argv[7])<br>
device=sys.argv[8]<br>
is_half=bool(sys.argv[9])<br>
## Q8: Cuda error/Cuda out of memory
まれに cuda の設定問題やデバイスがサポートされていない可能性がありますが、大半はメモリ不足out of memoryが原因です。<br>
トレーニングの場合は batch size を小さくします1 にしても足りない場合はグラフィックカードを変更するしかありません。推論の場合は、config.py の末尾にある x_pad、x_query、x_center、x_max を適宜小さくします。4GB 以下のメモリ(例えば 10603Gや各種 2GB のグラフィックカードは諦めることをお勧めしますが、4GB のメモリのグラフィックカードはまだ救いがあります。<br>
## Q9: total_epoch はどのくらいに設定するのが良いですか
トレーニングセットの音質が悪く、イズが多い場合は、20〜30 で十分です。高すぎると、ベースモデルの音質が低音質のトレーニングセットを高めることができません。<br>
トレーニングセットの音質が高く、イズが少なく、長い場合は、高く設定できます。200 は問題ありません(トレーニング速度が速いので、高音質のトレーニングセットを準備できる条件がある場合、グラフィックカードも条件が良いはずなので、少しトレーニング時間が長くなることを気にすることはありません)。<br>
## Q10: トレーニングセットはどれくらいの長さが必要ですか
10 分から 50 分を推奨します。
音質が良く、バックグラウンドノイズが低い場合、個人的な特徴のある音色であれば、多ければ多いほど良いです。
高品質のトレーニングセット(精巧に準備された + 特徴的な音色であれば、5 分から 10 分でも大丈夫です。リポジトリの作者もよくこの方法で遊びます。
1 分から 2 分のデータでトレーニングに成功した人もいますが、その成功体験は他人には再現できないため、あまり参考になりません。トレーニングセットの音色が非常に特徴的である必要があります(例:高い周波数の透明な声や少女の声など)、そして音質が良い必要があります。
1 分未満のデータでトレーニングを試みた(成功した)ケースはまだ見たことがありません。このような試みはお勧めしません。
## Q11: index rate は何に使うもので、どのように調整するのか(啓蒙)
もしベースモデルや推論ソースの音質がトレーニングセットよりも高い場合、推論結果の音質を向上させることができますが、音色がベースモデル/推論ソースの音色に近づくことがあります。これを「音色漏れ」と言います。
index rate は音色漏れの問題を減少させたり解決するために使用されます。1 に設定すると、理論的には推論ソースの音色漏れの問題は存在しませんが、音質はトレーニングセットに近づきます。トレーニングセットの音質が推論ソースよりも低い場合、index rate を高くすると音質が低下する可能性があります。0 に設定すると、検索ミックスを利用してトレーニングセットの音色を保護する効果はありません。
トレーニングセットが高品質で長い場合、total_epoch を高く設定することができ、この場合、モデル自体は推論ソースやベースモデルの音色をあまり参照しないため、「音色漏れ」の問題はほとんど発生しません。この時、index rate は重要ではなく、インデックスファイルを作成したり共有したりする必要もありません。
## Q11: 推論時に GPU をどのように選択するか
config.py ファイルの device cuda:の後にカード番号を選択します。
カード番号とグラフィックカードのマッピング関係は、トレーニングタブのグラフィックカード情報欄で確認できます。
## Q12: トレーニング中に保存された pth ファイルをどのように推論するか
ckpt タブの一番下で小型モデルを抽出します。
## Q13: トレーニングをどのように中断し、続行するか
現在の段階では、WebUI コンソールを閉じて go-web.bat をダブルクリックしてプログラムを再起動するしかありません。ウェブページのパラメータもリフレッシュして再度入力する必要があります。
トレーニングを続けるには:同じウェブページのパラメータでトレーニングモデルをクリックすると、前回のチェックポイントからトレーニングを続けます。
## Q14: トレーニング中にファイルページ/メモリエラーが発生した場合の対処法
プロセスが多すぎてメモリがオーバーフローしました。以下の方法で解決できるかもしれません。
1. 「音高抽出とデータ処理に使用する CPU プロセス数」を適宜下げます。
2. トレーニングセットのオーディオを手動でカットして、あまり長くならないようにします。
## Q15: 途中でデータを追加してトレーニングする方法
1. 全データに新しい実験名を作成します。
2. 前回の最新の G と D ファイル(あるいはどの中間 ckpt を基にトレーニングしたい場合は、その中間のものをコピーすることもできます)を新しい実験名にコピーします。
3. 新しい実験名でワンクリックトレーニングを開始すると、前回の最新の進捗からトレーニングを続けます。
## Q16: llvmlite.dll に関するエラー
```bash
OSError: Could not load shared object file: llvmlite.dll
FileNotFoundError: Could not find module lib\site-packages\llvmlite\binding\llvmlite.dll (or one of its dependencies). Try using the full path with constructor syntax.
```
Windows プラットフォームではこのエラーが発生しますが、https://aka.ms/vs/17/release/vc_redist.x64.exeをインストールしてWebUIを再起動すれば解決します。
## Q17: RuntimeError: テンソルの拡張サイズ17280は、非シングルトン次元 1 での既存サイズ0と一致する必要があります。 ターゲットサイズ:[1, 17280]。 テンソルサイズ:[0]
wavs16k フォルダーの下で、他のファイルよりも明らかに小さいいくつかのオーディオファイルを見つけて削除し、トレーニングモデルをクリックすればエラーは発生しませんが、ワンクリックプロセスが中断されたため、モデルのトレーニングが完了したらインデックスのトレーニングをクリックする必要があります。
## Q18: RuntimeError: テンソル a のサイズ24は、非シングルトン次元 2 でテンソル b16のサイズと一致する必要があります
トレーニング中にサンプリングレートを変更してはいけません。変更する必要がある場合は、実験名を変更して最初からトレーニングする必要があります。もちろん、前回抽出した音高と特徴0/1/2/2b フォルダ)をコピーしてトレーニングプロセスを加速することもできます。

View File

@ -1,5 +1,22 @@
### 2023-08-13
### 2023년 10월 6일 업데이트
실시간 음성 변환을 위한 인터페이스인 go-realtime-gui.bat/gui_v1.py를 제작했습니다(사실 이는 이미 존재했었습니다). 이번 업데이트는 주로 실시간 음성 변환 성능을 최적화하는 데 중점을 두었습니다. 0813 버전과 비교하여:
- 1. 인터페이스 조작 최적화: 매개변수 핫 업데이트(매개변수 조정 시 중단 후 재시작 필요 없음), 모델 지연 로딩(이미 로드된 모델은 재로드 필요 없음), 음량 인자 매개변수 추가(음량을 입력 오디오에 가깝게 조정)
- 2. 내장된 노이즈 감소 효과 및 속도 최적화
- 3. 추론 속도 크게 향상
입력 및 출력 장치는 동일한 유형을 선택해야 합니다. 예를 들어, 모두 MME 유형을 선택해야 합니다.
1006 버전의 전체 업데이트는 다음과 같습니다:
- 1. rmvpe 음성 피치 추출 알고리즘의 효과를 계속해서 향상, 특히 남성 저음역에 대한 개선이 큼
- 2. 추론 인터페이스 레이아웃 최적화
### 2023년 08월 13일 업데이트
1-정기적인 버그 수정
- 최소 총 에포크 수를 1로 변경하고, 최소 총 에포크 수를 2로 변경합니다.
- 사전 훈련(pre-train) 모델을 사용하지 않는 훈련 오류 수정
- 반주 보컬 분리 후 그래픽 메모리 지우기
@ -9,9 +26,10 @@
- 실시간 음성 변경 중 faiss 검색으로 인한 CPU 소모 문제 해결
2-키 업데이트
- 현재 가장 강력한 오픈 소스 보컬 피치 추출 모델 RMVPE를 훈련하고, 이를 RVC 훈련, 오프라인/실시간 추론에 사용하며, PyTorch/Onx/DirectML을 지원합니다.
- 파이토치_DML을 통한 AMD 및 인텔 그래픽 카드 지원
(1) 실시간 음성 변화 (2) 추론 (3) 보컬 반주 분리 (4) 현재 지원되지 않는 훈련은 CPU 훈련으로 전환, Onnx_Dml을 통한 gpu의 RMVPE 추론 지원
- 파이토치\_DML을 통한 AMD 및 인텔 그래픽 카드 지원
(1) 실시간 음성 변화 (2) 추론 (3) 보컬 반주 분리 (4) 현재 지원되지 않는 훈련은 CPU 훈련으로 전환, Onnx_Dml을 통한 gpu의 RMVPE 추론 지원
### 2023년 6월 18일 업데이트

View File

@ -19,7 +19,7 @@ VITS基盤의 簡單하고使用하기 쉬운音聲變換틀<br><br>
------
[**更新日誌**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_KO.md)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Türkçe**](../tr/README.tr.md)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Français**](../fr/README.fr.md) | [**Türkçe**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
> [示範映像](https://www.bilibili.com/video/BV1pm4y1z7Gm/)을 確認해 보세요!

View File

@ -3,104 +3,243 @@
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
VITS 기반의 간단하고 사용하기 쉬운 음성 변환 프레임워크.<br><br>
[![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange
)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
[![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
[![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)
[![Licence](https://img.shields.io/github/license/RVC-Project/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/LICENSE)
[![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)
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
[**업데이트 로그**](./Changelog_KO.md) | [**자주 묻는 질문**](./faq_ko.md) | [**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/%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)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Français**](../fr/README.fr.md) | [**Türkçe**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
</div>
---
[**업데이트 로그**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_KO.md)
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Türkçe**](../tr/README.tr.md)
> [데모 영상](https://www.bilibili.com/video/BV1pm4y1z7Gm/)을 확인해 보세요!
> RVC를 활용한 실시간 음성변환: [w-okada/voice-changer](https://github.com/w-okada/voice-changer)
> 기본 모델은 50시간 가량의 고퀄리티 오픈 소스 VCTK 데이터셋을 사용하였으므로, 저작권상의 염려가 없으니 안심하고 사용하시기 바랍니다.
> 저작권 문제가 없는 고퀄리티의 노래를 이후에도 계속해서 훈련할 예정입니다.
> 더 큰 매개변수, 더 큰 데이터, 더 나은 효과, 기본적으로 동일한 추론 속도, 더 적은 양의 훈련 데이터가 필요한 RVCv3의 기본 모델을 기대해 주십시오.
<table>
<tr>
<td align="center">훈련 및 추론 인터페이스</td>
<td align="center">실시간 음성 변환 인터페이스</td>
</tr>
<tr>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/092e5c12-0d49-4168-a590-0b0ef6a4f630"></td>
<td align="center"><img src="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/assets/129054828/730b4114-8805-44a1-ab1a-04668f3c30a6"></td>
</tr>
<tr>
<td align="center">go-web.bat</td>
<td align="center">go-realtime-gui.bat</td>
</tr>
<tr>
<td align="center">원하는 작업을 자유롭게 선택할 수 있습니다.</td>
<td align="center">우리는 이미 끝에서 끝까지 170ms의 지연을 실현했습니다. ASIO 입력 및 출력 장치를 사용하면 끝에서 끝까지 90ms의 지연을 달성할 수 있지만, 이는 하드웨어 드라이버 지원에 매우 의존적입니다.</td>
</tr>
</table>
## 소개
본 Repo는 다음과 같은 특징을 가지고 있습니다:
- top1 검색을 이용하여 입력 음색 특징을 훈련 세트 음색 특징으로 대체하여 음색의 누출을 방지;
- 상대적으로 낮은 성능의 GPU에서도 빠른 훈련 가능;
- 적은 양의 데이터로 훈련해도 좋은 결과를 얻을 수 있음 (최소 10분 이상의 저잡음 음성 데이터를 사용하는 것을 권장);
- 모델 융합을 통한 음색의 변조 가능 (ckpt 처리 탭->ckpt 병합 선택);
- 사용하기 쉬운 WebUI (웹 인터페이스);
- top1 검색을 이용하여 입력 음색 특징을 훈련 세트 음색 특징으로 대체하여 음색의 누출을 방지
- 상대적으로 낮은 성능의 GPU에서도 빠른 훈련 가능
- 적은 양의 데이터로 훈련해도 좋은 결과를 얻을 수 있음 (최소 10분 이상의 저잡음 음성 데이터를 사용하는 것을 권장)
- 모델 융합을 통한 음색의 변조 가능 (ckpt 처리 탭->ckpt 병합 선택)
- 사용하기 쉬운 WebUI (웹 인터페이스)
- UVR5 모델을 이용하여 목소리와 배경음악의 빠른 분리;
- 최첨단 [음성 피치 추출 알고리즘 InterSpeech2023-RMVPE](#参考项目)을 사용하여 무성음 문제를 해결합니다. 효과는 최고(압도적)이며 crepe_full보다 더 빠르고 리소스 사용이 적음
- A카드와 I카드 가속을 지원
## 환경의 준비
해당 프로젝트의 [데모 비디오](https://www.bilibili.com/video/BV1pm4y1z7Gm/)를 확인해보세요!
poetry를 통해 dependecies를 설치하는 것을 권장합니다.
## 환경 설정
다음 명령은 Python 버전 3.8 이상의 환경에서 실행되어야 합니다:
다음 명령은 Python 버전이 3.8 이상인 환경에서 실행해야 합니다.
### Windows/Linux/MacOS 등 플랫폼 공통 방법
아래 방법 중 하나를 선택하세요.
#### 1. pip를 통한 의존성 설치
1. Pytorch 및 의존성 모듈 설치, 이미 설치되어 있으면 생략. 참조: https://pytorch.org/get-started/locally/
```bash
# PyTorch 관련 주요 dependencies 설치, 이미 설치되어 있는 경우 건너뛰기 가능
# 참조: https://pytorch.org/get-started/locally/
pip install torch torchvision torchaudio
# Windows + Nvidia Ampere Architecture(RTX30xx)를 사용하고 있다면, https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/21 에서 명시된 것과 같이 PyTorch에 맞는 CUDA 버전을 지정해야 합니다.
#pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
# Poetry 설치, 이미 설치되어 있는 경우 건너뛰기 가능
# Reference: https://python-poetry.org/docs/#installation
curl -sSL https://install.python-poetry.org | python3 -
# Dependecies 설치
poetry install
```
pip를 활용하여 dependencies를 설치하여도 무방합니다.
2. win 시스템 + Nvidia Ampere 아키텍처(RTX30xx) 사용 시, #21의 사례에 따라 pytorch에 해당하는 cuda 버전을 지정
```bash
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
```
3. 자신의 그래픽 카드에 맞는 의존성 설치
- N카드
```bash
pip install -r requirements.txt
```
## 기타 사전 모델 준비
RVC 모델은 추론과 훈련을 위하여 다른 사전 모델이 필요합니다.
[Huggingface space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)를 통해서 다운로드 할 수 있습니다.
다음은 RVC에 필요한 사전 모델 및 기타 파일 목록입니다:
- A카드/I카드
```bash
./assets/hubert/hubert_base.pt
./assets/pretrained
./assets/uvr5_weights
V2 버전 모델을 테스트하려면 추가 다운로드가 필요합니다.
./assets/pretrained_v2
# Windows를 사용하는 경우 이 사전도 필요할 수 있습니다. FFmpeg가 설치되어 있으면 건너뛰어도 됩니다.
ffmpeg.exe
pip install -r requirements-dml.txt
```
그 후 이하의 명령을 사용하여 WebUI를 시작할 수 있습니다:
- A카드ROCM(Linux)
```bash
pip install -r requirements-amd.txt
```
- I카드IPEX(Linux)
```bash
pip install -r requirements-ipex.txt
```
#### 2. poetry를 통한 의존성 설치
Poetry 의존성 관리 도구 설치, 이미 설치된 경우 생략. 참조: https://python-poetry.org/docs/#installation
```bash
curl -sSL https://install.python-poetry.org | python3 -
```
poetry를 통한 의존성 설치
```bash
poetry install
```
### MacOS
`run.sh`를 통해 의존성 설치 가능
```bash
sh ./run.sh
```
## 기타 사전 훈련된 모델 준비
RVC는 추론과 훈련을 위해 다른 일부 사전 훈련된 모델이 필요합니다.
이러한 모델은 저희의 [Hugging Face space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)에서 다운로드할 수 있습니다.
### 1. assets 다운로드
다음은 RVC에 필요한 모든 사전 훈련된 모델과 기타 파일의 목록입니다. `tools` 폴더에서 이들을 다운로드하는 스크립트를 찾을 수 있습니다.
- ./assets/hubert/hubert_base.pt
- ./assets/pretrained
- ./assets/uvr5_weights
v2 버전 모델을 사용하려면 추가로 다음을 다운로드해야 합니다.
- ./assets/pretrained_v2
### 2. ffmpeg 설치
ffmpeg와 ffprobe가 이미 설치되어 있다면 건너뜁니다.
#### Ubuntu/Debian 사용자
```bash
sudo apt install ffmpeg
```
#### MacOS 사용자
```bash
brew install ffmpeg
```
#### Windows 사용자
다운로드 후 루트 디렉토리에 배치.
- [ffmpeg.exe 다운로드](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe)
- [ffprobe.exe 다운로드](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe)
### 3. RMVPE 인간 음성 피치 추출 알고리즘에 필요한 파일 다운로드
최신 RMVPE 인간 음성 피치 추출 알고리즘을 사용하려면 음피치 추출 모델 매개변수를 다운로드하고 RVC 루트 디렉토리에 배치해야 합니다.
- [rmvpe.pt 다운로드](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt)
#### dml 환경의 RMVPE 다운로드(선택사항, A카드/I카드 사용자)
- [rmvpe.onnx 다운로드](https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx)
### 4. AMD 그래픽 카드 Rocm(선택사항, Linux만 해당)
Linux 시스템에서 AMD의 Rocm 기술을 기반으로 RVC를 실행하려면 [여기](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html)에서 필요한 드라이버를 먼저 설치하세요.
Arch Linux를 사용하는 경우 pacman을 사용하여 필요한 드라이버를 설치할 수 있습니다.
```
pacman -S rocm-hip-sdk rocm-opencl-sdk
```
일부 모델의 그래픽 카드(예: RX6700XT)의 경우, 다음과 같은 환경 변수를 추가로 설정해야 할 수 있습니다.
```
export ROCM_PATH=/opt/rocm
export HSA_OVERRIDE_GFX_VERSION=10.3.0
```
동시에 현재 사용자가 `render``video` 사용자 그룹에 속해 있는지 확인하세요.
```
sudo usermod -aG render $USERNAME
sudo usermod -aG video $USERNAME
```
## 시작하기
### 직접 시작
다음 명령어로 WebUI를 시작하세요
```bash
python infer-web.py
```
Windows를 사용하는 경우 `RVC-beta.7z`를 다운로드 및 압축 해제하여 RVC를 직접 사용하거나 `go-web.bat`을 사용하여 WebUi를 시작할 수 있습니다.
### 통합 패키지 사용
## 참고
`RVC-beta.7z`를 다운로드하고 압축 해제
#### Windows 사용자
`go-web.bat` 더블 클릭
#### MacOS 사용자
```bash
sh ./run.sh
```
### IPEX 기술이 필요한 I카드 사용자를 위한 지침(Linux만 해당)
```bash
source /opt/intel/oneapi/setvars.sh
```
## 참조 프로젝트
- [ContentVec](https://github.com/auspicious3000/contentvec/)
- [VITS](https://github.com/jaywalnut310/vits)
@ -109,8 +248,10 @@ Windows를 사용하는 경우 `RVC-beta.7z`를 다운로드 및 압축 해제
- [FFmpeg](https://github.com/FFmpeg/FFmpeg)
- [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
- [audio-slicer](https://github.com/openvpi/audio-slicer)
- [Vocal pitch extraction:RMVPE](https://github.com/Dream-High/RMVPE)
- 사전 훈련된 모델은 [yxlllc](https://github.com/yxlllc/RMVPE)와 [RVC-Boss](https://github.com/RVC-Boss)에 의해 훈련되고 테스트되었습니다.
## 모든 기여자 분들의 노력에 감사드립니다.
## 모든 기여자들의 노력에 감사드립니다
<a href="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=RVC-Project/Retrieval-based-Voice-Conversion-WebUI" />

130
docs/kr/faq_ko.md Normal file
View File

@ -0,0 +1,130 @@
## Q1:ffmpeg 오류/utf8 오류
대부분의 경우 ffmpeg 문제가 아니라 오디오 경로 문제입니다. <br>
ffmpeg가 공백, () 등의 특수 문자가 포함된 경로를 읽을 때 ffmpeg 오류가 발생할 수 있습니다. 트레이닝 세트 오디오가 중문 경로일 때 filelist.txt에 쓸 때 utf8 오류가 발생할 수 있습니다. <br>
## Q2:일괄 트레이닝이 끝나고 인덱스가 없음
"Training is done. The program is closed."라고 표시되면 모델 트레이닝이 성공한 것이며, 이어지는 오류는 가짜입니다. <br>
일괄 트레이닝이 끝나고 'added'로 시작하는 인덱스 파일이 없으면 트레이닝 세트가 너무 커서 인덱스 추가 단계에서 멈췄을 수 있습니다. 메모리에 대한 인덱스 추가 요구 사항이 너무 큰 문제를 배치 처리 add 인덱스로 해결했습니다. 임시로 "트레이닝 인덱스" 버튼을 다시 클릭해 보세요. <br>
## Q3:트레이닝이 끝나고 트레이닝 세트의 음색을 추론에서 보지 못함
'음색 새로고침'을 클릭해 보세요. 여전히 없다면 트레이닝에 오류가 있는지, 콘솔 및 webui의 스크린샷, logs/실험명 아래의 로그를 개발자에게 보내 확인해 보세요. <br>
## Q4:모델 공유 방법
rvc_root/logs/실험명 아래에 저장된 pth는 추론에 사용하기 위한 것이 아니라 실험 상태를 저장하고 복원하며, 트레이닝을 계속하기 위한 것입니다. 공유에 사용되는 모델은 weights 폴더 아래 60MB 이상인 pth 파일입니다. <br>
<br/>
향후에는 weights/exp_name.pth와 logs/exp_name/added_xxx.index를 결합하여 weights/exp_name.zip으로 만들어 index 입력 단계를 생략할 예정입니다. 그러면 zip 파일을 공유하고 pth 파일은 공유하지 마세요. 단지 다른 기계에서 트레이닝을 계속하려는 경우에만 공유하세요. <br>
<br/>
logs 폴더 아래 수백 MB의 pth 파일을 weights 폴더에 복사/공유하여 강제로 추론에 사용하면 f0, tgt_sr 등의 키가 없다는 오류가 발생할 수 있습니다. ckpt 탭 아래에서 수동 또는 자동(로컬 logs에서 관련 정보를 찾을 수 있는 경우 자동)으로 음성, 대상 오디오 샘플링률 옵션을 선택한 후 ckpt 소형 모델을 추출해야 합니다(입력 경로에 G로 시작하는 경로를 입력). 추출 후 weights 폴더에 60MB 이상의 pth 파일이 생성되며, 음색 새로고침 후 사용할 수 있습니다. <br>
## Q5:연결 오류
아마도 컨트롤 콘솔(검은 창)을 닫았을 것입니다. <br>
## Q6:WebUI에서 "Expecting value: line 1 column 1 (char 0)" 오류가 발생함
시스템 로컬 네트워크 프록시/글로벌 프록시를 닫으세요. <br>
이는 클라이언트의 프록시뿐만 아니라 서버 측의 프록시도 포함합니다(예: autodl로 http_proxy 및 https_proxy를 설정한 경우 사용 시 unset으로 끄세요). <br>
## Q7:WebUI 없이 명령으로 트레이닝 및 추론하는 방법
트레이닝 스크립트: <br>
먼저 WebUI를 실행하여 데이터 세트 처리 및 트레이닝에 사용되는 명령줄을 메시지 창에서 확인할 수 있습니다. <br>
추론 스크립트: <br>
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py <br>
예제: <br>
runtime\python.exe myinfer.py 0 "E:\codes\py39\RVC-beta\todo-songs\1111.wav" "E:\codes\py39\logs\mi-test\added_IVF677_Flat_nprobe_7.index" harvest "test.wav" "weights/mi-test.pth" 0.6 cuda:0 True <br>
f0up_key=sys.argv[1] <br>
input_path=sys.argv[2] <br>
index_path=sys.argv[3] <br>
f0method=sys.argv[4]#harvest 또는 pm <br>
opt_path=sys.argv[5] <br>
model_path=sys.argv[6] <br>
index_rate=float(sys.argv[7]) <br>
device=sys.argv[8] <br>
is_half=bool(sys.argv[9]) <br>
## Q8:Cuda 오류/Cuda 메모리 부족
아마도 cuda 설정 문제이거나 장치가 지원되지 않을 수 있습니다. 대부분의 경우 메모리가 부족합니다(out of memory). <br>
트레이닝의 경우 batch size를 줄이세요(1로 줄여도 부족하다면 다른 그래픽 카드로 트레이닝을 해야 합니다). 추론의 경우 config.py 파일 끝에 있는 x_pad, x_query, x_center, x_max를 적절히 줄이세요. 4GB 미만의 메모리(예: 1060(3GB) 및 여러 2GB 그래픽 카드)를 가진 경우는 포기하세요. 4GB 메모리 그래픽 카드는 아직 구할 수 있습니다. <br>
## Q9:total_epoch를 몇으로 설정하는 것이 좋을까요
트레이닝 세트의 오디오 품질이 낮고 배경 소음이 많으면 20~30이면 충분합니다. 너무 높게 설정하면 바닥 모델의 오디오 품질이 낮은 트레이닝 세트를 높일 수 없습니다. <br>
트레이닝 세트의 오디오 품질이 높고 배경 소음이 적고 길이가 길 경우 높게 설정할 수 있습니다. 200도 괜찮습니다(트레이닝 속도가 빠르므로, 고품질 트레이닝 세트를 준비할 수 있는 조건이 있다면, 그래픽 카드도 좋을 것이므로, 조금 더 긴 트레이닝 시간에 대해 걱정하지 않을 것입니다). <br>
## Q10: 트레이닝 세트는 얼마나 길어야 하나요
10분에서 50분을 추천합니다.
<br/>
음질이 좋고 백그라운드 노이즈가 낮은 상태에서, 개인적인 특색 있는 음색이라면 더 많으면 더 좋습니다.
<br/>
고품질의 트레이닝 세트(정교하게 준비된 + 특색 있는 음색)라면, 5분에서 10분도 괜찮습니다. 저장소의 저자도 종종 이렇게 합니다.
<br/>
1분에서 2분의 데이터로 트레이닝에 성공한 사람도 있지만, 그러한 성공 사례는 다른 사람이 재현하기 어려우며 참고 가치가 크지 않습니다. 이는 트레이닝 세트의 음색이 매우 뚜렷해야 하며(예: 높은 주파수의 명확한 목소리나 소녀음) 음질이 좋아야 합니다.
<br/>
1분 미만의 데이터로 트레이닝을 시도(성공)한 사례는 아직 보지 못했습니다. 이런 시도는 권장하지 않습니다.
## Q11: index rate는 무엇이며, 어떻게 조정하나요? (과학적 설명)
만약 베이스 모델과 추론 소스의 음질이 트레이닝 세트보다 높다면, 그들은 추론 결과의 음질을 높일 수 있지만, 음색이 베이스 모델/추론 소스의 음색으로 기울어질 수 있습니다. 이 현상을 "음색 유출"이라고 합니다.
<br/>
index rate는 음색 유출 문제를 줄이거나 해결하는 데 사용됩니다. 1로 조정하면 이론적으로 추론 소스의 음색 유출 문제가 없지만, 음질은 트레이닝 세트에 더 가깝게 됩니다. 만약 트레이닝 세트의 음질이 추론 소스보다 낮다면, index rate를 높이면 음질이 낮아질 수 있습니다. 0으로 조정하면 검색 혼합을 이용하여 트레이닝 세트의 음색을 보호하는 효과가 없습니다.
<br/>
트레이닝 세트가 고품질이고 길이가 길 경우, total_epoch를 높일 수 있으며, 이 경우 모델 자체가 추론 소스와 베이스 모델의 음색을 거의 참조하지 않아 "음색 유출" 문제가 거의 발생하지 않습니다. 이때 index rate는 중요하지 않으며, 심지어 index 색인 파일을 생성하거나 공유하지 않아도 됩니다.
## Q11: 추론시 GPU를 어떻게 선택하나요?
config.py 파일에서 device cuda: 다음에 카드 번호를 선택합니다.
카드 번호와 그래픽 카드의 매핑 관계는 트레이닝 탭의 그래픽 카드 정보란에서 볼 수 있습니다.
## Q12: 트레이닝 중간에 저장된 pth를 어떻게 추론하나요?
ckpt 탭 하단에서 소형 모델을 추출합니다.
## Q13: 트레이닝을 어떻게 중단하고 계속할 수 있나요?
현재 단계에서는 WebUI 콘솔을 닫고 go-web.bat을 더블 클릭하여 프로그램을 다시 시작해야 합니다. 웹 페이지 매개변수도 새로 고쳐서 다시 입력해야 합니다.
트레이닝을 계속하려면: 같은 웹 페이지 매개변수로 트레이닝 모델을 클릭하면 이전 체크포인트에서 트레이닝을 계속합니다.
## Q14: 트레이닝 중 파일 페이지/메모리 오류가 발생하면 어떻게 해야 하나요?
프로세스가 너무 많이 열려 메모리가 폭발했습니다. 다음과 같은 방법으로 해결할 수 있습니다.
1. "음높이 추출 및 데이터 처리에 사용되는 CPU 프로세스 수"를 적당히 낮춥니다.
2. 트레이닝 세트 오디오를 수동으로 잘라 너무 길지 않게 합니다.
## Q15: 트레이닝 도중 데이터를 어떻게 추가하나요?
1. 모든 데이터에 새로운 실험 이름을 만듭니다.
2. 이전에 가장 최신의 G와 D 파일(또는 어떤 중간 ckpt를 기반으로 트레이닝하고 싶다면 중간 것을 복사할 수도 있음)을 새 실험 이름으로 복사합니다.
3. 새 실험 이름으로 원클릭 트레이닝을 시작하면 이전의 최신 진행 상황에서 계속 트레이닝합니다.
## Q16: llvmlite.dll에 관한 오류
```bash
OSError: Could not load shared object file: llvmlite.dll
FileNotFoundError: Could not find module lib\site-packages\llvmlite\binding\llvmlite.dll (or one of its dependencies). Try using the full path with constructor syntax.
```
Windows 플랫폼에서 이 오류가 발생하면 https://aka.ms/vs/17/release/vc_redist.x64.exe를 설치하고 WebUI를 다시 시작하면 해결됩니다.
## Q17: RuntimeError: 텐서의 확장된 크기(17280)는 비 단일 항목 차원 1에서 기존 크기(0)와 일치해야 합니다. 대상 크기: [1, 17280]. 텐서 크기: [0]
wavs16k 폴더 아래에서 다른 파일들보다 크기가 현저히 작은 일부 오디오 파일을 찾아 삭제하고, 트레이닝 모델을 클릭하면 오류가 발생하지 않습니다. 하지만 원클릭 프로세스가 중단되었기 때문에 모델 트레이닝이 완료된 후에는 인덱스 트레이닝을 클릭해야 합니다.
## Q18: RuntimeError: 텐서 a의 크기(24)가 비 단일 항목 차원 2에서 텐서 b(16)의 크기와 일치해야 합니다.
트레이닝 도중에 샘플링 레이트를 변경해서는 안 됩니다. 변경해야 한다면 실험 이름을 변경하고 처음부터 트레이닝해야 합니다. 물론, 이전에 추출한 음높이와 특징(0/1/2/2b 폴더)을 복사하여 트레이닝 프로세스를 가속화할 수도 있습니다.

105
docs/pt/Changelog_pt.md Normal file
View File

@ -0,0 +1,105 @@
### 2023-10-06
- Criamos uma GUI para alteração de voz em tempo real: go-realtime-gui.bat/gui_v1.py (observe que você deve escolher o mesmo tipo de dispositivo de entrada e saída, por exemplo, MME e MME).
- Treinamos um modelo RMVPE de extração de pitch melhor.
- Otimizar o layout da GUI de inferência.
### 2023-08-13
1-Correção de bug regular
- Alterar o número total mínimo de épocas para 1 e alterar o número total mínimo de epoch para 2
- Correção de erros de treinamento por não usar modelos de pré-treinamento
- Após a separação dos vocais de acompanhamento, limpe a memória dos gráficos
- Alterar o caminho absoluto do faiss save para o caminho relativo
- Suporte a caminhos com espaços (tanto o caminho do conjunto de treinamento quanto o nome do experimento são suportados, e os erros não serão mais relatados)
- A lista de arquivos cancela a codificação utf8 obrigatória
- Resolver o problema de consumo de CPU causado pela busca do faiss durante alterações de voz em tempo real
Atualizações do 2-Key
- Treine o modelo de extração de pitch vocal de código aberto mais forte do momento, o RMVPE, e use-o para treinamento de RVC, inferência off-line/em tempo real, com suporte a PyTorch/Onnx/DirectML
- Suporte para placas gráficas AMD e Intel por meio do Pytorch_DML
(1) Mudança de voz em tempo real (2) Inferência (3) Separação do acompanhamento vocal (4) Não há suporte para treinamento no momento, mudaremos para treinamento de CPU; há suporte para inferência RMVPE de gpu por Onnx_Dml
### 2023-06-18
- Novos modelos v2 pré-treinados: 32k e 48k
- Correção de erros de inferência de modelo não-f0
- Para conjuntos de treinamento que excedam 1 hora, faça minibatch-kmeans automáticos para reduzir a forma dos recursos, de modo que o treinamento, a adição e a pesquisa do Index sejam muito mais rápidos.
- Fornecer um espaço de brinquedo vocal2guitar huggingface
- Exclusão automática de áudios de conjunto de treinamento de atalhos discrepantes
- Guia de exportação Onnx
Experimentos com falha:
- ~~Recuperação de recurso: adicionar recuperação de recurso temporal: não eficaz~~
- ~~Recuperação de recursos: adicionar redução de dimensionalidade PCAR: a busca é ainda mais lenta~~
- ~~Aumento de dados aleatórios durante o treinamento: não é eficaz~~
Lista de tarefas
- ~~Vocos-RVC (vocoder minúsculo): não é eficaz~~
- ~~Suporte de crepe para treinamento: substituído pelo RMVPE~~
- ~~Inferência de crepe de meia precisãosubstituída pelo RMVPE. E difícil de conseguir.~~
- Suporte ao editor de F0
### 2023-05-28
- Adicionar notebook jupyter v2, changelog em coreano, corrigir alguns requisitos de ambiente
- Adicionar consoante sem voz e modo de proteção de respiração
- Suporte à detecção de pitch crepe-full
- Separação vocal UVR5: suporte a modelos dereverb e modelos de-echo
- Adicionar nome e versão do experimento no nome do Index
- Suporte aos usuários para selecionar manualmente o formato de exportação dos áudios de saída durante o processamento de conversão de voz em lote e a separação vocal UVR5
- Não há mais suporte para o treinamento do modelo v1 32k
### 2023-05-13
- Limpar os códigos redundantes na versão antiga do tempo de execução no pacote de um clique: lib.infer_pack e uvr5_pack
- Correção do bug de pseudo multiprocessamento no pré-processamento do conjunto de treinamento
- Adição do ajuste do raio de filtragem mediana para o algoritmo de reconhecimento de inclinação da extração
- Suporte à reamostragem de pós-processamento para exportação de áudio
- A configuração "n_cpu" de multiprocessamento para treinamento foi alterada de "extração de f0" para "pré-processamento de dados e extração de f0"
- Detectar automaticamente os caminhos de Index na pasta de registros e fornecer uma função de lista suspensa
- Adicionar "Perguntas e respostas frequentes" na página da guia (você também pode consultar o wiki do RVC no github)
- Durante a inferência, o pitch da colheita é armazenado em cache quando se usa o mesmo caminho de áudio de entrada (finalidade: usando a extração do pitch da colheita, todo o pipeline passará por um processo longo e repetitivo de extração do pitch. Se o armazenamento em cache não for usado, os usuários que experimentarem diferentes configurações de raio de filtragem de timbre, Index e mediana de pitch terão um processo de espera muito doloroso após a primeira inferência)
### 2023-05-14
- Use o envelope de volume da entrada para misturar ou substituir o envelope de volume da saída (pode aliviar o problema de "muting de entrada e ruído de pequena amplitude de saída"). Se o ruído de fundo do áudio de entrada for alto, não é recomendável ativá-lo, e ele não é ativado por padrão (1 pode ser considerado como não ativado)
- Suporte ao salvamento de modelos pequenos extraídos em uma frequência especificada (se você quiser ver o desempenho em épocas diferentes, mas não quiser salvar todos os pontos de verificação grandes e extrair manualmente modelos pequenos pelo processamento ckpt todas as vezes, esse recurso será muito prático)
- Resolver o problema de "erros de conexão" causados pelo proxy global do servidor, definindo variáveis de ambiente
- Oferece suporte a modelos v2 pré-treinados (atualmente, apenas as versões 40k estão disponíveis publicamente para teste e as outras duas taxas de amostragem ainda não foram totalmente treinadas)
- Limita o volume excessivo que excede 1 antes da inferência
- Ajustou ligeiramente as configurações do pré-processamento do conjunto de treinamento
#######################
Histórico de registros de alterações:
### 2023-04-09
- Parâmetros de treinamento corrigidos para melhorar a taxa de utilização da GPU: A100 aumentou de 25% para cerca de 90%, V100: 50% para cerca de 90%, 2060S: 60% para cerca de 85%, P40: 25% para cerca de 95%; melhorou significativamente a velocidade de treinamento
- Parâmetro alterado: total batch_size agora é por GPU batch_size
- Total_epoch alterado: limite máximo aumentado de 100 para 1000; padrão aumentado de 10 para 20
- Corrigido o problema da extração de ckpt que reconhecia o pitch incorretamente, causando inferência anormal
- Corrigido o problema do treinamento distribuído que salvava o ckpt para cada classificação
- Aplicada a filtragem de recursos nan para extração de recursos
- Corrigido o problema com a entrada/saída silenciosa que produzia consoantes aleatórias ou ruído (os modelos antigos precisavam ser treinados novamente com um novo conjunto de dados)
### Atualização 2023-04-16
- Adicionada uma mini-GUI de alteração de voz local em tempo real, iniciada com um clique duplo em go-realtime-gui.bat
- Filtragem aplicada para bandas de frequência abaixo de 50 Hz durante o treinamento e a inferência
- Diminuição da extração mínima de tom do pyworld do padrão 80 para 50 para treinamento e inferência, permitindo que vozes masculinas de tom baixo entre 50-80 Hz não sejam silenciadas
- A WebUI suporta a alteração de idiomas de acordo com a localidade do sistema (atualmente suporta en_US, ja_JP, zh_CN, zh_HK, zh_SG, zh_TW; o padrão é en_US se não for suportado)
- Correção do reconhecimento de algumas GPUs (por exemplo, falha no reconhecimento da V100-16G, falha no reconhecimento da P4)
### Atualização de 2023-04-28
- Atualizadas as configurações do Index faiss para maior velocidade e qualidade
- Removida a dependência do total_npy; o futuro compartilhamento de modelos não exigirá a entrada do total_npy
- Restrições desbloqueadas para as GPUs da série 16, fornecendo configurações de inferência de 4 GB para GPUs com VRAM de 4 GB
- Corrigido o erro na separação do acompanhamento vocal do UVR5 para determinados formatos de áudio
- A mini-GUI de alteração de voz em tempo real agora suporta modelos de pitch não 40k e que não são lentos
### Planos futuros:
Recursos:
- Opção de adição: extrair modelos pequenos para cada epoch salvo
- Adicionar opção: exportar mp3 adicional para o caminho especificado durante a inferência
- Suporte à guia de treinamento para várias pessoas (até 4 pessoas)
Modelo básico:
- Coletar arquivos wav de respiração para adicionar ao conjunto de dados de treinamento para corrigir o problema de sons de respiração distorcidos
- No momento, estamos treinando um modelo básico com um conjunto de dados de canto estendido, que será lançado no futuro

193
docs/pt/README.pt.md Normal file
View File

@ -0,0 +1,193 @@
<div align="center">
<h1>Retrieval-based-Voice-Conversion-WebUI</h1>
Uma estrutura de conversão de voz fácil de usar baseada em VITS.<br><br>
[![madewithlove](https://img.shields.io/badge/made_with-%E2%9D%A4-red?style=for-the-badge&labelColor=orange
)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI)
<img src="https://counter.seku.su/cmoe?name=rvc&theme=r34" /><br>
[![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)
[![Licence](https://img.shields.io/github/license/RVC-Project/Retrieval-based-Voice-Conversion-WebUI?style=for-the-badge)](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/LICENSE)
[![Huggingface](https://img.shields.io/badge/🤗%20-Spaces-yellow.svg?style=for-the-badge)](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/)
[![Discord](https://img.shields.io/badge/RVC%20Developers-Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/HcsmBBGyVk)
</div>
------
[**Changelog**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_EN.md) | [**FAQ (Frequently Asked Questions)**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/FAQ-(Frequently-Asked-Questions))
[**English**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Türkçe**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
Confira nosso [Vídeo de demonstração](https://www.bilibili.com/video/BV1pm4y1z7Gm/) aqui!
Treinamento/Inferência WebUIgo-web.bat
![Traduzido](https://github.com/RafaelGodoyEbert/Retrieval-based-Voice-Conversion-WebUI/assets/78083427/0b894d87-565a-432c-8b5b-45e4a65d5d17)
GUI de conversão de voz em tempo realgo-realtime-gui.bat
![image](https://github.com/RafaelGodoyEbert/Retrieval-based-Voice-Conversion-WebUI/assets/78083427/d172e3e5-35f4-4876-9530-c28246919e9e)
> O dataset para o modelo de pré-treinamento usa quase 50 horas de conjunto de dados de código aberto VCTK de alta qualidade.
> Dataset de músicas licenciadas de alta qualidade serão adicionados ao conjunto de treinamento, um após o outro, para seu uso, sem se preocupar com violação de direitos autorais.
> Aguarde o modelo básico pré-treinado do RVCv3, que possui parâmetros maiores, mais dados de treinamento, melhores resultados, velocidade de inferência inalterada e requer menos dados de treinamento para treinamento.
## Resumo
Este repositório possui os seguintes recursos:
+ Reduza o vazamento de tom substituindo o recurso de origem pelo recurso de conjunto de treinamento usando a recuperação top1;
+ Treinamento fácil e rápido, mesmo em placas gráficas relativamente ruins;
+ Treinar com uma pequena quantidade de dados também obtém resultados relativamente bons (>=10min de áudio com baixo ruído recomendado);
+ Suporta fusão de modelos para alterar timbres (usando guia de processamento ckpt-> mesclagem ckpt);
+ Interface Webui fácil de usar;
+ Use o modelo UVR5 para separar rapidamente vocais e instrumentos.
+ Use o mais poderoso algoritmo de extração de voz de alta frequência [InterSpeech2023-RMVPE](#Credits) para evitar o problema de som mudo. Fornece os melhores resultados (significativamente) e é mais rápido, com consumo de recursos ainda menor que o Crepe_full.
+ Suporta aceleração de placas gráficas AMD/Intel.
+ Aceleração de placas gráficas Intel ARC com suporte para IPEX.
## Preparando o ambiente
Os comandos a seguir precisam ser executados no ambiente Python versão 3.8 ou superior.
(Windows/Linux)
Primeiro instale as dependências principais através do pip:
```bash
# Instale as dependências principais relacionadas ao PyTorch, pule se instaladas
# Referência: https://pytorch.org/get-started/locally/
pip install torch torchvision torchaudio
#Para arquitetura Windows + Nvidia Ampere (RTX30xx), você precisa especificar a versão cuda correspondente ao pytorch de acordo com a experiência de https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/ 21
#pip instalar tocha torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
#Para placas Linux + AMD, você precisa usar as seguintes versões do pytorch:
#pip instalar tocha torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2
```
Então pode usar poesia para instalar as outras dependências:
```bash
# Instale a ferramenta de gerenciamento de dependências Poetry, pule se instalada
# Referência: https://python-poetry.org/docs/#installation
curl -sSL https://install.python-poetry.org | python3 -
#Instale as dependências do projeto
poetry install
```
Você também pode usar pip para instalá-los:
```bash
for Nvidia graphics cards
pip install -r requirements.txt
for AMD/Intel graphics cards on Windows (DirectML)
pip install -r requirements-dml.txt
for Intel ARC graphics cards on Linux / WSL using Python 3.10:
pip install -r requirements-ipex.txt
for AMD graphics cards on Linux (ROCm):
pip install -r requirements-amd.txt
```
------
Usuários de Mac podem instalar dependências via `run.sh`:
```bash
sh ./run.sh
```
## Preparação de outros Pré-modelos
RVC requer outros pré-modelos para inferir e treinar.
```bash
#Baixe todos os modelos necessários em https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/
python tools/download_models.py
```
Ou apenas baixe-os você mesmo em nosso [Huggingface space](https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/).
Aqui está uma lista de pré-modelos e outros arquivos que o RVC precisa:
```bash
./assets/hubert/hubert_base.pt
./assets/pretrained
./assets/uvr5_weights
Downloads adicionais são necessários se você quiser testar a versão v2 do modelo.
./assets/pretrained_v2
Se você deseja testar o modelo da versão v2 (o modelo da versão v2 alterou a entrada do recurso dimensional 256 do Hubert + final_proj de 9 camadas para o recurso dimensional 768 do Hubert de 12 camadas e adicionou 3 discriminadores de período), você precisará baixar recursos adicionais
./assets/pretrained_v2
#Se você estiver usando Windows, também pode precisar desses dois arquivos, pule se FFmpeg e FFprobe estiverem instalados
ffmpeg.exe
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffmpeg.exe
ffprobe.exe
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/ffprobe.exe
Se quiser usar o algoritmo de extração de tom vocal SOTA RMVPE mais recente, você precisa baixar os pesos RMVPE e colocá-los no diretório raiz RVC
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.pt
Para usuários de placas gráficas AMD/Intel, você precisa baixar:
https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/rmvpe.onnx
```
Os usuários de placas gráficas Intel ARC precisam executar o comando `source /opt/intel/oneapi/setvars.sh` antes de iniciar o Webui.
Em seguida, use este comando para iniciar o Webui:
```bash
python infer-web.py
```
Se estiver usando Windows ou macOS, você pode baixar e extrair `RVC-beta.7z` para usar RVC diretamente usando `go-web.bat` no Windows ou `sh ./run.sh` no macOS para iniciar o Webui.
## Suporte ROCm para placas gráficas AMD (somente Linux)
Para usar o ROCm no Linux, instale todos os drivers necessários conforme descrito [aqui](https://rocm.docs.amd.com/en/latest/deploy/linux/os-native/install.html).
No Arch use pacman para instalar o driver:
````
pacman -S rocm-hip-sdk rocm-opencl-sdk
````
Talvez você também precise definir estas variáveis de ambiente (por exemplo, em um RX6700XT):
````
export ROCM_PATH=/opt/rocm
export HSA_OVERRIDE_GFX_VERSION=10.3.0
````
Verifique também se seu usuário faz parte do grupo `render` e `video`:
````
sudo usermod -aG render $USERNAME
sudo usermod -aG video $USERNAME
````
Depois disso, você pode executar o WebUI:
```bash
python infer-web.py
```
## Credits
+ [ContentVec](https://github.com/auspicious3000/contentvec/)
+ [VITS](https://github.com/jaywalnut310/vits)
+ [HIFIGAN](https://github.com/jik876/hifi-gan)
+ [Gradio](https://github.com/gradio-app/gradio)
+ [FFmpeg](https://github.com/FFmpeg/FFmpeg)
+ [Ultimate Vocal Remover](https://github.com/Anjok07/ultimatevocalremovergui)
+ [audio-slicer](https://github.com/openvpi/audio-slicer)
+ [Vocal pitch extraction:RMVPE](https://github.com/Dream-High/RMVPE)
+ The pretrained model is trained and tested by [yxlllc](https://github.com/yxlllc/RMVPE) and [RVC-Boss](https://github.com/RVC-Boss).
## Thanks to all contributors for their efforts
<a href="https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=RVC-Project/Retrieval-based-Voice-Conversion-WebUI" />
</a>

102
docs/pt/faiss_tips_pt.md Normal file
View File

@ -0,0 +1,102 @@
pONTAS de afinação FAISS
==================
# sobre faiss
faiss é uma biblioteca de pesquisas de vetores densos na área, desenvolvida pela pesquisa do facebook, que implementa com eficiência muitos métodos de pesquisa de área aproximada.
A Pesquisa Aproximada de área encontra vetores semelhantes rapidamente, sacrificando alguma precisão.
## faiss em RVC
No RVC, para a incorporação de recursos convertidos pelo HuBERT, buscamos incorporações semelhantes à incorporação gerada a partir dos dados de treinamento e as misturamos para obter uma conversão mais próxima do discurso original. No entanto, como essa pesquisa leva tempo se realizada de forma ingênua, a conversão de alta velocidade é realizada usando a pesquisa aproximada de área.
# visão geral da implementação
Em '/logs/nome-do-seu-modelo/3_feature256', onde o modelo está localizado, os recursos extraídos pelo HuBERT de cada dado de voz estão localizados.
A partir daqui, lemos os arquivos npy ordenados por nome de arquivo e concatenamos os vetores para criar big_npy. (Este vetor tem a forma [N, 256].)
Depois de salvar big_npy as /logs/nome-do-seu-modelo/total_fea.npy, treine-o com faiss.
Neste artigo, explicarei o significado desses parâmetros.
# Explicação do método
## Fábrica de Index
Uma fábrica de Index é uma notação faiss exclusiva que expressa um pipeline que conecta vários métodos de pesquisa de área aproximados como uma string.
Isso permite que você experimente vários métodos aproximados de pesquisa de área simplesmente alterando a cadeia de caracteres de fábrica do Index.
No RVC é usado assim:
```python
index = faiss.index_factory(256, "IVF%s,Flat" % n_ivf)
```
Entre os argumentos de index_factory, o primeiro é o número de dimensões do vetor, o segundo é a string de fábrica do Index e o terceiro é a distância a ser usada.
Para uma notação mais detalhada
https://github.com/facebookresearch/faiss/wiki/The-index-factory
## Construção de Index
Existem dois Indexs típicos usados como similaridade de incorporação da seguinte forma.
- Distância euclidiana (MÉTRICA_L2)
- Produto interno (METRIC_INNER_PRODUCT)
A distância euclidiana toma a diferença quadrática em cada dimensão, soma as diferenças em todas as dimensões e, em seguida, toma a raiz quadrada. Isso é o mesmo que a distância em 2D e 3D que usamos diariamente.
O produto interno não é usado como um Index de similaridade como é, e a similaridade de cosseno que leva o produto interno depois de ser normalizado pela norma L2 é geralmente usada.
O que é melhor depende do caso, mas a similaridade de cosseno é frequentemente usada na incorporação obtida pelo word2vec e modelos de recuperação de imagem semelhantes aprendidos pelo ArcFace. Se você quiser fazer a normalização l2 no vetor X com numpy, você pode fazê-lo com o seguinte código com eps pequeno o suficiente para evitar a divisão 0.
```python
X_normed = X / np.maximum(eps, np.linalg.norm(X, ord=2, axis=-1, keepdims=True))
```
Além disso, para a Construção de Index, você pode alterar o Index de distância usado para cálculo escolhendo o valor a ser passado como o terceiro argumento.
```python
index = faiss.index_factory(dimention, text, faiss.METRIC_INNER_PRODUCT)
```
## FI
IVF (Inverted file indexes) é um algoritmo semelhante ao Index invertido na pesquisa de texto completo.
Durante o aprendizado, o destino da pesquisa é agrupado com kmeans e o particionamento Voronoi é realizado usando o centro de cluster. A cada ponto de dados é atribuído um cluster, por isso criamos um dicionário que procura os pontos de dados dos clusters.
Por exemplo, se os clusters forem atribuídos da seguinte forma
|index|Cluster|
|-----|-------|
|1|A|
|2|B|
|3|A|
|4|C|
|5|B|
O Index invertido resultante se parece com isso:
| cluster | Index |
|-------|-----|
| A | 1, 3 |
| B | 2 5 |
| C | 4 |
Ao pesquisar, primeiro pesquisamos n_probe clusters dos clusters e, em seguida, calculamos as distâncias para os pontos de dados pertencentes a cada cluster.
# Parâmetro de recomendação
Existem diretrizes oficiais sobre como escolher um Index, então vou explicar de
acordo. https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index
Para conjuntos de dados abaixo de 1M, o 4bit-PQ é o método mais eficiente disponível no faiss em abril de 2023.
Combinando isso com a fertilização in vitro, estreitando os candidatos com 4bit-PQ e, finalmente, recalcular a distância com um Index preciso pode ser descrito usando a seguinte fábrica de Indexs.
```python
index = faiss.index_factory(256, "IVF1024,PQ128x4fs,RFlat")
```
## Parâmetros recomendados para FIV
Considere o caso de muitas FIVs. Por exemplo, se a quantização grosseira por FIV for realizada para o número de dados, isso é o mesmo que uma pesquisa exaustiva ingênua e é ineficiente.
Para 1M ou menos, os valores de FIV são recomendados entre 4*sqrt(N) ~ 16*sqrt(N) para N número de pontos de dados.
Como o tempo de cálculo aumenta proporcionalmente ao número de n_sondas, consulte a precisão e escolha adequadamente. Pessoalmente, não acho que o RVC precise de tanta precisão, então n_probe = 1 está bem.
## FastScan
O FastScan é um método que permite a aproximação de alta velocidade de distâncias por quantização de produto cartesiano, realizando-as em registros.
A quantização cartesiana do produto executa o agrupamento independentemente para cada dimensão d (geralmente d = 2) durante o aprendizado, calcula a distância entre os agrupamentos com antecedência e cria uma tabela de pesquisa. No momento da previsão, a distância de cada dimensão pode ser calculada em O(1) olhando para a tabela de pesquisa.
Portanto, o número que você especifica após PQ geralmente especifica metade da dimensão do vetor.
Para uma descrição mais detalhada do FastScan, consulte a documentação oficial.
https://github.com/facebookresearch/faiss/wiki/Fast-accumulation-of-PQ-and-AQ-codes-(FastScan)
## RFlat
RFlat é uma instrução para recalcular a distância aproximada calculada pelo FastScan com a distância exata especificada pelo terceiro argumento da Construção de Index.
Ao obter áreas k, os pontos k*k_factor são recalculados.

224
docs/pt/faq_pt.md Normal file
View File

@ -0,0 +1,224 @@
# <b>FAQ AI HUB BRASIL</b>
## <span style="color: #337dff;">O que é epoch, quantos utilizar, quanto de dataset utilizar e qual à configuração interessante?</span>
Epochs basicamente quantas vezes o seu dataset foi treinado.
Recomendado ler Q8 e Q9 no final dessa página pra entender mais sobre dataset e epochs
__**Não é uma regra, mas opinião:**__
### **Mangio-Crepe Hop Length**
- 64 pra cantores e dubladores
- 128(padrão) para os demais (editado)
### **Epochs e dataset**
600epoch para cantores - --dataset entre 10 e 50 min desnecessario mais que 50 minutos--
300epoch para os demais - --dataset entre 10 e 50 min desnecessario mais que 50 minutos--
### **Tom**
magio-crepe se for audios extraído de alguma musica
harvest se for de estúdio<hr>
## <span style="color: #337dff;">O que é index?</span>
Basicamente o que define o sotaque. Quanto maior o numero, mas próximo o sotaque fica do original. Porém, quando o modelo é bem, não é necessário um index.<hr>
## <span style="color: #337dff;">O que significa cada sigla (pm, harvest, crepe, magio-crepe, RMVPE)?</span>
- pm = extração mais rápida, mas discurso de qualidade inferior;
- harvest = graves melhores, mas extremamente lentos;
- dio = conversão rápida mas pitch ruim;
- crepe = melhor qualidade, mas intensivo em GPU;
- crepe-tiny = mesma coisa que o crepe, só que com a qualidade um pouco inferior;
- **mangio-crepe = melhor qualidade, mais otimizado; (MELHOR OPÇÃO)**
- mangio-crepe-tiny = mesma coisa que o mangio-crepe, só que com a qualidade um pouco inferior;
- RMVPE: um modelo robusto para estimativa de afinação vocal em música polifônica;<hr>
## <span style="color: #337dff;">Pra rodar localmente, quais os requisitos minimos?</span>
Já tivemos relatos de pessoas com GTX 1050 rodando inferencia, se for treinar numa 1050 vai demorar muito mesmo e inferior a isso, normalmente da tela azul
O mais importante é placa de vídeo, vram na verdade
Se você tiver 4GB ou mais, você tem uma chance.
**NOS DOIS CASOS NÃO É RECOMENDADO UTILIZAR O PC ENQUANTO ESTÁ UTILIZNDO, CHANCE DE TELA AZUL É ALTA**
### Inference
Não é algo oficial para requisitos minimos
- Placa de vídeo: nvidia de 4gb
- Memoria ram: 8gb
- CPU: ?
- Armanezamento: 20gb (sem modelos)
### Treinamento de voz
Não é algo oficial para requisitos minimos
- Placa de vídeo: nvidia de 6gb
- Memoria ram: 16gb
- CPU: ?
- Armanezamento: 20gb (sem modelos)<hr>
## <span style="color: #337dff;">Limite de GPU no Google Colab excedido, apenas CPU o que fazer?</span>
Recomendamos esperar outro dia pra liberar mais 15gb ou 12 horas pra você. Ou você pode contribuir com o Google pagando algum dos planos, ai aumenta seu limite.<br>
Utilizar apenas CPU no Google Colab demora DEMAIS.<hr>
## <span style="color: #337dff;">Google Colab desconectando com muita frequencia, o que fazer?</span>
Neste caso realmente não tem muito o que fazer. Apenas aguardar o proprietário do código corrigir ou a gente do AI HUB Brasil achar alguma solução. Isso acontece por diversos motivos, um incluindo a Google barrando o treinamento de voz.<hr>
## <span style="color: #337dff;">O que é Batch Size/Tamanho de lote e qual numero utilizar?</span>
Batch Size/Tamanho do lote é basicamente quantos epoch faz ao mesmo tempo. Se por 20, ele fazer 20 epoch ao mesmo tempo e isso faz pesar mais na máquina e etc.<br>
No Google Colab você pode utilizar até 20 de boa.<br>
Se rodando localmente, depende da sua placa de vídeo, começa por baixo (6) e vai testando.<hr>
## <span style="color: #337dff;">Sobre backup na hora do treinamento</span>
Backup vai de cada um. Eu quando uso a ``easierGUI`` utilizo a cada 100 epoch (meu caso isolado).
No colab, se instavel, coloque a cada 10 epoch
Recomendo utilizarem entre 25 e 50 pra garantir.
Lembrando que cada arquivo geral é por volta de 50mb, então tenha muito cuidado quanto você coloca. Pois assim pode acabar lotando seu Google Drive ou seu PC.
Depois de finalizado, da pra apagar os epoch de backup.<hr>
## <span style="color: #337dff;">Como continuar da onde parou pra fazer mais epochs?</span>
Primeira coisa que gostaria de lembrar, não necessariamente quanto mais epochs melhor. Se fizer epochs demais vai dar **overtraining** o que pode ser ruim.
### GUI NORMAL
- Inicie normalmente a GUI novamente.
- Na aba de treino utilize o MESMO nome que estava treinando, assim vai continuar o treino onde parou o ultimo backup.
- Ignore as opções ``Processar o Conjunto de dados`` e ``Extrair Tom``
- Antes de clicar pra treinar, arrume os epoch, bakcup e afins.
- Obviamente tem que ser um numero maior do qu estava em epoch.
- Backup você pode aumentar ou diminuir
- Agora você vai ver a opção ``Carregue o caminho G do modelo base pré-treinado:`` e ``Carregue o caminho D do modelo base pré-treinado:``
-Aqui você vai por o caminho dos modelos que estão em ``./logs/minha-voz``
- Vai ficar algo parecido com isso ``e:/RVC/logs/minha-voz/G_0000.pth`` e ``e:/RVC/logs/minha-voz/D_0000.pth``
-Coloque pra treinar
**Lembrando que a pasta logs tem que ter todos os arquivos e não somente o arquivo ``G`` e ``D``**
### EasierGUI
- Inicie normalmente a easierGUI novamente.
- Na aba de treino utilize o MESMO nome que estava treinando, assim vai continuar o treino onde parou o ultimo backup.
- Selecione 'Treinar modelo', pode pular os 2 primeiros passos já que vamos continuar o treino.<hr><br>
# <b>FAQ Original traduzido</b>
## <b><span style="color: #337dff;">Q1: erro ffmpeg/erro utf8.</span></b>
Provavelmente não é um problema do FFmpeg, mas sim um problema de caminho de áudio;
O FFmpeg pode encontrar um erro ao ler caminhos contendo caracteres especiais como spaces e (), o que pode causar um erro FFmpeg; e quando o áudio do conjunto de treinamento contém caminhos chineses, gravá-lo em filelist.txt pode causar um erro utf8.<hr>
## <b><span style="color: #337dff;">Q2:Não é possível encontrar o arquivo de Index após "Treinamento com um clique".</span></b>
Se exibir "O treinamento está concluído. O programa é fechado ", então o modelo foi treinado com sucesso e os erros subsequentes são falsos;
A falta de um arquivo de index 'adicionado' após o treinamento com um clique pode ser devido ao conjunto de treinamento ser muito grande, fazendo com que a adição do index fique presa; isso foi resolvido usando o processamento em lote para adicionar o index, o que resolve o problema de sobrecarga de memória ao adicionar o index. Como solução temporária, tente clicar no botão "Treinar Index" novamente.<hr>
## <b><span style="color: #337dff;">Q3:Não é possível encontrar o modelo em “Modelo de voz” após o treinamento</span></b>
Clique em "Atualizar lista de voz" ou "Atualizar na EasyGUI e verifique novamente; se ainda não estiver visível, verifique se há erros durante o treinamento e envie capturas de tela do console, da interface do usuário da Web e dos ``logs/experiment_name/*.log`` para os desenvolvedores para análise posterior.<hr>
## <b><span style="color: #337dff;">Q4:Como compartilhar um modelo/Como usar os modelos dos outros?</span></b>
Os arquivos ``.pth`` armazenados em ``*/logs/minha-voz`` não são destinados para compartilhamento ou inference, mas para armazenar os checkpoits do experimento para reprodutibilidade e treinamento adicional. O modelo a ser compartilhado deve ser o arquivo ``.pth`` de 60+MB na pasta **weights**;
No futuro, ``weights/minha-voz.pth`` e ``logs/minha-voz/added_xxx.index`` serão mesclados em um único arquivo de ``weights/minha-voz.zip`` para eliminar a necessidade de entrada manual de index; portanto, compartilhe o arquivo zip, não somente o arquivo .pth, a menos que você queira continuar treinando em uma máquina diferente;
Copiar/compartilhar os vários arquivos .pth de centenas de MB da pasta de logs para a pasta de weights para inference forçada pode resultar em erros como falta de f0, tgt_sr ou outras chaves. Você precisa usar a guia ckpt na parte inferior para manualmente ou automaticamente (se as informações forem encontradas nos ``logs/minha-voz``), selecione se deseja incluir informações de tom e opções de taxa de amostragem de áudio de destino e, em seguida, extrair o modelo menor. Após a extração, haverá um arquivo pth de 60+ MB na pasta de weights, e você pode atualizar as vozes para usá-lo.<hr>
## <b><span style="color: #337dff;">Q5 Erro de conexão:</span></b>
Para sermos otimistas, aperte F5/recarregue a página, pode ter sido apenas um bug da GUI
Se não...
Você pode ter fechado o console (janela de linha de comando preta).
Ou o Google Colab, no caso do Colab, as vezes pode simplesmente fechar<hr>
## <b><span style="color: #337dff;">Q6: Pop-up WebUI 'Valor esperado: linha 1 coluna 1 (caractere 0)'.</span></b>
Desative o proxy LAN do sistema/proxy global e atualize.<hr>
## <b><span style="color: #337dff;">Q7:Como treinar e inferir sem a WebUI?</span></b>
Script de treinamento:
<br>Você pode executar o treinamento em WebUI primeiro, e as versões de linha de comando do pré-processamento e treinamento do conjunto de dados serão exibidas na janela de mensagens.<br>
Script de inference:
<br>https://huggingface.co/lj1995/VoiceConversionWebUI/blob/main/myinfer.py<br>
por exemplo<br>
``runtime\python.exe myinfer.py 0 "E:\audios\1111.wav" "E:\RVC\logs\minha-voz\added_IVF677_Flat_nprobe_7.index" harvest "test.wav" "weights/mi-test.pth" 0.6 cuda:0 True``<br>
f0up_key=sys.argv[1]<br>
input_path=sys.argv[2]<br>
index_path=sys.argv[3]<br>
f0method=sys.argv[4]#harvest or pm<br>
opt_path=sys.argv[5]<br>
model_path=sys.argv[6]<br>
index_rate=float(sys.argv[7])<br>
device=sys.argv[8]<br>
is_half=bool(sys.argv[9])<hr>
## <b><span style="color: #337dff;">Q8: Erro Cuda/Cuda sem memória.</span></b>
Há uma pequena chance de que haja um problema com a configuração do CUDA ou o dispositivo não seja suportado; mais provavelmente, não há memória suficiente (falta de memória).<br>
Para treinamento, reduza o (batch size) tamanho do lote (se reduzir para 1 ainda não for suficiente, talvez seja necessário alterar a placa gráfica); para inference, ajuste as configurações x_pad, x_query, x_center e x_max no arquivo config.py conforme necessário. Cartões de memória 4G ou inferiores (por exemplo, 1060(3G) e várias placas 2G) podem ser abandonados, enquanto os placas de vídeo com memória 4G ainda têm uma chance.<hr>
## <b><span style="color: #337dff;">Q9:Quantos total_epoch são ótimos?</span></b>
Se a qualidade de áudio do conjunto de dados de treinamento for ruim e o nível de ruído for alto, **20-30 epochs** são suficientes. Defini-lo muito alto não melhorará a qualidade de áudio do seu conjunto de treinamento de baixa qualidade.<br>
Se a qualidade de áudio do conjunto de treinamento for alta, o nível de ruído for baixo e houver duração suficiente, você poderá aumentá-lo. **200 é aceitável** (uma vez que o treinamento é rápido e, se você puder preparar um conjunto de treinamento de alta qualidade, sua GPU provavelmente poderá lidar com uma duração de treinamento mais longa sem problemas).<hr>
## <b><span style="color: #337dff;">Q10:Quanto tempo de treinamento é necessário?</span></b>
**Recomenda-se um conjunto de dados de cerca de 10 min a 50 min.**<br>
Com garantia de alta qualidade de som e baixo ruído de fundo, mais pode ser adicionado se o timbre do conjunto de dados for uniforme.<br>
Para um conjunto de treinamento de alto nível (limpo + distintivo), 5min a 10min é bom.<br>
Há algumas pessoas que treinaram com sucesso com dados de 1 a 2 minutos, mas o sucesso não é reproduzível por outros e não é muito informativo. <br>Isso requer que o conjunto de treinamento tenha um timbre muito distinto (por exemplo, um som de menina de anime arejado de alta frequência) e a qualidade do áudio seja alta;
Dados com menos de 1 minuto, já obtivemo sucesso. Mas não é recomendado.<hr>
## <b><span style="color: #337dff;">Q11:Qual é a taxa do index e como ajustá-la?</span></b>
Se a qualidade do tom do modelo pré-treinado e da fonte de inference for maior do que a do conjunto de treinamento, eles podem trazer a qualidade do tom do resultado do inference, mas ao custo de um possível viés de tom em direção ao tom do modelo subjacente/fonte de inference, em vez do tom do conjunto de treinamento, que é geralmente referido como "vazamento de tom".<br>
A taxa de index é usada para reduzir/resolver o problema de vazamento de timbre. Se a taxa do index for definida como 1, teoricamente não há vazamento de timbre da fonte de inference e a qualidade do timbre é mais tendenciosa em relação ao conjunto de treinamento. Se o conjunto de treinamento tiver uma qualidade de som mais baixa do que a fonte de inference, uma taxa de index mais alta poderá reduzir a qualidade do som. Reduzi-lo a 0 não tem o efeito de usar a mistura de recuperação para proteger os tons definidos de treinamento.<br>
Se o conjunto de treinamento tiver boa qualidade de áudio e longa duração, aumente o total_epoch, quando o modelo em si é menos propenso a se referir à fonte inferida e ao modelo subjacente pré-treinado, e há pouco "vazamento de tom", o index_rate não é importante e você pode até não criar/compartilhar o arquivo de index.<hr>
## <b><span style="color: #337dff;">Q12:Como escolher o GPU ao inferir?</span></b>
No arquivo ``config.py``, selecione o número da placa em "device cuda:".<br>
O mapeamento entre o número da placa e a placa gráfica pode ser visto na seção de informações da placa gráfica da guia de treinamento.<hr>
## <b><span style="color: #337dff;">Q13:Como usar o modelo salvo no meio do treinamento?</span></b>
Salvar via extração de modelo na parte inferior da guia de processamento do ckpt.<hr>
## <b><span style="color: #337dff;">Q14: Erro de arquivo/memória (durante o treinamento)?</span></b>
Muitos processos e sua memória não é suficiente. Você pode corrigi-lo por:
1. Diminuir a entrada no campo "Threads da CPU".
2. Diminuir o tamanho do conjunto de dados.
## Q15: Como continuar treinando usando mais dados
passo 1: coloque todos os dados wav no path2.
etapa 2: exp_name2 + path2 -> processar conjunto de dados e extrair recurso.
passo 3: copie o arquivo G e D mais recente de exp_name1 (seu experimento anterior) para a pasta exp_name2.
passo 4: clique em "treinar o modelo" e ele continuará treinando desde o início da época anterior do modelo exp.
## Q16: erro sobre llvmlite.dll
OSError: Não foi possível carregar o arquivo de objeto compartilhado: llvmlite.dll
FileNotFoundError: Não foi possível encontrar o módulo lib\site-packages\llvmlite\binding\llvmlite.dll (ou uma de suas dependências). Tente usar o caminho completo com sintaxe de construtor.
O problema acontecerá no Windows, instale https://aka.ms/vs/17/release/vc_redist.x64.exe e será corrigido.
## Q17: RuntimeError: O tamanho expandido do tensor (17280) deve corresponder ao tamanho existente (0) na dimensão 1 não singleton. Tamanhos de destino: [1, 17280]. Tamanhos de tensor: [0]
Exclua os arquivos wav cujo tamanho seja significativamente menor que outros e isso não acontecerá novamente. Em seguida, clique em "treinar o modelo" e "treinar o índice".
## Q18: RuntimeError: O tamanho do tensor a (24) deve corresponder ao tamanho do tensor b (16) na dimensão não singleton 2
Não altere a taxa de amostragem e continue o treinamento. Caso seja necessário alterar, o nome do exp deverá ser alterado e o modelo será treinado do zero. Você também pode copiar o pitch e os recursos (pastas 0/1/2/2b) extraídos da última vez para acelerar o processo de treinamento.

View File

@ -0,0 +1,65 @@
Instruções e dicas para treinamento RVC
======================================
Estas DICAS explicam como o treinamento de dados é feito.
# Fluxo de treinamento
Explicarei ao longo das etapas na guia de treinamento da GUI.
## Passo 1
Defina o nome do experimento aqui.
Você também pode definir aqui se o modelo deve levar em consideração o pitch.
Se o modelo não considerar o tom, o modelo será mais leve, mas não será adequado para cantar.
Os dados de cada experimento são colocados em `/logs/nome-do-seu-modelo/`.
## Passo 2a
Carrega e pré-processa áudio.
### Carregar áudio
Se você especificar uma pasta com áudio, os arquivos de áudio dessa pasta serão lidos automaticamente.
Por exemplo, se você especificar `C:Users\hoge\voices`, `C:Users\hoge\voices\voice.mp3` será carregado, mas `C:Users\hoge\voices\dir\voice.mp3` será Não carregado.
Como o ffmpeg é usado internamente para leitura de áudio, se a extensão for suportada pelo ffmpeg, ela será lida automaticamente.
Após converter para int16 com ffmpeg, converta para float32 e normalize entre -1 e 1.
### Eliminar ruído
O áudio é suavizado pelo filtfilt do scipy.
### Divisão de áudio
Primeiro, o áudio de entrada é dividido pela detecção de partes de silêncio que duram mais que um determinado período (max_sil_kept=5 segundos?). Após dividir o áudio no silêncio, divida o áudio a cada 4 segundos com uma sobreposição de 0,3 segundos. Para áudio separado em 4 segundos, após normalizar o volume, converta o arquivo wav para `/logs/nome-do-seu-modelo/0_gt_wavs` e, em seguida, converta-o para taxa de amostragem de 16k para `/logs/nome-do-seu-modelo/1_16k_wavs ` como um arquivo wav.
## Passo 2b
### Extrair pitch
Extraia informações de pitch de arquivos wav. Extraia as informações de pitch (=f0) usando o método incorporado em Parselmouth ou pyworld e salve-as em `/logs/nome-do-seu-modelo/2a_f0`. Em seguida, converta logaritmicamente as informações de pitch para um número inteiro entre 1 e 255 e salve-as em `/logs/nome-do-seu-modelo/2b-f0nsf`.
### Extrair feature_print
Converta o arquivo wav para incorporação antecipadamente usando HuBERT. Leia o arquivo wav salvo em `/logs/nome-do-seu-modelo/1_16k_wavs`, converta o arquivo wav em recursos de 256 dimensões com HuBERT e salve no formato npy em `/logs/nome-do-seu-modelo/3_feature256`.
## Passo 3
treinar o modelo.
### Glossário para iniciantes
No aprendizado profundo, o conjunto de dados é dividido e o aprendizado avança aos poucos. Em uma atualização do modelo (etapa), os dados batch_size são recuperados e previsões e correções de erros são realizadas. Fazer isso uma vez para um conjunto de dados conta como um epoch.
Portanto, o tempo de aprendizagem é o tempo de aprendizagem por etapa x (o número de dados no conjunto de dados/tamanho do lote) x o número de epoch. Em geral, quanto maior o tamanho do lote, mais estável se torna o aprendizado (tempo de aprendizado por etapa ÷ tamanho do lote) fica menor, mas usa mais memória GPU. A RAM da GPU pode ser verificada com o comando nvidia-smi. O aprendizado pode ser feito em pouco tempo aumentando o tamanho do lote tanto quanto possível de acordo com a máquina do ambiente de execução.
### Especifique o modelo pré-treinado
O RVC começa a treinar o modelo a partir de pesos pré-treinados em vez de 0, para que possa ser treinado com um pequeno conjunto de dados.
Por padrão
- Se você considerar o pitch, ele carrega `rvc-location/pretrained/f0G40k.pth` e `rvc-location/pretrained/f0D40k.pth`.
- Se você não considerar o pitch, ele carrega `rvc-location/pretrained/f0G40k.pth` e `rvc-location/pretrained/f0D40k.pth`.
Ao aprender, os parâmetros do modelo são salvos em `logs/nome-do-seu-modelo/G_{}.pth` e `logs/nome-do-seu-modelo/D_{}.pth` para cada save_every_epoch, mas especificando nesse caminho, você pode começar a aprender. Você pode reiniciar ou iniciar o treinamento a partir de weights de modelo aprendidos em um experimento diferente.
### Index de aprendizado
O RVC salva os valores de recursos do HuBERT usados durante o treinamento e, durante a inferência, procura valores de recursos que sejam semelhantes aos valores de recursos usados durante o aprendizado para realizar a inferência. Para realizar esta busca em alta velocidade, o index é aprendido previamente.
Para aprendizagem de index, usamos a biblioteca de pesquisa de associação de áreas aproximadas faiss. Leia o valor do recurso `logs/nome-do-seu-modelo/3_feature256` e use-o para aprender o index, e salve-o como `logs/nome-do-seu-modelo/add_XXX.index`.
(A partir da versão 20230428update, ele é lido do index e não é mais necessário salvar/especificar.)
### Descrição do botão
- Treinar modelo: Após executar o passo 2b, pressione este botão para treinar o modelo.
- Treinar índice de recursos: após treinar o modelo, execute o aprendizado do index.
- Treinamento com um clique: etapa 2b, treinamento de modelo e treinamento de index de recursos, tudo de uma vez.

View File

@ -20,7 +20,7 @@ VITS'e dayalı kullanımı kolay bir Ses Dönüşümü çerçevesi.<br><br>
------
[**Değişiklik Geçmişi**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/docs/Changelog_TR.md) | [**SSS (Sıkça Sorulan Sorular)**](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/wiki/SSS-(Sıkça-Sorulan-Sorular))
[**İngilizce**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Türkçe**](../tr/README.tr.md)
[**İngilizce**](../en/README.en.md) | [**中文简体**](../../README.md) | [**日本語**](../jp/README.ja.md) | [**한국어**](../kr/README.ko.md) ([**韓國語**](../kr/README.ko.han.md)) | [**Français**](../fr/README.fr.md) | [**Türkçe**](../tr/README.tr.md) | [**Português**](../pt/README.pt.md)
Burada [Demo Video'muzu](https://www.bilibili.com/video/BV1pm4y1z7Gm/) izleyebilirsiniz!

1944
gui_v1.py

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
"A模型权重": "Weight (w) for Model A:",
"A模型路径": "Path to Model A:",
"B模型路径": "Path to Model B:",
"E:\\语音音频+标注\\米津玄师\\src": "C:\\Users\\Desktop\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0 curve file (optional). One pitch per line. Replaces the default F0 and pitch modulation:",
"Index Rate": "Index Rate",
"Onnx导出": "Export Onnx",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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.",
"以-分隔输入使用的卡号, 例如 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:",
"伴奏人声分离&去混响&去回声": "Vocals/Accompaniment Separation & Reverberation Removal",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Save name:",
"保存的文件名, 默认空为和源文件同名": "Save file name (default: same as the source file):",
"保存的模型名不带后缀": "Saved model name (without extension):",
@ -38,11 +41,12 @@
"加载模型": "Load model",
"加载预训练底模D路径": "Load pre-trained base model D path:",
"加载预训练底模G路径": "Load pre-trained base model G path:",
"单次推理": "单次推理",
"单次推理": "Single Inference",
"卸载音色省显存": "Unload voice to save GPU memory:",
"变调(整数, 半音数量, 升八度12降八度-12)": "Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12):",
"后处理重采样至最终采样率0为不进行重采样": "Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling:",
"否": "No",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Response threshold",
"响度因子": "loudness factor",
"处理数据": "Process data",
@ -54,7 +58,7 @@
"很遗憾您这没有能用的显卡来支持您训练": "Unfortunately, there is no compatible GPU available to support your training.",
"性能设置": "Performance settings",
"总训练轮数total_epoch": "Total training epochs (total_epoch):",
"批量推理": "批量推理",
"批量推理": "Batch Inference",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认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').",
"指定输出主人声文件夹": "Specify the output folder for vocals:",
"指定输出文件夹": "Specify output folder:",
@ -86,6 +90,7 @@
"版本": "Version",
"特征提取": "Feature extraction",
"特征检索库文件路径,为空则使用下拉的选择结果": "Path to the feature index file. Leave blank to use the selected result from the dropdown:",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+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.",
"目标采样率": "Target sample rate:",
"算法延迟(ms):": "Algorithmic delays(ms):",
@ -97,6 +102,7 @@
"训练模型": "Train model",
"训练特征索引": "Train feature index",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Training complete. You can check the training logs in the console or the 'train.log' file under the experiment folder.",
"设备类型": "设备类型",
"请指定说话人id": "Please specify the speaker/singer ID:",
"请选择index文件": "Please choose the .index file",
"请选择pth文件": "Please choose the .pth file",
@ -120,11 +126,12 @@
"选择.pth文件": "Select the .pth file",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用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",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"选择音高提取算法:输入歌声可用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",
"采样率:": "采样率:",
"采样长度": "Sample length",
"重载设备列表": "Reload device list",
"音调设置": "Pitch settings",
"音频设备(请使用同种类驱动)": "Audio device (please use the same type of driver)",
"音频设备": "Audio device",
"音高算法": "pitch detection algorithm",
"额外推理时长": "Extra inference time"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "Un peso modelo para el modelo A.",
"A模型路径": "Modelo A ruta.",
"B模型路径": "Modelo B ruta.",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Archivo de curva F0, opcional, un tono por línea, en lugar de F0 predeterminado y cambio de tono",
"Index Rate": "Tasa de índice",
"Onnx导出": "Exportar Onnx",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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.",
"以-分隔输入使用的卡号, 例如 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.",
"伴奏人声分离&去混响&去回声": "Separación de voz acompañante & eliminación de reverberación & eco",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Guardar nombre",
"保存的文件名, 默认空为和源文件同名": "Nombre del archivo que se guardará, el valor predeterminado es el mismo que el nombre del archivo de origen",
"保存的模型名不带后缀": "Nombre del modelo guardado sin extensión.",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "Cambio de tono (entero, número de semitonos, subir una octava +12 o bajar una octava -12)",
"后处理重采样至最终采样率0为不进行重采样": "Remuestreo posterior al proceso a la tasa de muestreo final, 0 significa no remuestrear",
"否": "No",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Umbral de respuesta",
"响度因子": "factor de sonoridad",
"处理数据": "Procesar datos",
@ -86,6 +90,7 @@
"版本": "Versión",
"特征提取": "Extracción de características",
"特征检索库文件路径,为空则使用下拉的选择结果": "Ruta del archivo de la biblioteca de características, si está vacío, se utilizará el resultado de la selección desplegable",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+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.",
"目标采样率": "Tasa de muestreo objetivo",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "Entrenar Modelo",
"训练特征索引": "Índice de características",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Entrenamiento finalizado, puede ver el registro de entrenamiento en la consola o en el archivo train.log en la carpeta del experimento",
"设备类型": "设备类型",
"请指定说话人id": "ID del modelo",
"请选择index文件": "Seleccione el archivo .index",
"请选择pth文件": "Seleccione el archivo .pth",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用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",
"选择音高提取算法,输入歌声可用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",
"选择音高提取算法:输入歌声可用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",
"采样率:": "采样率:",
"采样长度": "Longitud de muestreo",
"重载设备列表": "Actualizar lista de dispositivos",
"音调设置": "Ajuste de tono",
"音频设备(请使用同种类驱动)": "Dispositivo de audio (utilice el mismo tipo de controlador)",
"音频设备": "Dispositivo de audio",
"音高算法": "Algoritmo de tono",
"额外推理时长": "Tiempo de inferencia adicional"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "Poids (w) pour le modèle A :",
"A模型路径": "Chemin d'accès au modèle A :",
"B模型路径": "Chemin d'accès au modèle B :",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"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 :",
"Index Rate": "Taux d'indexation",
"Onnx导出": "Exporter en ONNX",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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.",
"以-分隔输入使用的卡号, 例如 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 :",
"伴奏人声分离&去混响&去回声": "Séparation des voix/accompagnement et suppression de la réverbération",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Nom de sauvegarde :",
"保存的文件名, 默认空为和源文件同名": "Nom du fichier de sauvegarde (par défaut : identique au nom du fichier source) :",
"保存的模型名不带后缀": "Nom du modèle enregistré (sans extension) :",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "Transposer (entier, nombre de demi-tons, monter d'une octave : 12, descendre d'une octave : -12) :",
"后处理重采样至最终采样率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 :",
"否": "Non",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Seuil de réponse",
"响度因子": "Facteur de volume sonore",
"处理数据": "Traitement des données",
@ -86,9 +90,10 @@
"版本": "Version",
"特征提取": "Extraction des caractéristiques",
"特征检索库文件路径,为空则使用下拉的选择结果": "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 :",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+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.",
"目标采样率": "Taux d'échantillonnage cible :",
"算法延迟(ms):": "算法延迟(ms):",
"算法延迟(ms):": "Délais algorithmiques (ms):",
"自动检测index路径,下拉式选择(dropdown)": "Détecter automatiquement le chemin d'accès à l'index et le sélectionner dans la liste déroulante :",
"融合": "Fusion",
"要改的模型信息": "Informations sur le modèle à modifier :",
@ -97,6 +102,7 @@
"训练模型": "Entraîner le modèle",
"训练特征索引": "Entraîner l'index des caractéristiques",
"训练结束, 您可查看控制台训练日志或实验文件夹下的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.",
"设备类型": "设备类型",
"请指定说话人id": "Veuillez spécifier l'ID de l'orateur ou du chanteur :",
"请选择index文件": "Veuillez sélectionner le fichier d'index",
"请选择pth文件": "Veuillez sélectionner le fichier pth",
@ -107,12 +113,12 @@
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Entrez le chemin du dossier audio à traiter (copiez-le depuis la barre d'adresse du gestionnaire de fichiers) :",
"输入待处理音频文件路径(默认是正确格式示例)": "Entrez le chemin d'accès du fichier audio à traiter (par défaut, l'exemple de format correct) :",
"输入源音量包络替换输出音量包络融合比例越靠近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 :",
"输入监听": "输入监听",
"输入监听": "Moniteur vocal d'entrée",
"输入训练文件夹路径": "Indiquez le chemin d'accès au dossier d'entraînement :",
"输入设备": "Dispositif d'entrée",
"输入降噪": "Réduction du bruit d'entrée",
"输出信息": "Informations sur la sortie",
"输出变声": "输出变声",
"输出变声": "Sortie voix convertie",
"输出设备": "Dispositif de sortie",
"输出降噪": "Réduction du bruit de sortie",
"输出音频(右下角三个点,点了可以下载)": "Exporter l'audio (cliquer sur les trois points dans le coin inférieur droit pour télécharger)",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用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.",
"选择音高提取算法,输入歌声可用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.",
"选择音高提取算法:输入歌声可用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.",
"采样率:": "采样率:",
"采样长度": "Longueur de l'échantillon",
"重载设备列表": "Recharger la liste des dispositifs",
"音调设置": "Réglages de la hauteur",
"音频设备(请使用同种类驱动)": "Périphérique audio (veuillez utiliser le même type de pilote)",
"音频设备": "Périphérique audio",
"音高算法": "algorithme de détection de la hauteur",
"额外推理时长": "Temps d'inférence supplémentaire"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "Peso (w) per il modello A:",
"A模型路径": "Percorso per il modello A:",
"B模型路径": "Percorso per il modello B:",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "File curva F0 (opzionale). ",
"Index Rate": "Tasso di indice",
"Onnx导出": "Esporta Onnx",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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.",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Inserisci gli indici GPU separati da '-', ad esempio 0-1-2 per utilizzare GPU 0, 1 e 2:",
"伴奏人声分离&去混响&去回声": "Separazione voce/accompagnamento",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Salva nome:",
"保存的文件名, 默认空为和源文件同名": "Salva il nome del file (predefinito: uguale al file di origine):",
"保存的模型名不带后缀": "Nome del modello salvato (senza estensione):",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "Trasposizione (numero intero, numero di semitoni, alza di un'ottava: 12, abbassa di un'ottava: -12):",
"后处理重采样至最终采样率0为不进行重采样": "Ricampiona l'audio di output in post-elaborazione alla frequenza di campionamento finale. ",
"否": "NO",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Soglia di risposta",
"响度因子": "fattore di sonorità",
"处理数据": "Processa dati",
@ -86,6 +90,7 @@
"版本": "Versione",
"特征提取": "Estrazione delle caratteristiche",
"特征检索库文件路径,为空则使用下拉的选择结果": "Percorso del file di indice delle caratteristiche. ",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Tonalità +12 consigliata per la conversione da maschio a femmina e tonalità -12 per la conversione da femmina a maschio. ",
"目标采样率": "Frequenza di campionamento target:",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "Addestra modello",
"训练特征索引": "Addestra indice delle caratteristiche",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Addestramento completato. ",
"设备类型": "设备类型",
"请指定说话人id": "Si prega di specificare l'ID del locutore/cantante:",
"请选择index文件": "请选择index文件",
"请选择pth文件": "请选择pth 文件",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用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):",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "Lunghezza del campione",
"重载设备列表": "Ricaricare l'elenco dei dispositivi",
"音调设置": "Impostazioni del tono",
"音频设备(请使用同种类驱动)": "Dispositivo audio (utilizzare lo stesso tipo di driver)",
"音频设备": "Dispositivo audio",
"音高算法": "音高算法",
"额外推理时长": "Tempo di inferenza extra"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "Aモデルの重み",
"A模型路径": "Aモデルのパス",
"B模型路径": "Bモデルのパス",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0(最低共振周波数)カーブファイル(オプション、1行に1ピッチ、デフォルトのF0(最低共振周波数)とエレベーションを置き換えます。)",
"Index Rate": "Index Rate",
"Onnx导出": "Onnxエクスポート",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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を適用することです。",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "ハイフンで区切って使用するGPUの番号を入力します。例えば0-1-2はGPU0、GPU1、GPU2を使用します",
"伴奏人声分离&去混响&去回声": "伴奏ボーカル分離&残響除去&エコー除去",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "保存ファイル名",
"保存的文件名, 默认空为和源文件同名": "保存するファイル名、デフォルトでは空欄で元のファイル名と同じ名前になります",
"保存的模型名不带后缀": "拡張子のない保存するモデル名",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "ピッチ変更(整数、半音数、上下オクターブ12-12)",
"后处理重采样至最终采样率0为不进行重采样": "最終的なサンプリングレートへのポストプロセッシングのリサンプリング リサンプリングしない場合は0",
"否": "いいえ",
"启用相位声码器": "启用相位声码器",
"响应阈值": "反応閾値",
"响度因子": "ラウドネス係数",
"处理数据": "データ処理",
@ -86,6 +90,7 @@
"版本": "バージョン",
"特征提取": "特徴抽出",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徴検索ライブラリへのパス 空の場合はドロップダウンで選択",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性から女性へは+12キーをお勧めします。女性から男性へは-12キーをお勧めします。音域が広すぎて音質が劣化した場合は、適切な音域に自分で調整してください。",
"目标采样率": "目標サンプリングレート",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "モデルのトレーニング",
"训练特征索引": "特徴インデックスのトレーニング",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "トレーニング終了時に、トレーニングログやフォルダ内のtrain.logを確認することができます",
"设备类型": "设备类型",
"请指定说话人id": "話者IDを指定してください",
"请选择index文件": "indexファイルを選択してください",
"请选择pth文件": "pthファイルを選択してください",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "ピッチ抽出アルゴリズムの選択、歌声はpmで高速化でき、harvestは低音が良いが信じられないほど遅く、crepeは良く動くがGPUを食います。",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "ピッチ抽出アルゴリズムの選択、歌声はpmで高速化でき、harvestは低音が良いが信じられないほど遅く、crepeは良く動くがGPUを喰います",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "ピッチ抽出アルゴリズムの選択歌声はpmで高速化でき、入力した音声が高音質でCPUが貧弱な場合はdioで高速化でき、harvestの方が良いが遅く、rmvpeがベストだがCPU/GPUを若干食います。",
"采样率:": "采样率:",
"采样长度": "サンプル長",
"重载设备列表": "デバイスリストをリロードする",
"音调设置": "音程設定",
"音频设备(请使用同种类驱动)": "オーディオデバイス(同じ種類のドライバーを使用してください)",
"音频设备": "オーディオデバイス",
"音高算法": "ピッチアルゴリズム",
"额外推理时长": "追加推論時間"
}

137
i18n/locale/ko_KR.json Normal file
View File

@ -0,0 +1,137 @@
{
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3인 경우 harvest 피치 인식 결과에 중간값 필터 적용, 필터 반경은 값으로 지정, 사용 시 무성음 감소 가능",
"A模型权重": "A 모델 가중치",
"A模型路径": "A 모델 경로",
"B模型路径": "B 모델 경로",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\음성 오디오+표시\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0 곡선 파일, 선택적, 한 줄에 하나의 피치, 기본 F0 및 음높이 조절 대체",
"Index Rate": "인덱스 비율",
"Onnx导出": "Onnx 내보내기",
"Onnx输出路径": "Onnx 출력 경로",
"RVC模型路径": "RVC 모델 경로",
"ckpt处理": "ckpt 처리",
"harvest进程数": "harvest 프로세스 수",
"index文件路径不可包含中文": "index 파일 경로는 중국어를 포함할 수 없음",
"pth文件路径不可包含中文": "pth 파일 경로는 중국어를 포함할 수 없음",
"rmvpe卡号配置以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "rmvpe 카드 번호 설정: -로 구분된 입력 사용 카드 번호, 예: 0-0-1은 카드 0에서 2개 프로세스, 카드 1에서 1개 프로세스 실행",
"step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "step1: 실험 구성 작성. 실험 데이터는 logs에 저장, 각 실험은 하나의 폴더, 수동으로 실험 이름 경로 입력 필요, 실험 구성, 로그, 훈련된 모델 파일 포함.",
"step1:正在处理数据": "step1: 데이터 처리 중",
"step2:正在提取音高&正在提取特征": "step2: 음높이 추출 & 특징 추출 중",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "step2a: 훈련 폴더 아래 모든 오디오로 디코딩 가능한 파일을 자동 순회하며 슬라이스 정규화 진행, 실험 디렉토리 아래 2개의 wav 폴더 생성; 현재 단일 사용자 훈련만 지원.",
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "step2b: CPU를 사용하여 음높이 추출(모델이 음높이 포함 시), GPU를 사용하여 특징 추출(카드 번호 선택)",
"step3: 填写训练设置, 开始训练模型和索引": "step3: 훈련 설정 작성, 모델 및 인덱스 훈련 시작",
"step3a:正在训练模型": "step3a: 모델 훈련 중",
"一键训练": "원클릭 훈련",
"也可批量输入音频文件, 二选一, 优先读文件夹": "여러 오디오 파일을 일괄 입력할 수도 있음, 둘 중 하나 선택, 폴더 우선 읽기",
"人声伴奏分离批量处理, 使用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 사용.",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "-로 구분하여 입력하는 카드 번호, 예: 0-1-2는 카드 0, 카드 1, 카드 2 사용",
"伴奏人声分离&去混响&去回声": "반주 인간 목소리 분리 & 혼효음 제거 & 에코 제거",
"使用模型采样率": "모델 샘플링 레이트 사용",
"使用设备采样率": "장치 샘플링 레이트 사용",
"保存名": "저장 이름",
"保存的文件名, 默认空为和源文件同名": "저장될 파일명, 기본적으로 빈 공간은 원본 파일과 동일한 이름으로",
"保存的模型名不带后缀": "저장된 모델명은 접미사 없음",
"保存频率save_every_epoch": "저장 빈도 save_every_epoch",
"保护清辅音和呼吸声防止电音撕裂等artifact拉满0.5不开启,调低加大保护力度但可能降低索引效果": "청자음과 호흡 소리를 보호, 전자음 찢김 등의 아티팩트 방지, 0.5까지 올려서 비활성화, 낮추면 보호 강도 증가하지만 인덱스 효과 감소 가능성 있음",
"修改": "수정",
"修改模型信息(仅支持weights文件夹下提取的小模型文件)": "모델 정보 수정(오직 weights 폴더 아래에서 추출된 작은 모델 파일만 지원)",
"停止音频转换": "오디오 변환 중지",
"全流程结束!": "전체 과정 완료!",
"刷新音色列表和索引路径": "음색 목록 및 인덱스 경로 새로고침",
"加载模型": "모델 로드",
"加载预训练底模D路径": "미리 훈련된 베이스 모델 D 경로 로드",
"加载预训练底模G路径": "미리 훈련된 베이스 모델 G 경로 로드",
"单次推理": "단일 추론",
"卸载音色省显存": "음색 언로드로 디스플레이 메모리 절약",
"变调(整数, 半音数量, 升八度12降八度-12)": "키 변경(정수, 반음 수, 옥타브 상승 12, 옥타브 하강 -12)",
"后处理重采样至最终采样率0为不进行重采样": "후처리 재샘플링을 최종 샘플링 레이트로, 0은 재샘플링하지 않음",
"否": "아니오",
"启用相位声码器": "위상 보코더 활성화",
"响应阈值": "응답 임계값",
"响度因子": "음량 인자",
"处理数据": "데이터 처리",
"导出Onnx模型": "Onnx 모델 내보내기",
"导出文件格式": "내보낼 파일 형식",
"常见问题解答": "자주 묻는 질문",
"常规设置": "일반 설정",
"开始音频转换": "오디오 변환 시작",
"很遗憾您这没有能用的显卡来支持您训练": "사용 가능한 그래픽 카드가 없어 훈련을 지원할 수 없습니다",
"性能设置": "성능 설정",
"总训练轮数total_epoch": "총 훈련 라운드 수 total_epoch",
"批量推理": "일괄 추론",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "일괄 변환, 변환할 오디오 파일 폴더 입력 또는 여러 오디오 파일 업로드, 지정된 폴더(기본값 opt)에 변환된 오디오 출력.",
"指定输出主人声文件夹": "주된 목소리 출력 폴더 지정",
"指定输出文件夹": "출력 파일 폴더 지정",
"指定输出非主人声文件夹": "주된 목소리가 아닌 출력 폴더 지정",
"推理时间(ms):": "추론 시간(ms):",
"推理音色": "추론 음색",
"提取": "추출",
"提取音高和处理数据使用的CPU进程数": "음높이 추출 및 데이터 처리에 사용되는 CPU 프로세스 수",
"是": "예",
"是否仅保存最新的ckpt文件以节省硬盘空间": "디스크 공간을 절약하기 위해 최신 ckpt 파일만 저장할지 여부",
"是否在每次保存时间点将最终小模型保存至weights文件夹": "저장 시마다 최종 소형 모델을 weights 폴더에 저장할지 여부",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "모든 훈련 세트를 VRAM에 캐시할지 여부. 10분 미만의 소량 데이터는 캐시하여 훈련 속도를 높일 수 있지만, 대량 데이터 캐시는 VRAM을 과부하시키고 속도를 크게 향상시키지 못함",
"显卡信息": "그래픽 카드 정보",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "이 소프트웨어는 MIT 라이선스로 공개되며, 저자는 소프트웨어에 대해 어떠한 통제권도 가지지 않습니다. 모든 귀책사유는 소프트웨어 사용자 및 소프트웨어에서 생성된 결과물을 사용하는 당사자에게 있습니다. <br>해당 조항을 인정하지 않는 경우, 소프트웨어 패키지의 어떠한 코드나 파일도 사용하거나 인용할 수 없습니다. 자세한 내용은 루트 디렉토리의 <b>LICENSE</b>를 참조하세요.",
"查看": "보기",
"查看模型信息(仅支持weights文件夹下提取的小模型文件)": "모델 정보 보기(오직 weights 폴더에서 추출된 소형 모델 파일만 지원)",
"检索特征占比": "검색 특징 비율",
"模型": "모델",
"模型推理": "모델 추론",
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "모델 추출(logs 폴더 아래의 큰 파일 모델 경로 입력), 훈련 중간에 중단한 모델의 자동 추출 및 소형 파일 모델 저장이 안 되거나 중간 모델을 테스트하고 싶은 경우에 적합",
"模型是否带音高指导": "모델이 음높이 지도를 포함하는지 여부",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "모델이 음높이 지도를 포함하는지 여부(노래에는 반드시 필요, 음성에는 필요 없음)",
"模型是否带音高指导,1是0否": "모델이 음높이 지도를 포함하는지 여부, 1은 예, 0은 아니오",
"模型版本型号": "모델 버전 및 모델",
"模型融合, 可用于测试音色融合": "모델 융합, 음색 융합 테스트에 사용 가능",
"模型路径": "모델 경로",
"每张显卡的batch_size": "각 그래픽 카드의 batch_size",
"淡入淡出长度": "페이드 인/아웃 길이",
"版本": "버전",
"特征提取": "특징 추출",
"特征检索库文件路径,为空则使用下拉的选择结果": "특징 검색 라이브러리 파일 경로, 비어 있으면 드롭다운 선택 결과 사용",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "남성에서 여성으로 변경 시 +12 키 권장, 여성에서 남성으로 변경 시 -12 키 권장, 음역대 폭발로 음색이 왜곡되면 적절한 음역대로 조정 가능.",
"目标采样率": "목표 샘플링률",
"算法延迟(ms):": "알고리즘 지연(ms):",
"自动检测index路径,下拉式选择(dropdown)": "자동으로 index 경로 감지, 드롭다운 선택(dropdown)",
"融合": "융합",
"要改的模型信息": "변경할 모델 정보",
"要置入的模型信息": "삽입할 모델 정보",
"训练": "훈련",
"训练模型": "모델 훈련",
"训练特征索引": "특징 인덱스 훈련",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "훈련 완료, 콘솔 훈련 로그 또는 실험 폴더 내의 train.log 확인 가능",
"设备类型": "设备类型",
"请指定说话人id": "화자 ID 지정 필요",
"请选择index文件": "index 파일 선택",
"请选择pth文件": "pth 파일 선택",
"请选择说话人id": "화자 ID 선택",
"转换": "변환",
"输入实验名": "실험명 입력",
"输入待处理音频文件夹路径": "처리할 오디오 파일 폴더 경로 입력",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "처리할 오디오 파일 폴더 경로 입력(파일 탐색기 주소 표시줄에서 복사)",
"输入待处理音频文件路径(默认是正确格式示例)": "처리할 오디오 파일 경로 입력(기본적으로 올바른 형식 예시)",
"输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络": "입력 소스 볼륨 엔벨로프와 출력 볼륨 엔벨로프의 결합 비율 입력, 1에 가까울수록 출력 엔벨로프 사용",
"输入监听": "입력 모니터링",
"输入训练文件夹路径": "훈련 파일 폴더 경로 입력",
"输入设备": "입력 장치",
"输入降噪": "입력 노이즈 감소",
"输出信息": "출력 정보",
"输出变声": "출력 음성 변조",
"输出设备": "출력 장치",
"输出降噪": "출력 노이즈 감소",
"输出音频(右下角三个点,点了可以下载)": "출력 오디오(오른쪽 하단 세 개의 점, 클릭하면 다운로드 가능)",
"选择.index文件": ".index 파일 선택",
"选择.pth文件": ".pth 파일 선택",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "음높이 추출 알고리즘 선택, 노래 입력 시 pm으로 속도 향상, harvest는 저음이 좋지만 매우 느림, crepe는 효과가 좋지만 GPU 사용",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "음높이 추출 알고리즘 선택, 노래 입력 시 pm으로 속도 향상, harvest는 저음이 좋지만 매우 느림, crepe는 효과가 좋지만 GPU 사용, rmvpe는 효과가 가장 좋으며 GPU를 적게 사용",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "음높이 추출 알고리즘 선택: 노래 입력 시 pm으로 속도 향상, 고품질 음성에는 CPU가 부족할 때 dio 사용, harvest는 품질이 더 좋지만 느림, rmvpe는 효과가 가장 좋으며 CPU/GPU를 적게 사용",
"采样率:": "샘플링률:",
"采样长度": "샘플링 길이",
"重载设备列表": "장치 목록 재로드",
"音调设置": "음조 설정",
"音频设备": "音频设备",
"音高算法": "음높이 알고리즘",
"额外推理时长": "추가 추론 시간"
}

137
i18n/locale/pt_BR.json Normal file
View File

@ -0,0 +1,137 @@
{
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音": ">=3, use o filtro mediano para o resultado do reconhecimento do tom da heverst, e o valor é o raio do filtro, que pode enfraquecer o mudo.",
"A模型权重": "Peso (w) para o modelo A:",
"A模型路径": "Caminho para o Modelo A:",
"B模型路径": "Caminho para o Modelo B:",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\meu-dataset",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Arquivo de curva F0 (opcional). Um arremesso por linha. Substitui a modulação padrão F0 e tom:",
"Index Rate": "Taxa do Index",
"Onnx导出": "Exportar Onnx",
"Onnx输出路径": "Caminho de exportação ONNX:",
"RVC模型路径": "Caminho do Modelo RVC:",
"ckpt处理": "processamento ckpt",
"harvest进程数": "Número de processos harvest",
"index文件路径不可包含中文": "O caminho do arquivo de Index não pode conter caracteres chineses",
"pth文件路径不可包含中文": "o caminho do arquivo pth não pode conter caracteres chineses",
"rmvpe卡号配置以-分隔输入使用的不同进程卡号,例如0-0-1使用在卡0上跑2个进程并在卡1上跑1个进程": "Configuração do número do cartão rmvpe: Use - para separar os números dos cartões de entrada de diferentes processos. Por exemplo, 0-0-1 é usado para executar 2 processos no cartão 0 e 1 processo no cartão 1.",
"step1: 填写实验配置. 实验数据放在logs下, 每个实验一个文件夹, 需手工输入实验名路径, 内含实验配置, 日志, 训练得到的模型文件. ": "Etapa 1: Preencha a configuração experimental. Os dados experimentais são armazenados na pasta 'logs', com cada experimento tendo uma pasta separada. Digite manualmente o caminho do nome do experimento, que contém a configuração experimental, os logs e os arquivos de modelo treinados.",
"step1:正在处理数据": "Etapa 1: Processamento de dados",
"step2:正在提取音高&正在提取特征": "step2:正在提取音高&正在提取特征",
"step2a: 自动遍历训练文件夹下所有可解码成音频的文件并进行切片归一化, 在实验目录下生成2个wav文件夹; 暂时只支持单人训练. ": "Etapa 2a: Percorra automaticamente todos os arquivos na pasta de treinamento que podem ser decodificados em áudio e execute a normalização da fatia. Gera 2 pastas wav no diretório do experimento. Atualmente, apenas o treinamento de um único cantor/palestrante é suportado.",
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)": "Etapa 2b: Use a CPU para extrair o tom (se o modelo tiver tom), use a GPU para extrair recursos (selecione o índice da GPU):",
"step3: 填写训练设置, 开始训练模型和索引": "Etapa 3: Preencha as configurações de treinamento e comece a treinar o modelo e o Index",
"step3a:正在训练模型": "Etapa 3a: Treinamento do modelo iniciado",
"一键训练": "Treinamento com um clique",
"也可批量输入音频文件, 二选一, 优先读文件夹": "Você também pode inserir arquivos de áudio em lotes. Escolha uma das duas opções. É dada prioridade à leitura da pasta.",
"人声伴奏分离批量处理, 使用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。": "Processamento em lote para separação de acompanhamento vocal usando o modelo UVR5.<br>Exemplo de um formato de caminho de pasta válido: D:\\caminho\\para a pasta\\entrada\\ (copie-o da barra de endereços do gerenciador de arquivos).<br>O modelo é dividido em três categorias:<br>1. Preservar vocais: Escolha esta opção para áudio sem harmonias. Ele preserva os vocais melhor do que o HP5. Inclui dois modelos integrados: HP2 e HP3. O HP3 pode vazar ligeiramente o acompanhamento, mas preserva os vocais um pouco melhor do que o HP2.<br>2 Preservar apenas os vocais principais: Escolha esta opção para áudio com harmonias. Isso pode enfraquecer os vocais principais. Ele inclui um modelo embutido: HP5.<br>3. Modelos de de-reverb e de-delay (por FoxJoy):<br>(1) MDX-Net: A melhor escolha para remoção de reverb estéreo, mas não pode remover reverb mono;<br>&emsp;(234) DeEcho: Remove efeitos de atraso. O modo agressivo remove mais completamente do que o modo normal. O DeReverb também remove reverb e pode remover reverb mono, mas não de forma muito eficaz para conteúdo de alta frequência fortemente reverberado.<br>Notas de de-reverb/de-delay:<br>1. O tempo de processamento para o modelo DeEcho-DeReverb é aproximadamente duas vezes maior que os outros dois modelos DeEcho.<br>2 O modelo MDX-Net-Dereverb é bastante lento.<br>3. A configuração mais limpa recomendada é aplicar MDX-Net primeiro e depois DeEcho-Aggressive.",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Digite o (s) índice(s) da GPU separados por '-', por exemplo, 0-1-2 para usar a GPU 0, 1 e 2:",
"伴奏人声分离&去混响&去回声": "UVR5",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Salvar nome",
"保存的文件名, 默认空为和源文件同名": "Salvar nome do arquivo (padrão: igual ao arquivo de origem):",
"保存的模型名不带后缀": "Nome do modelo salvo (sem extensão):",
"保存频率save_every_epoch": "Faça backup a cada # de Epoch:",
"保护清辅音和呼吸声防止电音撕裂等artifact拉满0.5不开启,调低加大保护力度但可能降低索引效果": "Proteja consoantes sem voz e sons respiratórios, evite artefatos como quebra de som eletrônico e desligue-o quando estiver cheio de 0,5. Diminua-o para aumentar a proteção, mas pode reduzir o efeito de indexação:",
"修改": "Editar",
"修改模型信息(仅支持weights文件夹下提取的小模型文件)": "Modificar informações do modelo (suportado apenas para arquivos de modelo pequenos extraídos da pasta 'weights')",
"停止音频转换": "Conversão de áudio",
"全流程结束!": "Todos os processos foram concluídos!",
"刷新音色列表和索引路径": "Atualizar lista de voz e caminho do Index",
"加载模型": "Modelo",
"加载预训练底模D路径": "Carregue o caminho D do modelo base pré-treinado:",
"加载预训练底模G路径": "Carregue o caminho G do modelo base pré-treinado:",
"单次推理": "Único",
"卸载音色省显存": "Descarregue a voz para liberar a memória da GPU:",
"变调(整数, 半音数量, 升八度12降八度-12)": "Mude o tom aqui. Se a voz for do mesmo sexo, não é necessario alterar (12 caso seja Masculino para feminino, -12 caso seja ao contrário).",
"后处理重采样至最终采样率0为不进行重采样": "Reamostragem pós-processamento para a taxa de amostragem final, 0 significa sem reamostragem:",
"否": "Não",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Limiar de resposta",
"响度因子": "Fator de volume",
"处理数据": "Processar o Conjunto de Dados",
"导出Onnx模型": "Exportar Modelo Onnx",
"导出文件格式": "Qual formato de arquivo você prefere?",
"常见问题解答": "FAQ (Perguntas frequentes)",
"常规设置": "Configurações gerais",
"开始音频转换": "Iniciar conversão de áudio",
"很遗憾您这没有能用的显卡来支持您训练": "Infelizmente, não há GPU compatível disponível para apoiar o seu treinamento.",
"性能设置": "Configurações de desempenho.",
"总训练轮数total_epoch": "Número total de ciclos(epoch) de treino (se escolher um valor alto demais, o seu modelo parecerá terrivelmente sobretreinado):",
"批量推理": "Conversão em Lote",
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ": "Conversão em Massa.",
"指定输出主人声文件夹": "Especifique a pasta de saída para vocais:",
"指定输出文件夹": "Especifique a pasta de saída:",
"指定输出非主人声文件夹": "Informar a pasta de saída para acompanhamento:",
"推理时间(ms):": "Tempo de inferência (ms):",
"推理音色": "Escolha o seu Modelo:",
"提取": "Extrato",
"提取音高和处理数据使用的CPU进程数": "Número de processos de CPU usados para extração de tom e processamento de dados:",
"是": "Sim",
"是否仅保存最新的ckpt文件以节省硬盘空间": "Só deve salvar apenas o arquivo ckpt mais recente para economizar espaço em disco:",
"是否在每次保存时间点将最终小模型保存至weights文件夹": "Salve um pequeno modelo final na pasta 'weights' em cada ponto de salvamento:",
"是否缓存所有训练集至显存. 10min以下小数据可缓存以加速训练, 大数据缓存会炸显存也加不了多少速": "Se deve armazenar em cache todos os conjuntos de treinamento na memória de vídeo. Pequenos dados com menos de 10 minutos podem ser armazenados em cache para acelerar o treinamento, e um cache de dados grande irá explodir a memória de vídeo e não aumentar muito a velocidade:",
"显卡信息": "Informações da GPU",
"本软件以MIT协议开源, 作者不对软件具备任何控制力, 使用软件者、传播软件导出的声音者自负全责. <br>如不认可该条款, 则不能使用或引用软件包内任何代码和文件. 详见根目录<b>LICENSE</b>.": "<center>The Mangio-RVC 💻 | Tradução por Krisp e Rafael Godoy Ebert | AI HUB BRASIL<br> Este software é de código aberto sob a licença MIT. O autor não tem qualquer controle sobre o software. Aqueles que usam o software e divulgam os sons exportados pelo software são totalmente responsáveis. <br>Se você não concorda com este termo, você não pode usar ou citar nenhum código e arquivo no pacote de software. Para obter detalhes, consulte o diretório raiz <b>O acordo a ser seguido para uso <a href='https://raw.githubusercontent.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/main/LICENSE' target='_blank'>LICENSE</a></b></center>",
"查看": "Visualizar",
"查看模型信息(仅支持weights文件夹下提取的小模型文件)": "Exibir informações do modelo (suportado apenas para arquivos de modelo pequenos extraídos da pasta 'weights')",
"检索特征占比": "Taxa de recurso de recuperação:",
"模型": "Modelo",
"模型推理": "Inference",
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况": "Extração do modelo (insira o caminho do modelo de arquivo grande na pasta 'logs'). Isso é útil se você quiser interromper o treinamento no meio do caminho e extrair e salvar manualmente um arquivo de modelo pequeno, ou se quiser testar um modelo intermediário:",
"模型是否带音高指导": "Se o modelo tem orientação de tom:",
"模型是否带音高指导(唱歌一定要, 语音可以不要)": "Se o modelo tem orientação de tom (necessário para cantar, opcional para fala):",
"模型是否带音高指导,1是0否": "Se o modelo tem orientação de passo (1: sim, 0: não):",
"模型版本型号": "Versão:",
"模型融合, 可用于测试音色融合": "A fusão modelo, pode ser usada para testar a fusão do timbre",
"模型路径": "Caminho para o Modelo:",
"每张显卡的batch_size": "Batch Size (DEIXE COMO ESTÁ a menos que saiba o que está fazendo, no Colab pode deixar até 20!):",
"淡入淡出长度": "Comprimento de desvanecimento",
"版本": "Versão",
"特征提取": "Extrair Tom",
"特征检索库文件路径,为空则使用下拉的选择结果": "Caminho para o arquivo de Index. Deixe em branco para usar o resultado selecionado no menu debaixo:",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Recomendado +12 chave para conversão de homem para mulher e -12 chave para conversão de mulher para homem. Se a faixa de som for muito longe e a voz estiver distorcida, você também pode ajustá-la à faixa apropriada por conta própria.",
"目标采样率": "Taxa de amostragem:",
"算法延迟(ms):": "Atrasos algorítmicos (ms):",
"自动检测index路径,下拉式选择(dropdown)": "Detecte automaticamente o caminho do Index e selecione no menu suspenso:",
"融合": "Fusão",
"要改的模型信息": "Informações do modelo a ser modificado:",
"要置入的模型信息": "Informações do modelo a ser colocado:",
"训练": "Treinar",
"训练模型": "Treinar Modelo",
"训练特征索引": "Treinar Index",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Após o término do treinamento, você pode verificar o log de treinamento do console ou train.log na pasta de experimentos",
"设备类型": "设备类型",
"请指定说话人id": "Especifique o ID do locutor/cantor:",
"请选择index文件": "Selecione o arquivo de Index",
"请选择pth文件": "Selecione o arquivo pth",
"请选择说话人id": "Selecione Palestrantes/Cantores ID:",
"转换": "Converter",
"输入实验名": "Nome da voz:",
"输入待处理音频文件夹路径": "Caminho da pasta de áudio a ser processada:",
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)": "Caminho da pasta de áudio a ser processada (copie-o da barra de endereços do gerenciador de arquivos):",
"输入待处理音频文件路径(默认是正确格式示例)": "Caminho para o seu conjunto de dados (áudios, não zipado):",
"输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络": "O envelope de volume da fonte de entrada substitui a taxa de fusão do envelope de volume de saída, quanto mais próximo de 1, mais o envelope de saída é usado:",
"输入监听": "Monitoramento de entrada",
"输入训练文件夹路径": "Caminho da pasta de treinamento:",
"输入设备": "Dispositivo de entrada",
"输入降噪": "Redução de ruído de entrada",
"输出信息": "Informação de saída",
"输出变声": "Mudança de voz de saída",
"输出设备": "Dispositivo de saída",
"输出降噪": "Redução de ruído de saída",
"输出音频(右下角三个点,点了可以下载)": "Exportar áudio (clique nos três pontos no canto inferior direito para baixar)",
"选择.index文件": "Selecione o Index",
"选择.pth文件": "Selecione o Arquivo",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Selecione o algoritmo de extração de tom \n'pm': extração mais rápida, mas discurso de qualidade inferior; \n'harvest': graves melhores, mas extremamente lentos; \n'harvest': melhor qualidade, mas extração mais lenta); 'crepe': melhor qualidade, mas intensivo em GPU; 'magio-crepe': melhor opção; 'RMVPE': um modelo robusto para estimativa de afinação vocal em música polifônica;",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "Selecione o algoritmo de extração de tom \n'pm': extração mais rápida, mas discurso de qualidade inferior; \n'harvest': graves melhores, mas extremamente lentos; \n'crepe': melhor qualidade (mas intensivo em GPU);\n rmvpe tem o melhor efeito e consome menos CPU/GPU.",
"采样率:": "采样率:",
"采样长度": "Comprimento da Amostra",
"重载设备列表": "Recarregar lista de dispositivos",
"音调设置": "Configurações de tom",
"音频设备": "音频设备",
"音高算法": "Algoritmo de detecção de pitch",
"额外推理时长": "Tempo extra de inferência"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "Весы (w) модели А:",
"A模型路径": "Путь к модели А:",
"B模型路径": "Путь к модели Б:",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "Файл дуги F0 (не обязательно). Одна тональность на каждую строчку. Заменяет обычный F0 и модуляцию тональности:",
"Index Rate": "Темп индекса",
"Onnx导出": "Экспорт ONNX",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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. Модели удаления реверберации и задержки (от FoxJoy):<br>(1) MDX-Net: лучший выбор для удаления стереореверберации, но он не может удалить монореверберацию;<br>&emsp;(234) DeEcho: удаляет эффекты задержки. Агрессивный режим удаляет более тщательно, чем Нормальный режим. DeReverb дополнительно удаляет реверберацию и может удалять монореверберацию, но не очень эффективно для сильно реверберированного высокочастотного контента.<br>Примечания по удалению реверберации/задержки:<br>1. Время обработки для модели DeEcho-DeReverb примерно в два раза больше, чем для двух других моделей DeEcho.<br>2. Модель MDX-Net-Dereverb довольно медленная.<br>3. Рекомендуемая самая чистая конфигурация — сначала применить MDX-Net, а затем DeEcho-Aggressive.",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "Введите, какие(-ую) GPU(-у) хотите использовать через '-', например 0-1-2, чтобы использовать GPU с номерами 0, 1 и 2:",
"伴奏人声分离&去混响&去回声": "Разделение вокала/аккомпанемента и удаление эхо",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Имя файла для сохранения:",
"保存的文件名, 默认空为和源文件同名": "Название сохранённого файла (по умолчанию: такое же, как и у входного):",
"保存的模型名不带后缀": "Имя файла модели для сохранения (без расширения):",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "Изменить высоту голоса (укажите количество полутонов; чтобы поднять голос на октаву, выберите 12, понизить на октаву — -12):",
"后处理重采样至最终采样率0为不进行重采样": "Изменить частоту дискретизации в выходном файле на финальную. Поставьте 0, чтобы ничего не изменялось:",
"否": "Нет",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Порог ответа",
"响度因子": "коэффициент громкости",
"处理数据": "Обработать данные",
@ -86,6 +90,7 @@
"版本": "Версия архитектуры модели:",
"特征提取": "Извлечь черты",
"特征检索库文件路径,为空则使用下拉的选择结果": "Путь к файлу индекса черт. Оставьте пустым, чтобы использовать выбранный вариант из списка ниже:",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Рекомендуется выбрать +12 для конвертирования мужского голоса в женский и -12 для конвертирования женского в мужской. Если диапазон голоса слишком велик, и голос искажается, можно выбрать значение на свой вкус.",
"目标采样率": "Частота дискретизации аудио:",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "Обучить модель",
"训练特征索引": "Обучить индекс черт",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Обучение модели завершено. Журнал обучения можно просмотреть в консоли или в файле 'train.log' в папке с моделью.",
"设备类型": "设备类型",
"请指定说话人id": "Номер говорящего/поющего:",
"请选择index文件": "Пожалуйста, выберите файл индекса",
"请选择pth文件": "Пожалуйста, выберите файл pth",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Выберите алгоритм оценки высоты голоса ('pm': работает быстро, но даёт низкое качество речи; 'harvest': басы лучше, но работает очень медленно; 'crepe': лучшее качество, но сильно нагружает GPU; 'rmvpe': лучшее качество и минимальная нагрузка на GPU):",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "Длина сэмпла",
"重载设备列表": "Обновить список устройств",
"音调设置": "Настройка высоты звука",
"音频设备(请使用同种类驱动)": "Аудиоустройство (пожалуйста, используйте такой же тип драйвера)",
"音频设备": "Аудиоустройство",
"音高算法": "Алгоритм оценки высоты звука",
"额外推理时长": "Доп. время переработки"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "A Modeli Ağırlığı:",
"A模型路径": "A Modeli Yolu:",
"B模型路径": "B Modeli Yolu:",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0 eğrisi dosyası (isteğe bağlı). Her satırda bir pitch değeri bulunur. Varsayılan F0 ve pitch modülasyonunu değiştirir:",
"Index Rate": "Index Oranı",
"Onnx导出": "Onnx Dışa Aktar",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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 işleme kullanarak vokal eşlik ayrımı için UVR5 modeli kullanılır.<br>Geçerli bir klasör yol formatı örneği: D:\\path\\to\\input\\folder (dosya yöneticisi adres çubuğundan kopyalanır).<br>Model üç kategoriye ayrılır:<br>1. Vokalleri koru: Bu seçeneği, harmoni içermeyen sesler için kullanın. HP5'ten daha iyi bir şekilde vokalleri korur. İki dahili model içerir: HP2 ve HP3. HP3, eşlik sesini hafifçe sızdırabilir, ancak vokalleri HP2'den biraz daha iyi korur.<br>2. Sadece ana vokalleri koru: Bu seçeneği, harmoni içeren sesler için kullanın. Ana vokalleri zayıflatabilir. Bir dahili model içerir: HP5.<br>3. Reverb ve gecikme modelleri (FoxJoy tarafından):<br>(1) MDX-Net: Stereo reverb'i kaldırmak için en iyi seçenek, ancak mono reverb'i kaldıramaz;<br>(234) DeEcho: Gecikme efektlerini kaldırır. Agresif mod, Normal moda göre daha kapsamlı bir şekilde kaldırma yapar. DeReverb ayrıca reverb'i kaldırır ve mono reverb'i kaldırabilir, ancak yoğun yankılı yüksek frekanslı içerikler için çok etkili değildir.<br>Reverb/gecikme notları:<br>1. DeEcho-DeReverb modelinin işleme süresi diğer iki DeEcho modeline göre yaklaşık olarak iki kat daha uzundur.<br>2. MDX-Net-Dereverb modeli oldukça yavaştır.<br>3. Tavsiye edilen en temiz yapılandırma önce MDX-Net'i uygulamak ve ardından DeEcho-Aggressive uygulamaktır.",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "GPU indekslerini '-' ile ayırarak girin, örneğin 0-1-2, GPU 0, 1 ve 2'yi kullanmak için:",
"伴奏人声分离&去混响&去回声": "Vokal/Müzik Ayrıştırma ve Yankı Giderme",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "Kaydetme Adı:",
"保存的文件名, 默认空为和源文件同名": "Kaydedilecek dosya adı (varsayılan: kaynak dosya ile aynı):",
"保存的模型名不带后缀": "Kaydedilecek model adı (uzantı olmadan):",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "Transpoze et (tamsayı, yarıton sayısıyla; bir oktav yükseltmek için: 12, bir oktav düşürmek için: -12):",
"后处理重采样至最终采样率0为不进行重采样": "Son işleme aşamasında çıktı sesini son örnekleme hızına yeniden örnekle. 0 değeri için yeniden örnekleme yapılmaz:",
"否": "Hayır",
"启用相位声码器": "启用相位声码器",
"响应阈值": "Tepki eşiği",
"响度因子": "ses yüksekliği faktörü",
"处理数据": "Verileri işle",
@ -86,6 +90,7 @@
"版本": "Sürüm",
"特征提取": "Özellik çıkartma",
"特征检索库文件路径,为空则使用下拉的选择结果": "Özellik indeksi dosyasının yolunu belirtin. Seçilen sonucu kullanmak için boş bırakın veya açılır menüden seçim yapın.",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "Erkekten kadına çevirmek için +12 tuş önerilir, kadından erkeğe çevirmek için ise -12 tuş önerilir. Eğer ses aralığı çok fazla genişler ve ses bozulursa, isteğe bağlı olarak uygun aralığa kendiniz de ayarlayabilirsiniz.",
"目标采样率": "Hedef örnekleme oranı:",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "Modeli Eğit",
"训练特征索引": "Özellik Dizinini Eğit",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "Eğitim tamamlandı. Eğitim günlüklerini konsolda veya deney klasörü altındaki train.log dosyasında kontrol edebilirsiniz.",
"设备类型": "设备类型",
"请指定说话人id": "Lütfen konuşmacı/sanatçı no belirtin:",
"请选择index文件": "Lütfen .index dosyası seçin",
"请选择pth文件": "Lütfen .pth dosyası seçin",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "Pitch algoritmasını seçin ('pm': daha hızlı çıkarır ancak daha düşük kaliteli konuşma; 'harvest': daha iyi konuşma sesi ancak son derece yavaş; 'crepe': daha da iyi kalite ancak GPU yoğunluğu gerektirir):",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "Örnekleme uzunluğu",
"重载设备列表": "Cihaz listesini yeniden yükle",
"音调设置": "Pitch ayarları",
"音频设备(请使用同种类驱动)": "Ses cihazı (aynı tür sürücüyü kullanın)",
"音频设备": "Ses cihazı",
"音高算法": "音高算法",
"额外推理时长": "Ekstra çıkartma süresi"
}

View File

@ -3,8 +3,9 @@
"A模型权重": "A模型权重",
"A模型路径": "A模型路径",
"B模型路径": "B模型路径",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调",
"Index Rate": "Index Rate",
"Index Rate": "检索特征占比",
"Onnx导出": "Onnx导出",
"Onnx输出路径": "Onnx输出路径",
"RVC模型路径": "RVC模型路径",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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模型的耗时是另外2个DeEcho模型的接近2倍<br>2、MDX-Net-Dereverb模型挺慢的<br>3、个人推荐的最干净的配置是先MDX-Net再DeEcho-Aggressive。",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2",
"伴奏人声分离&去混响&去回声": "伴奏人声分离&去混响&去回声",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "保存名",
"保存的文件名, 默认空为和源文件同名": "保存的文件名, 默认空为和源文件同名",
"保存的模型名不带后缀": "保存的模型名不带后缀",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "变调(整数, 半音数量, 升八度12降八度-12)",
"后处理重采样至最终采样率0为不进行重采样": "后处理重采样至最终采样率0为不进行重采样",
"否": "否",
"启用相位声码器": "启用相位声码器",
"响应阈值": "响应阈值",
"响度因子": "响度因子",
"处理数据": "处理数据",
@ -86,6 +90,7 @@
"版本": "版本",
"特征提取": "特征提取",
"特征检索库文件路径,为空则使用下拉的选择结果": "特征检索库文件路径,为空则使用下拉的选择结果",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ",
"目标采样率": "目标采样率",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "训练模型",
"训练特征索引": "训练特征索引",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"设备类型": "设备类型",
"请指定说话人id": "请指定说话人id",
"请选择index文件": "请选择index文件",
"请选择pth文件": "请选择pth文件",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "采样长度",
"重载设备列表": "重载设备列表",
"音调设置": "音调设置",
"音频设备(请使用同种类驱动)": "音频设备(请使用同种类驱动)",
"音频设备": "音频设备",
"音高算法": "音高算法",
"额外推理时长": "额外推理时长"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "A模型權重",
"A模型路径": "A模型路徑",
"B模型路径": "B模型路徑",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案可選一行一個音高代替預設的F0及升降調",
"Index Rate": "Index Rate",
"Onnx导出": "Onnx导出",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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. 消除混響和延遲模型由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。",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
"伴奏人声分离&去混响&去回声": "伴奏人聲分離&去混響&去回聲",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "儲存名",
"保存的文件名, 默认空为和源文件同名": "儲存的檔案名,預設空為與來源檔案同名",
"保存的模型名不带后缀": "儲存的模型名不帶副檔名",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
"后处理重采样至最终采样率0为不进行重采样": "後處理重採樣至最終採樣率0為不進行重採樣",
"否": "否",
"启用相位声码器": "启用相位声码器",
"响应阈值": "響應閾值",
"响度因子": "響度因子",
"处理数据": "處理資料",
@ -86,6 +90,7 @@
"版本": "版本",
"特征提取": "特徵提取",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key女性轉男性推薦-12key如果音域爆炸導致音色失真也可以自己調整到合適音域。",
"目标采样率": "目標取樣率",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "訓練模型",
"训练特征索引": "訓練特徵索引",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"设备类型": "设备类型",
"请指定说话人id": "請指定說話人id",
"请选择index文件": "请选择index文件",
"请选择pth文件": "请选择pth文件",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "選擇音高提取演算法,輸入歌聲可用pm提速,harvest低音好但巨慢無比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "取樣長度",
"重载设备列表": "重載設備列表",
"音调设置": "音調設定",
"音频设备(请使用同种类驱动)": "音訊設備 (請使用同種類驅動)",
"音频设备": "音訊設備",
"音高算法": "音高演算法",
"额外推理时长": "額外推理時長"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "A模型權重",
"A模型路径": "A模型路徑",
"B模型路径": "B模型路徑",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案可選一行一個音高代替預設的F0及升降調",
"Index Rate": "Index Rate",
"Onnx导出": "Onnx导出",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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. 消除混響和延遲模型由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。",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
"伴奏人声分离&去混响&去回声": "伴奏人聲分離&去混響&去回聲",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "儲存名",
"保存的文件名, 默认空为和源文件同名": "儲存的檔案名,預設空為與來源檔案同名",
"保存的模型名不带后缀": "儲存的模型名不帶副檔名",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
"后处理重采样至最终采样率0为不进行重采样": "後處理重採樣至最終採樣率0為不進行重採樣",
"否": "否",
"启用相位声码器": "启用相位声码器",
"响应阈值": "響應閾值",
"响度因子": "響度因子",
"处理数据": "處理資料",
@ -86,6 +90,7 @@
"版本": "版本",
"特征提取": "特徵提取",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key女性轉男性推薦-12key如果音域爆炸導致音色失真也可以自己調整到合適音域。",
"目标采样率": "目標取樣率",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "訓練模型",
"训练特征索引": "訓練特徵索引",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"设备类型": "设备类型",
"请指定说话人id": "請指定說話人id",
"请选择index文件": "请选择index文件",
"请选择pth文件": "请选择pth文件",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "選擇音高提取演算法,輸入歌聲可用pm提速,harvest低音好但巨慢無比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "取樣長度",
"重载设备列表": "重載設備列表",
"音调设置": "音調設定",
"音频设备(请使用同种类驱动)": "音訊設備 (請使用同種類驅動)",
"音频设备": "音訊設備",
"音高算法": "音高演算法",
"额外推理时长": "額外推理時長"
}

View File

@ -3,6 +3,7 @@
"A模型权重": "A模型權重",
"A模型路径": "A模型路徑",
"B模型路径": "B模型路徑",
"E:\\语音音频+标注\\米津玄师\\src": "E:\\语音音频+标注\\米津玄师\\src",
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调": "F0曲線檔案可選一行一個音高代替預設的F0及升降調",
"Index Rate": "Index Rate",
"Onnx导出": "Onnx导出",
@ -25,6 +26,8 @@
"人声伴奏分离批量处理, 使用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. 消除混響和延遲模型由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。",
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2": "以-分隔輸入使用的卡號, 例如 0-1-2 使用卡0和卡1和卡2",
"伴奏人声分离&去混响&去回声": "伴奏人聲分離&去混響&去回聲",
"使用模型采样率": "使用模型采样率",
"使用设备采样率": "使用设备采样率",
"保存名": "儲存名",
"保存的文件名, 默认空为和源文件同名": "儲存的檔案名,預設空為與來源檔案同名",
"保存的模型名不带后缀": "儲存的模型名不帶副檔名",
@ -43,6 +46,7 @@
"变调(整数, 半音数量, 升八度12降八度-12)": "變調(整數、半音數量、升八度12降八度-12)",
"后处理重采样至最终采样率0为不进行重采样": "後處理重採樣至最終採樣率0為不進行重採樣",
"否": "否",
"启用相位声码器": "启用相位声码器",
"响应阈值": "響應閾值",
"响度因子": "響度因子",
"处理数据": "處理資料",
@ -86,6 +90,7 @@
"版本": "版本",
"特征提取": "特徵提取",
"特征检索库文件路径,为空则使用下拉的选择结果": "特徵檢索庫檔路徑,為空則使用下拉的選擇結果",
"独占 WASAPI 设备": "独占 WASAPI 设备",
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ": "男性轉女性推薦+12key女性轉男性推薦-12key如果音域爆炸導致音色失真也可以自己調整到合適音域。",
"目标采样率": "目標取樣率",
"算法延迟(ms):": "算法延迟(ms):",
@ -97,6 +102,7 @@
"训练模型": "訓練模型",
"训练特征索引": "訓練特徵索引",
"训练结束, 您可查看控制台训练日志或实验文件夹下的train.log": "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log",
"设备类型": "设备类型",
"请指定说话人id": "請指定說話人id",
"请选择index文件": "请选择index文件",
"请选择pth文件": "请选择pth文件",
@ -121,10 +127,11 @@
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU": "选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU",
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU": "選擇音高提取演算法,輸入歌聲可用pm提速,harvest低音好但巨慢無比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU",
"选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU": "选择音高提取算法:输入歌声可用pm提速,高质量语音但CPU差可用dio提速,harvest质量更好但慢,rmvpe效果最好且微吃CPU/GPU",
"采样率:": "采样率:",
"采样长度": "取樣長度",
"重载设备列表": "重載設備列表",
"音调设置": "音調設定",
"音频设备(请使用同种类驱动)": "音訊設備 (請使用同種類驅動)",
"音频设备": "音訊設備",
"音高算法": "音高演算法",
"额外推理时长": "額外推理時長"
}

View File

@ -1,8 +1,10 @@
import os
import sys
from dotenv import load_dotenv
now_dir = os.getcwd()
sys.path.append(now_dir)
load_dotenv()
from infer.modules.vc.modules import VC
from infer.modules.uvr5.modules import uvr
from infer.lib.train.process_ckpt import (
@ -14,18 +16,7 @@ from infer.lib.train.process_ckpt import (
from i18n.i18n import I18nAuto
from configs.config import Config
from sklearn.cluster import MiniBatchKMeans
from dotenv import load_dotenv
import torch
try:
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
if torch.xpu.is_available():
from infer.modules.ipex import ipex_init
ipex_init()
except Exception: # pylint: disable=broad-exception-caught
pass
import torch, platform
import numpy as np
import gradio as gr
import faiss
@ -43,6 +34,7 @@ import logging
logging.getLogger("numba").setLevel(logging.WARNING)
logging.getLogger("httpx").setLevel(logging.WARNING)
logger = logging.getLogger(__name__)
@ -58,7 +50,6 @@ warnings.filterwarnings("ignore")
torch.manual_seed(114514)
load_dotenv()
config = Config()
vc = VC(config)
@ -103,6 +94,9 @@ if torch.cuda.is_available() or ngpu != 0:
"M4",
"T4",
"TITAN",
"4060",
"L",
"6000",
]
):
# A10#A100#V100#A40#P40#M40#K80#A4500
@ -139,16 +133,25 @@ class ToolButton(gr.Button, gr.components.FormComponent):
weight_root = os.getenv("weight_root")
weight_uvr5_root = os.getenv("weight_uvr5_root")
index_root = os.getenv("index_root")
outside_index_root = os.getenv("outside_index_root")
names = []
for name in os.listdir(weight_root):
if name.endswith(".pth"):
names.append(name)
index_paths = []
for root, dirs, files in os.walk(index_root, topdown=False):
for name in files:
if name.endswith(".index") and "trained" not in name:
index_paths.append("%s/%s" % (root, name))
def lookup_indices(index_root):
global index_paths
for root, dirs, files in os.walk(index_root, topdown=False):
for name in files:
if name.endswith(".index") and "trained" not in name:
index_paths.append("%s/%s" % (root, name))
lookup_indices(index_root)
lookup_indices(outside_index_root)
uvr5_names = []
for name in os.listdir(weight_uvr5_root):
if name.endswith(".pth") or "onnx" in name:
@ -217,7 +220,6 @@ def preprocess_dataset(trainset_dir, exp_dir, sr, n_p):
os.makedirs("%s/logs/%s" % (now_dir, exp_dir), exist_ok=True)
f = open("%s/logs/%s/preprocess.log" % (now_dir, exp_dir), "w")
f.close()
per = 3.0 if config.is_half else 3.7
cmd = '"%s" infer/modules/train/preprocess.py "%s" %s %s "%s/logs/%s" %s %.1f' % (
config.python_cmd,
trainset_dir,
@ -226,9 +228,9 @@ def preprocess_dataset(trainset_dir, exp_dir, sr, n_p):
now_dir,
exp_dir,
config.noparallel,
per,
config.preprocess_per,
)
logger.info(cmd)
logger.info("Execute: " + cmd)
# , stdin=PIPE, stdout=PIPE,stderr=PIPE,cwd=now_dir
p = Popen(cmd, shell=True)
# 煞笔gr, popen read都非得全跑完了再一次性读取, 不用gr就正常读一句输出一句;只能额外弄出一个文本流定时读
@ -270,7 +272,7 @@ def extract_f0_feature(gpus, n_p, f0method, if_f0, exp_dir, version19, gpus_rmvp
f0method,
)
)
logger.info(cmd)
logger.info("Execute: " + cmd)
p = Popen(
cmd, shell=True, cwd=now_dir
) # , stdin=PIPE, stdout=PIPE,stderr=PIPE
@ -301,7 +303,7 @@ def extract_f0_feature(gpus, n_p, f0method, if_f0, exp_dir, version19, gpus_rmvp
config.is_half,
)
)
logger.info(cmd)
logger.info("Execute: " + cmd)
p = Popen(
cmd, shell=True, cwd=now_dir
) # , shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=now_dir
@ -324,7 +326,7 @@ def extract_f0_feature(gpus, n_p, f0method, if_f0, exp_dir, version19, gpus_rmvp
exp_dir,
)
)
logger.info(cmd)
logger.info("Execute: " + cmd)
p = Popen(
cmd, shell=True, cwd=now_dir
) # , shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=now_dir
@ -354,7 +356,7 @@ def extract_f0_feature(gpus, n_p, f0method, if_f0, exp_dir, version19, gpus_rmvp
ps = []
for idx, n_g in enumerate(gpus):
cmd = (
'"%s" infer/modules/train/extract_feature_print.py %s %s %s %s "%s/logs/%s" %s'
'"%s" infer/modules/train/extract_feature_print.py %s %s %s %s "%s/logs/%s" %s %s'
% (
config.python_cmd,
config.device,
@ -364,9 +366,10 @@ def extract_f0_feature(gpus, n_p, f0method, if_f0, exp_dir, version19, gpus_rmvp
now_dir,
exp_dir,
version19,
config.is_half,
)
)
logger.info(cmd)
logger.info("Execute: " + cmd)
p = Popen(
cmd, shell=True, cwd=now_dir
) # , shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=now_dir
@ -414,12 +417,16 @@ def get_pretrained_models(path_str, f0_str, sr2):
sr2,
)
return (
"assets/pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2)
if if_pretrained_generator_exist
else "",
"assets/pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
if if_pretrained_discriminator_exist
else "",
(
"assets/pretrained%s/%sG%s.pth" % (path_str, f0_str, sr2)
if if_pretrained_generator_exist
else ""
),
(
"assets/pretrained%s/%sD%s.pth" % (path_str, f0_str, sr2)
if if_pretrained_discriminator_exist
else ""
),
)
@ -449,7 +456,8 @@ def change_f0(if_f0_3, sr2, version19): # f0method8,pretrained_G14,pretrained_D
path_str = "" if version19 == "v1" else "_v2"
return (
{"visible": if_f0_3, "__type__": "update"},
*get_pretrained_models(path_str, "f0", sr2),
{"visible": if_f0_3, "__type__": "update"},
*get_pretrained_models(path_str, "f0" if if_f0_3 == True else "", sr2),
)
@ -598,7 +606,7 @@ def click_train(
version19,
)
)
logger.info(cmd)
logger.info("Execute: " + cmd)
p = Popen(cmd, shell=True, cwd=now_dir)
p.wait()
return "训练结束, 您可查看控制台训练日志或实验文件夹下的train.log"
@ -665,7 +673,6 @@ def train_index(exp_dir1, version19):
"%s/trained_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
)
infos.append("adding")
yield "\n".join(infos)
batch_size_add = 8192
@ -677,9 +684,28 @@ def train_index(exp_dir1, version19):
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
)
infos.append(
"成功构建索引added_IVF%s_Flat_nprobe_%s_%s_%s.index"
"成功构建索引 added_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (n_ivf, index_ivf.nprobe, exp_dir1, version19)
)
try:
link = os.link if platform.system() == "Windows" else os.symlink
link(
"%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
"%s/%s_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (
outside_index_root,
exp_dir1,
n_ivf,
index_ivf.nprobe,
exp_dir1,
version19,
),
)
infos.append("链接索引到外部-%s" % (outside_index_root))
except:
infos.append("链接索引到外部-%s失败" % (outside_index_root))
# faiss.write_index(index, '%s/added_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
# infos.append("成功构建索引added_IVF%s_Flat_FastScan_%s.index"%(n_ivf,version19))
yield "\n".join(infos)
@ -743,7 +769,9 @@ def train1key(
if_save_every_weights18,
version19,
)
yield get_info_str(i18n("训练结束, 您可查看控制台训练日志或实验文件夹下的train.log"))
yield get_info_str(
i18n("训练结束, 您可查看控制台训练日志或实验文件夹下的train.log")
)
# step3b:训练索引
[get_info_str(_) for _ in train_index(exp_dir1, version19)]
@ -790,7 +818,9 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.Row():
sid0 = gr.Dropdown(label=i18n("推理音色"), choices=sorted(names))
with gr.Column():
refresh_button = gr.Button(i18n("刷新音色列表和索引路径"), variant="primary")
refresh_button = gr.Button(
i18n("刷新音色列表和索引路径"), variant="primary"
)
clean_button = gr.Button(i18n("卸载音色省显存"), variant="primary")
spk_item = gr.Slider(
minimum=0,
@ -809,14 +839,19 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.Row():
with gr.Column():
vc_transform0 = gr.Number(
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"), value=0
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"),
value=0,
)
input_audio0 = gr.Textbox(
label=i18n("输入待处理音频文件路径(默认是正确格式示例)"),
label=i18n(
"输入待处理音频文件路径(默认是正确格式示例)"
),
placeholder="C:\\Users\\Desktop\\audio_example.wav",
)
file_index1 = gr.Textbox(
label=i18n("特征检索库文件路径,为空则使用下拉的选择结果"),
label=i18n(
"特征检索库文件路径,为空则使用下拉的选择结果"
),
placeholder="C:\\Users\\Desktop\\model_example.index",
interactive=True,
)
@ -829,9 +864,11 @@ with gr.Blocks(title="RVC WebUI") as app:
label=i18n(
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU"
),
choices=["pm", "harvest", "crepe", "rmvpe"]
if config.dml == False
else ["pm", "harvest", "rmvpe"],
choices=(
["pm", "harvest", "crepe", "rmvpe"]
if config.dml == False
else ["pm", "harvest", "rmvpe"]
),
value="rmvpe",
interactive=True,
)
@ -848,7 +885,9 @@ with gr.Blocks(title="RVC WebUI") as app:
rms_mix_rate0 = gr.Slider(
minimum=0,
maximum=1,
label=i18n("输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络"),
label=i18n(
"输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络"
),
value=0.25,
interactive=True,
)
@ -880,7 +919,9 @@ with gr.Blocks(title="RVC WebUI") as app:
interactive=True,
)
f0_file = gr.File(
label=i18n("F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调"),
label=i18n(
"F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调"
),
visible=False,
)
@ -900,7 +941,9 @@ with gr.Blocks(title="RVC WebUI") as app:
but0 = gr.Button(i18n("转换"), variant="primary")
with gr.Row():
vc_output1 = gr.Textbox(label=i18n("输出信息"))
vc_output2 = gr.Audio(label=i18n("输出音频(右下角三个点,点了可以下载)"))
vc_output2 = gr.Audio(
label=i18n("输出音频(右下角三个点,点了可以下载)")
)
but0.click(
vc.vc_single,
@ -924,14 +967,19 @@ with gr.Blocks(title="RVC WebUI") as app:
)
with gr.TabItem(i18n("批量推理")):
gr.Markdown(
value=i18n("批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. ")
value=i18n(
"批量转换, 输入待转换音频文件夹, 或上传多个音频文件, 在指定文件夹(默认opt)下输出转换的音频. "
)
)
with gr.Row():
with gr.Column():
vc_transform1 = gr.Number(
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"), value=0
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"),
value=0,
)
opt_input = gr.Textbox(
label=i18n("指定输出文件夹"), value="opt"
)
opt_input = gr.Textbox(label=i18n("指定输出文件夹"), value="opt")
file_index3 = gr.Textbox(
label=i18n("特征检索库文件路径,为空则使用下拉的选择结果"),
value="",
@ -946,9 +994,11 @@ with gr.Blocks(title="RVC WebUI") as app:
label=i18n(
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU"
),
choices=["pm", "harvest", "crepe", "rmvpe"]
if config.dml == False
else ["pm", "harvest", "rmvpe"],
choices=(
["pm", "harvest", "crepe", "rmvpe"]
if config.dml == False
else ["pm", "harvest", "rmvpe"]
),
value="rmvpe",
interactive=True,
)
@ -983,7 +1033,9 @@ with gr.Blocks(title="RVC WebUI") as app:
rms_mix_rate1 = gr.Slider(
minimum=0,
maximum=1,
label=i18n("输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络"),
label=i18n(
"输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络"
),
value=1,
interactive=True,
)
@ -1000,7 +1052,9 @@ with gr.Blocks(title="RVC WebUI") as app:
filter_radius1 = gr.Slider(
minimum=0,
maximum=7,
label=i18n(">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音"),
label=i18n(
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音"
),
value=3,
step=1,
interactive=True,
@ -1014,11 +1068,14 @@ with gr.Blocks(title="RVC WebUI") as app:
)
with gr.Row():
dir_input = gr.Textbox(
label=i18n("输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)"),
label=i18n(
"输入待处理音频文件夹路径(去文件管理器地址栏拷就行了)"
),
placeholder="C:\\Users\\Desktop\\input_vocal_dir",
)
inputs = gr.File(
file_count="multiple", label=i18n("也可批量输入音频文件, 二选一, 优先读文件夹")
file_count="multiple",
label=i18n("也可批量输入音频文件, 二选一, 优先读文件夹"),
)
with gr.Row():
@ -1067,10 +1124,13 @@ with gr.Blocks(title="RVC WebUI") as app:
placeholder="C:\\Users\\Desktop\\todo-songs",
)
wav_inputs = gr.File(
file_count="multiple", label=i18n("也可批量输入音频文件, 二选一, 优先读文件夹")
file_count="multiple",
label=i18n("也可批量输入音频文件, 二选一, 优先读文件夹"),
)
with gr.Column():
model_choose = gr.Dropdown(label=i18n("模型"), choices=uvr5_names)
model_choose = gr.Dropdown(
label=i18n("模型"), choices=uvr5_names
)
agg = gr.Slider(
minimum=0,
maximum=20,
@ -1151,7 +1211,8 @@ with gr.Blocks(title="RVC WebUI") as app:
)
with gr.Row():
trainset_dir4 = gr.Textbox(
label=i18n("输入训练文件夹路径"), value="E:\\语音音频+标注\\米津玄师\\src"
label=i18n("输入训练文件夹路径"),
value=i18n("E:\\语音音频+标注\\米津玄师\\src"),
)
spk_id5 = gr.Slider(
minimum=0,
@ -1170,11 +1231,17 @@ with gr.Blocks(title="RVC WebUI") as app:
api_name="train_preprocess",
)
with gr.Group():
gr.Markdown(value=i18n("step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)"))
gr.Markdown(
value=i18n(
"step2b: 使用CPU提取音高(如果模型带音高), 使用GPU提取特征(选择卡号)"
)
)
with gr.Row():
with gr.Column():
gpus6 = gr.Textbox(
label=i18n("以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2"),
label=i18n(
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2"
),
value=gpus,
interactive=True,
visible=F0GPUVisible,
@ -1262,7 +1329,9 @@ with gr.Blocks(title="RVC WebUI") as app:
interactive=True,
)
if_save_every_weights18 = gr.Radio(
label=i18n("是否在每次保存时间点将最终小模型保存至weights文件夹"),
label=i18n(
"是否在每次保存时间点将最终小模型保存至weights文件夹"
),
choices=[i18n(""), i18n("")],
value=i18n(""),
interactive=True,
@ -1291,10 +1360,12 @@ with gr.Blocks(title="RVC WebUI") as app:
if_f0_3.change(
change_f0,
[if_f0_3, sr2, version19],
[f0method8, pretrained_G14, pretrained_D15],
[f0method8, gpus_rmvpe, pretrained_G14, pretrained_D15],
)
gpus16 = gr.Textbox(
label=i18n("以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2"),
label=i18n(
"以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2"
),
value=gpus,
interactive=True,
)
@ -1354,8 +1425,12 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.Group():
gr.Markdown(value=i18n("模型融合, 可用于测试音色融合"))
with gr.Row():
ckpt_a = gr.Textbox(label=i18n("A模型路径"), value="", interactive=True)
ckpt_b = gr.Textbox(label=i18n("B模型路径"), value="", interactive=True)
ckpt_a = gr.Textbox(
label=i18n("A模型路径"), value="", interactive=True
)
ckpt_b = gr.Textbox(
label=i18n("B模型路径"), value="", interactive=True
)
alpha_a = gr.Slider(
minimum=0,
maximum=1,
@ -1377,7 +1452,10 @@ with gr.Blocks(title="RVC WebUI") as app:
interactive=True,
)
info__ = gr.Textbox(
label=i18n("要置入的模型信息"), value="", max_lines=8, interactive=True
label=i18n("要置入的模型信息"),
value="",
max_lines=8,
interactive=True,
)
name_to_save0 = gr.Textbox(
label=i18n("保存的模型名不带后缀"),
@ -1410,13 +1488,18 @@ with gr.Blocks(title="RVC WebUI") as app:
api_name="ckpt_merge",
) # def merge(path1,path2,alpha1,sr,f0,info):
with gr.Group():
gr.Markdown(value=i18n("修改模型信息(仅支持weights文件夹下提取的小模型文件)"))
gr.Markdown(
value=i18n("修改模型信息(仅支持weights文件夹下提取的小模型文件)")
)
with gr.Row():
ckpt_path0 = gr.Textbox(
label=i18n("模型路径"), value="", interactive=True
)
info_ = gr.Textbox(
label=i18n("要改的模型信息"), value="", max_lines=8, interactive=True
label=i18n("要改的模型信息"),
value="",
max_lines=8,
interactive=True,
)
name_to_save1 = gr.Textbox(
label=i18n("保存的文件名, 默认空为和源文件同名"),
@ -1434,7 +1517,9 @@ with gr.Blocks(title="RVC WebUI") as app:
api_name="ckpt_modify",
)
with gr.Group():
gr.Markdown(value=i18n("查看模型信息(仅支持weights文件夹下提取的小模型文件)"))
gr.Markdown(
value=i18n("查看模型信息(仅支持weights文件夹下提取的小模型文件)")
)
with gr.Row():
ckpt_path1 = gr.Textbox(
label=i18n("模型路径"), value="", interactive=True
@ -1476,7 +1561,10 @@ with gr.Blocks(title="RVC WebUI") as app:
interactive=True,
)
info___ = gr.Textbox(
label=i18n("要置入的模型信息"), value="", max_lines=8, interactive=True
label=i18n("要置入的模型信息"),
value="",
max_lines=8,
interactive=True,
)
but9 = gr.Button(i18n("提取"), variant="primary")
info7 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8)
@ -1492,7 +1580,9 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.TabItem(i18n("Onnx导出")):
with gr.Row():
ckpt_dir = gr.Textbox(label=i18n("RVC模型路径"), value="", interactive=True)
ckpt_dir = gr.Textbox(
label=i18n("RVC模型路径"), value="", interactive=True
)
with gr.Row():
onnx_dir = gr.Textbox(
label=i18n("Onnx输出路径"), value="", interactive=True

View File

@ -1,7 +1,10 @@
import librosa
import platform, os
import ffmpeg
import numpy as np
import av
from io import BytesIO
import traceback
import re
def wav2(i, o, format):
@ -27,40 +30,31 @@ def wav2(i, o, format):
inp.close()
def audio2(i, o, format, sr):
inp = av.open(i, "rb")
out = av.open(o, "wb", format=format)
if format == "ogg":
format = "libvorbis"
if format == "f32le":
format = "pcm_f32le"
ostream = out.add_stream(format, channels=1)
ostream.sample_rate = sr
for frame in inp.decode(audio=0):
for p in ostream.encode(frame):
out.mux(p)
out.close()
inp.close()
def load_audio(file, sr):
try:
file = (
file.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
) # 防止小白拷路径头尾带了空格和"和回车
with open(file, "rb") as f:
with BytesIO() as out:
audio2(f, out, "f32le", sr)
return np.frombuffer(out.getvalue(), np.float32).flatten()
except AttributeError:
audio = file[1] / 32768.0
if len(audio.shape) == 2:
audio = np.mean(audio, -1)
return librosa.resample(audio, orig_sr=file[0], target_sr=16000)
# https://github.com/openai/whisper/blob/main/whisper/audio.py#L26
# This launches a subprocess to decode audio while down-mixing and resampling as necessary.
# Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
file = clean_path(file) # 防止小白拷路径头尾带了空格和"和回车
if os.path.exists(file) == False:
raise RuntimeError(
"You input a wrong audio path that does not exists, please fix it!"
)
out, _ = (
ffmpeg.input(file, threads=0)
.output("-", format="f32le", acodec="pcm_f32le", ac=1, ar=sr)
.run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
)
except Exception as e:
traceback.print_exc()
raise RuntimeError(f"Failed to load audio: {e}")
return np.frombuffer(out, np.float32).flatten()
def clean_path(path_str):
if platform.system() == "Windows":
path_str = path_str.replace("/", "\\")
path_str = re.sub(r'[\u202a\u202b\u202c\u202d\u202e]', '', path_str) # 移除 Unicode 控制字符
return path_str.strip(" ").strip('"').strip("\n").strip('"').strip(" ")

View File

@ -0,0 +1,459 @@
############################## Warning! ##############################
# #
# Onnx Export Not Support All Of Non-Torch Types #
# Include Python Built-in Types!!!!!!!!!!!!!!!!! #
# If You Want TO Change This File #
# Do Not Use All Of Non-Torch Types! #
# #
############################## Warning! ##############################
import copy
import math
from typing import Optional
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from infer.lib.infer_pack import commons, modules
from infer.lib.infer_pack.modules import LayerNorm
class Encoder(nn.Module):
def __init__(
self,
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size=1,
p_dropout=0.0,
window_size=10,
**kwargs
):
super(Encoder, self).__init__()
self.hidden_channels = hidden_channels
self.filter_channels = filter_channels
self.n_heads = n_heads
self.n_layers = int(n_layers)
self.kernel_size = kernel_size
self.p_dropout = p_dropout
self.window_size = window_size
self.drop = nn.Dropout(p_dropout)
self.attn_layers = nn.ModuleList()
self.norm_layers_1 = nn.ModuleList()
self.ffn_layers = nn.ModuleList()
self.norm_layers_2 = nn.ModuleList()
for i in range(self.n_layers):
self.attn_layers.append(
MultiHeadAttention(
hidden_channels,
hidden_channels,
n_heads,
p_dropout=p_dropout,
window_size=window_size,
)
)
self.norm_layers_1.append(LayerNorm(hidden_channels))
self.ffn_layers.append(
FFN(
hidden_channels,
hidden_channels,
filter_channels,
kernel_size,
p_dropout=p_dropout,
)
)
self.norm_layers_2.append(LayerNorm(hidden_channels))
def forward(self, x, x_mask):
attn_mask = x_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
x = x * x_mask
zippep = zip(
self.attn_layers, self.norm_layers_1, self.ffn_layers, self.norm_layers_2
)
for attn_layers, norm_layers_1, ffn_layers, norm_layers_2 in zippep:
y = attn_layers(x, x, attn_mask)
y = self.drop(y)
x = norm_layers_1(x + y)
y = ffn_layers(x, x_mask)
y = self.drop(y)
x = norm_layers_2(x + y)
x = x * x_mask
return x
class Decoder(nn.Module):
def __init__(
self,
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size=1,
p_dropout=0.0,
proximal_bias=False,
proximal_init=True,
**kwargs
):
super(Decoder, self).__init__()
self.hidden_channels = hidden_channels
self.filter_channels = filter_channels
self.n_heads = n_heads
self.n_layers = n_layers
self.kernel_size = kernel_size
self.p_dropout = p_dropout
self.proximal_bias = proximal_bias
self.proximal_init = proximal_init
self.drop = nn.Dropout(p_dropout)
self.self_attn_layers = nn.ModuleList()
self.norm_layers_0 = nn.ModuleList()
self.encdec_attn_layers = nn.ModuleList()
self.norm_layers_1 = nn.ModuleList()
self.ffn_layers = nn.ModuleList()
self.norm_layers_2 = nn.ModuleList()
for i in range(self.n_layers):
self.self_attn_layers.append(
MultiHeadAttention(
hidden_channels,
hidden_channels,
n_heads,
p_dropout=p_dropout,
proximal_bias=proximal_bias,
proximal_init=proximal_init,
)
)
self.norm_layers_0.append(LayerNorm(hidden_channels))
self.encdec_attn_layers.append(
MultiHeadAttention(
hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout
)
)
self.norm_layers_1.append(LayerNorm(hidden_channels))
self.ffn_layers.append(
FFN(
hidden_channels,
hidden_channels,
filter_channels,
kernel_size,
p_dropout=p_dropout,
causal=True,
)
)
self.norm_layers_2.append(LayerNorm(hidden_channels))
def forward(self, x, x_mask, h, h_mask):
"""
x: decoder input
h: encoder output
"""
self_attn_mask = commons.subsequent_mask(x_mask.size(2)).to(
device=x.device, dtype=x.dtype
)
encdec_attn_mask = h_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
x = x * x_mask
for i in range(self.n_layers):
y = self.self_attn_layers[i](x, x, self_attn_mask)
y = self.drop(y)
x = self.norm_layers_0[i](x + y)
y = self.encdec_attn_layers[i](x, h, encdec_attn_mask)
y = self.drop(y)
x = self.norm_layers_1[i](x + y)
y = self.ffn_layers[i](x, x_mask)
y = self.drop(y)
x = self.norm_layers_2[i](x + y)
x = x * x_mask
return x
class MultiHeadAttention(nn.Module):
def __init__(
self,
channels,
out_channels,
n_heads,
p_dropout=0.0,
window_size=None,
heads_share=True,
block_length=None,
proximal_bias=False,
proximal_init=False,
):
super(MultiHeadAttention, self).__init__()
assert channels % n_heads == 0
self.channels = channels
self.out_channels = out_channels
self.n_heads = n_heads
self.p_dropout = p_dropout
self.window_size = window_size
self.heads_share = heads_share
self.block_length = block_length
self.proximal_bias = proximal_bias
self.proximal_init = proximal_init
self.attn = None
self.k_channels = channels // n_heads
self.conv_q = nn.Conv1d(channels, channels, 1)
self.conv_k = nn.Conv1d(channels, channels, 1)
self.conv_v = nn.Conv1d(channels, channels, 1)
self.conv_o = nn.Conv1d(channels, out_channels, 1)
self.drop = nn.Dropout(p_dropout)
if window_size is not None:
n_heads_rel = 1 if heads_share else n_heads
rel_stddev = self.k_channels**-0.5
self.emb_rel_k = nn.Parameter(
torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels)
* rel_stddev
)
self.emb_rel_v = nn.Parameter(
torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels)
* rel_stddev
)
nn.init.xavier_uniform_(self.conv_q.weight)
nn.init.xavier_uniform_(self.conv_k.weight)
nn.init.xavier_uniform_(self.conv_v.weight)
if proximal_init:
with torch.no_grad():
self.conv_k.weight.copy_(self.conv_q.weight)
self.conv_k.bias.copy_(self.conv_q.bias)
def forward(
self, x: torch.Tensor, c: torch.Tensor, attn_mask: Optional[torch.Tensor] = None
):
q = self.conv_q(x)
k = self.conv_k(c)
v = self.conv_v(c)
x, _ = self.attention(q, k, v, mask=attn_mask)
x = self.conv_o(x)
return x
def attention(
self,
query: torch.Tensor,
key: torch.Tensor,
value: torch.Tensor,
mask: Optional[torch.Tensor] = None,
):
# reshape [b, d, t] -> [b, n_h, t, d_k]
b, d, t_s = key.size()
t_t = query.size(2)
query = query.view(b, self.n_heads, self.k_channels, t_t).transpose(2, 3)
key = key.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
value = value.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
scores = torch.matmul(query / math.sqrt(self.k_channels), key.transpose(-2, -1))
if self.window_size is not None:
key_relative_embeddings = self._get_relative_embeddings(self.emb_rel_k, t_s)
rel_logits = self._matmul_with_relative_keys(
query / math.sqrt(self.k_channels), key_relative_embeddings
)
scores_local = self._relative_position_to_absolute_position(rel_logits)
scores = scores + scores_local
if self.proximal_bias:
assert t_s == t_t, "Proximal bias is only available for self-attention."
scores = scores + self._attention_bias_proximal(t_s).to(
device=scores.device, dtype=scores.dtype
)
if mask is not None:
scores = scores.masked_fill(mask == 0, -1e4)
if self.block_length is not None:
assert (
t_s == t_t
), "Local attention is only available for self-attention."
block_mask = (
torch.ones_like(scores)
.triu(-self.block_length)
.tril(self.block_length)
)
scores = scores.masked_fill(block_mask == 0, -1e4)
p_attn = F.softmax(scores, dim=-1) # [b, n_h, t_t, t_s]
p_attn = self.drop(p_attn)
output = torch.matmul(p_attn, value)
if self.window_size is not None:
relative_weights = self._absolute_position_to_relative_position(p_attn)
value_relative_embeddings = self._get_relative_embeddings(
self.emb_rel_v, t_s
)
output = output + self._matmul_with_relative_values(
relative_weights, value_relative_embeddings
)
output = (
output.transpose(2, 3).contiguous().view(b, d, t_t)
) # [b, n_h, t_t, d_k] -> [b, d, t_t]
return output, p_attn
def _matmul_with_relative_values(self, x, y):
"""
x: [b, h, l, m]
y: [h or 1, m, d]
ret: [b, h, l, d]
"""
ret = torch.matmul(x, y.unsqueeze(0))
return ret
def _matmul_with_relative_keys(self, x, y):
"""
x: [b, h, l, d]
y: [h or 1, m, d]
ret: [b, h, l, m]
"""
ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
return ret
def _get_relative_embeddings(self, relative_embeddings, length):
max_relative_position = 2 * self.window_size + 1
# Pad first before slice to avoid using cond ops.
pad_length = torch.clamp(length - (self.window_size + 1), min=0)
slice_start_position = torch.clamp((self.window_size + 1) - length, min=0)
slice_end_position = slice_start_position + 2 * length - 1
padded_relative_embeddings = F.pad(
relative_embeddings,
# commons.convert_pad_shape([[0, 0], [pad_length, pad_length], [0, 0]]),
[0, 0, pad_length, pad_length, 0, 0],
)
used_relative_embeddings = padded_relative_embeddings[
:, slice_start_position:slice_end_position
]
return used_relative_embeddings
def _relative_position_to_absolute_position(self, x):
"""
x: [b, h, l, 2*l-1]
ret: [b, h, l, l]
"""
batch, heads, length, _ = x.size()
# Concat columns of pad to shift from relative to absolute indexing.
x = F.pad(
x,
# commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, 1]])
[0, 1, 0, 0, 0, 0, 0, 0],
)
# Concat extra elements so to add up to shape (len+1, 2*len-1).
x_flat = x.view([batch, heads, length * 2 * length])
x_flat = F.pad(
x_flat,
[0, length - 1, 0, 0, 0, 0],
)
# Reshape and slice out the padded elements.
x_final = x_flat.view([batch, heads, length + 1, 2 * length - 1])[
:, :, :length, length - 1 :
]
return x_final
def _absolute_position_to_relative_position(self, x):
"""
x: [b, h, l, l]
ret: [b, h, l, 2*l-1]
"""
batch, heads, length, _ = x.size()
# padd along column
x = F.pad(
x,
[0, length - 1, 0, 0, 0, 0, 0, 0],
)
x_flat = x.view([batch, heads, length*length + length * (length - 1)])
# add 0's in the beginning that will skew the elements after reshape
x_flat = F.pad(
x_flat,
[length, 0, 0, 0, 0, 0],
)
x_final = x_flat.view([batch, heads, length, 2 * length])[:, :, :, 1:]
return x_final
def _attention_bias_proximal(self, length):
"""Bias for self-attention to encourage attention to close positions.
Args:
length: an integer scalar.
Returns:
a Tensor with shape [1, 1, length, length]
"""
r = torch.arange(length, dtype=torch.float32)
diff = torch.unsqueeze(r, 0) - torch.unsqueeze(r, 1)
return torch.unsqueeze(torch.unsqueeze(-torch.log1p(torch.abs(diff)), 0), 0)
class FFN(nn.Module):
def __init__(
self,
in_channels,
out_channels,
filter_channels,
kernel_size,
p_dropout=0.0,
activation: str = None,
causal=False,
):
super(FFN, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.filter_channels = filter_channels
self.kernel_size = kernel_size
self.p_dropout = p_dropout
self.activation = activation
self.causal = causal
self.is_activation = True if activation == "gelu" else False
# if causal:
# self.padding = self._causal_padding
# else:
# self.padding = self._same_padding
self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size)
self.conv_2 = nn.Conv1d(filter_channels, out_channels, kernel_size)
self.drop = nn.Dropout(p_dropout)
def padding(self, x: torch.Tensor, x_mask: torch.Tensor) -> torch.Tensor:
if self.causal:
padding = self._causal_padding(x * x_mask)
else:
padding = self._same_padding(x * x_mask)
return padding
def forward(self, x: torch.Tensor, x_mask: torch.Tensor):
x = self.conv_1(self.padding(x, x_mask))
if self.is_activation:
x = x * torch.sigmoid(1.702 * x)
else:
x = torch.relu(x)
x = self.drop(x)
x = self.conv_2(self.padding(x, x_mask))
return x * x_mask
def _causal_padding(self, x):
if self.kernel_size == 1:
return x
pad_l = self.kernel_size - 1
pad_r = 0
# padding = [[0, 0], [0, 0], [pad_l, pad_r]]
x = F.pad(
x,
# commons.convert_pad_shape(padding)
[pad_l, pad_r, 0, 0, 0, 0],
)
return x
def _same_padding(self, x):
if self.kernel_size == 1:
return x
pad_l = (self.kernel_size - 1) // 2
pad_r = self.kernel_size // 2
# padding = [[0, 0], [0, 0], [pad_l, pad_r]]
x = F.pad(
x,
# commons.convert_pad_shape(padding)
[pad_l, pad_r, 0, 0, 0, 0],
)
return x

View File

@ -10,16 +10,16 @@ from torch import nn
from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
from torch.nn import functional as F
from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
from infer.lib.infer_pack import attentions, commons, modules
from infer.lib.infer_pack.commons import get_padding, init_weights
has_xpu = bool(hasattr(torch, "xpu") and torch.xpu.is_available())
class TextEncoder256(nn.Module):
class TextEncoder(nn.Module):
def __init__(
self,
in_channels,
out_channels,
hidden_channels,
filter_channels,
@ -29,7 +29,7 @@ class TextEncoder256(nn.Module):
p_dropout,
f0=True,
):
super(TextEncoder256, self).__init__()
super(TextEncoder, self).__init__()
self.out_channels = out_channels
self.hidden_channels = hidden_channels
self.filter_channels = filter_channels
@ -37,7 +37,7 @@ class TextEncoder256(nn.Module):
self.n_layers = n_layers
self.kernel_size = kernel_size
self.p_dropout = float(p_dropout)
self.emb_phone = nn.Linear(256, hidden_channels)
self.emb_phone = nn.Linear(in_channels, hidden_channels)
self.lrelu = nn.LeakyReLU(0.1, inplace=True)
if f0 == True:
self.emb_pitch = nn.Embedding(256, hidden_channels) # pitch 256
@ -52,60 +52,12 @@ class TextEncoder256(nn.Module):
self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
def forward(
self, phone: torch.Tensor, pitch: Optional[torch.Tensor], lengths: torch.Tensor
):
if pitch is None:
x = self.emb_phone(phone)
else:
x = self.emb_phone(phone) + self.emb_pitch(pitch)
x = x * math.sqrt(self.hidden_channels) # [b, t, h]
x = self.lrelu(x)
x = torch.transpose(x, 1, -1) # [b, h, t]
x_mask = torch.unsqueeze(commons.sequence_mask(lengths, x.size(2)), 1).to(
x.dtype
)
x = self.encoder(x * x_mask, x_mask)
stats = self.proj(x) * x_mask
m, logs = torch.split(stats, self.out_channels, dim=1)
return m, logs, x_mask
class TextEncoder768(nn.Module):
def __init__(
self,
out_channels,
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size,
p_dropout,
f0=True,
phone: torch.Tensor,
pitch: torch.Tensor,
lengths: torch.Tensor,
skip_head: Optional[torch.Tensor] = None,
):
super(TextEncoder768, self).__init__()
self.out_channels = out_channels
self.hidden_channels = hidden_channels
self.filter_channels = filter_channels
self.n_heads = n_heads
self.n_layers = n_layers
self.kernel_size = kernel_size
self.p_dropout = float(p_dropout)
self.emb_phone = nn.Linear(768, hidden_channels)
self.lrelu = nn.LeakyReLU(0.1, inplace=True)
if f0 == True:
self.emb_pitch = nn.Embedding(256, hidden_channels) # pitch 256
self.encoder = attentions.Encoder(
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size,
float(p_dropout),
)
self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
def forward(self, phone: torch.Tensor, pitch: torch.Tensor, lengths: torch.Tensor):
if pitch is None:
x = self.emb_phone(phone)
else:
@ -117,8 +69,12 @@ class TextEncoder768(nn.Module):
x.dtype
)
x = self.encoder(x * x_mask, x_mask)
if skip_head is not None:
assert isinstance(skip_head, torch.Tensor)
head = int(skip_head.item())
x = x[:, :, head:]
x_mask = x_mask[:, :, head:]
stats = self.proj(x) * x_mask
m, logs = torch.split(stats, self.out_channels, dim=1)
return m, logs, x_mask
@ -293,7 +249,17 @@ class Generator(torch.nn.Module):
if gin_channels != 0:
self.cond = nn.Conv1d(gin_channels, upsample_initial_channel, 1)
def forward(self, x: torch.Tensor, g: Optional[torch.Tensor] = None):
def forward(
self,
x: torch.Tensor,
g: Optional[torch.Tensor] = None,
n_res: Optional[torch.Tensor] = None,
):
if n_res is not None:
assert isinstance(n_res, torch.Tensor)
n = int(n_res.item())
if n != x.shape[-1]:
x = F.interpolate(x, size=n, mode="linear")
x = self.conv_pre(x)
if g is not None:
x = x + self.cond(g)
@ -383,7 +349,25 @@ class SineGen(torch.nn.Module):
if uv.device.type == "privateuseone": # for DirectML
uv = uv.float()
return uv
def _f02sine(self, f0, upp):
""" f0: (batchsize, length, dim)
where dim indicates fundamental tone and overtones
"""
a = torch.arange(1, upp + 1, dtype=f0.dtype, device=f0.device)
rad = f0 / self.sampling_rate * a
rad2 = torch.fmod(rad[:, :-1, -1:].float() + 0.5, 1.0) - 0.5
rad_acc = rad2.cumsum(dim=1).fmod(1.0).to(f0)
rad += F.pad(rad_acc, (0, 0, 1, 0), mode='constant')
rad = rad.reshape(f0.shape[0], -1, 1)
b = torch.arange(1, self.dim + 1, dtype=f0.dtype, device=f0.device).reshape(1, 1, -1)
rad *= b
rand_ini = torch.rand(1, 1, self.dim, device=f0.device)
rand_ini[..., 0] = 0
rad += rand_ini
sines = torch.sin(2 * np.pi * rad)
return sines
def forward(self, f0: torch.Tensor, upp: int):
"""sine_tensor, uv = forward(f0)
input F0: tensor(batchsize=1, length, dim=1)
@ -392,41 +376,8 @@ class SineGen(torch.nn.Module):
output uv: tensor(batchsize=1, length, 1)
"""
with torch.no_grad():
f0 = f0[:, None].transpose(1, 2)
f0_buf = torch.zeros(f0.shape[0], f0.shape[1], self.dim, device=f0.device)
# fundamental component
f0_buf[:, :, 0] = f0[:, :, 0]
for idx in range(self.harmonic_num):
f0_buf[:, :, idx + 1] = f0_buf[:, :, 0] * (
idx + 2
) # idx + 2: the (idx+1)-th overtone, (idx+2)-th harmonic
rad_values = (f0_buf / self.sampling_rate) % 1 ###%1意味着n_har的乘积无法后处理优化
rand_ini = torch.rand(
f0_buf.shape[0], f0_buf.shape[2], device=f0_buf.device
)
rand_ini[:, 0] = 0
rad_values[:, 0, :] = rad_values[:, 0, :] + rand_ini
tmp_over_one = torch.cumsum(rad_values, 1) # % 1 #####%1意味着后面的cumsum无法再优化
tmp_over_one *= upp
tmp_over_one = F.interpolate(
tmp_over_one.transpose(2, 1),
scale_factor=float(upp),
mode="linear",
align_corners=True,
).transpose(2, 1)
rad_values = F.interpolate(
rad_values.transpose(2, 1), scale_factor=float(upp), mode="nearest"
).transpose(
2, 1
) #######
tmp_over_one %= 1
tmp_over_one_idx = (tmp_over_one[:, 1:, :] - tmp_over_one[:, :-1, :]) < 0
cumsum_shift = torch.zeros_like(rad_values)
cumsum_shift[:, 1:, :] = tmp_over_one_idx * -1.0
sine_waves = torch.sin(
torch.cumsum(rad_values + cumsum_shift, dim=1) * 2 * torch.pi
)
sine_waves = sine_waves * self.sine_amp
f0 = f0.unsqueeze(-1)
sine_waves = self._f02sine(f0, upp) * self.sine_amp
uv = self._f02uv(f0)
uv = F.interpolate(
uv.transpose(2, 1), scale_factor=float(upp), mode="nearest"
@ -568,9 +519,22 @@ class GeneratorNSF(torch.nn.Module):
self.lrelu_slope = modules.LRELU_SLOPE
def forward(self, x, f0, g: Optional[torch.Tensor] = None):
def forward(
self,
x,
f0,
g: Optional[torch.Tensor] = None,
n_res: Optional[torch.Tensor] = None,
):
har_source, noi_source, uv = self.m_source(f0, self.upp)
har_source = har_source.transpose(1, 2)
if n_res is not None:
assert isinstance(n_res, torch.Tensor)
n = int(n_res.item())
if n * self.upp != har_source.shape[-1]:
har_source = F.interpolate(har_source, size=n * self.upp, mode="linear")
if n != x.shape[-1]:
x = F.interpolate(x, size=n, mode="linear")
x = self.conv_pre(x)
if g is not None:
x = x + self.cond(g)
@ -597,6 +561,7 @@ class GeneratorNSF(torch.nn.Module):
x = F.leaky_relu(x)
x = self.conv_post(x)
x = torch.tanh(x)
return x
def remove_weight_norm(self):
@ -678,7 +643,8 @@ class SynthesizerTrnMs256NSFsid(nn.Module):
self.gin_channels = gin_channels
# self.hop_length = hop_length#
self.spk_embed_dim = spk_embed_dim
self.enc_p = TextEncoder256(
self.enc_p = TextEncoder(
256,
inter_channels,
hidden_channels,
filter_channels,
@ -722,7 +688,8 @@ class SynthesizerTrnMs256NSFsid(nn.Module):
def remove_weight_norm(self):
self.dec.remove_weight_norm()
self.flow.remove_weight_norm()
self.enc_q.remove_weight_norm()
if hasattr(self, "enc_q"):
self.enc_q.remove_weight_norm()
def __prepare_scriptable__(self):
for hook in self.dec._forward_pre_hooks.values():
@ -783,23 +750,33 @@ class SynthesizerTrnMs256NSFsid(nn.Module):
pitch: torch.Tensor,
nsff0: torch.Tensor,
sid: torch.Tensor,
rate: Optional[torch.Tensor] = None,
skip_head: Optional[torch.Tensor] = None,
return_length: Optional[torch.Tensor] = None,
return_length2: Optional[torch.Tensor] = None,
):
g = self.emb_g(sid).unsqueeze(-1)
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
if rate is not None:
assert isinstance(rate, torch.Tensor)
head = int(z_p.shape[2] * (1 - rate.item()))
z_p = z_p[:, :, head:]
x_mask = x_mask[:, :, head:]
nsff0 = nsff0[:, head:]
z = self.flow(z_p, x_mask, g=g, reverse=True)
o = self.dec(z * x_mask, nsff0, g=g)
if skip_head is not None and return_length is not None:
assert isinstance(skip_head, torch.Tensor)
assert isinstance(return_length, torch.Tensor)
head = int(skip_head.item())
length = int(return_length.item())
flow_head = torch.clamp(skip_head - 24, min=0)
dec_head = head - int(flow_head.item())
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths, flow_head)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
z = self.flow(z_p, x_mask, g=g, reverse=True)
z = z[:, :, dec_head : dec_head + length]
x_mask = x_mask[:, :, dec_head : dec_head + length]
nsff0 = nsff0[:, head : head + length]
else:
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
z = self.flow(z_p, x_mask, g=g, reverse=True)
o = self.dec(z * x_mask, nsff0, g=g, n_res=return_length2)
return o, x_mask, (z, z_p, m_p, logs_p)
class SynthesizerTrnMs768NSFsid(nn.Module):
class SynthesizerTrnMs768NSFsid(SynthesizerTrnMs256NSFsid):
def __init__(
self,
spec_channels,
@ -822,28 +799,30 @@ class SynthesizerTrnMs768NSFsid(nn.Module):
sr,
**kwargs
):
super(SynthesizerTrnMs768NSFsid, self).__init__()
if isinstance(sr, str):
sr = sr2sr[sr]
self.spec_channels = spec_channels
self.inter_channels = inter_channels
self.hidden_channels = hidden_channels
self.filter_channels = filter_channels
self.n_heads = n_heads
self.n_layers = n_layers
self.kernel_size = kernel_size
self.p_dropout = float(p_dropout)
self.resblock = resblock
self.resblock_kernel_sizes = resblock_kernel_sizes
self.resblock_dilation_sizes = resblock_dilation_sizes
self.upsample_rates = upsample_rates
self.upsample_initial_channel = upsample_initial_channel
self.upsample_kernel_sizes = upsample_kernel_sizes
self.segment_size = segment_size
self.gin_channels = gin_channels
# self.hop_length = hop_length#
self.spk_embed_dim = spk_embed_dim
self.enc_p = TextEncoder768(
super(SynthesizerTrnMs768NSFsid, self).__init__(
spec_channels,
segment_size,
inter_channels,
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size,
p_dropout,
resblock,
resblock_kernel_sizes,
resblock_dilation_sizes,
upsample_rates,
upsample_initial_channel,
upsample_kernel_sizes,
spk_embed_dim,
gin_channels,
sr,
**kwargs
)
del self.enc_p
self.enc_p = TextEncoder(
768,
inter_channels,
hidden_channels,
filter_channels,
@ -852,108 +831,6 @@ class SynthesizerTrnMs768NSFsid(nn.Module):
kernel_size,
float(p_dropout),
)
self.dec = GeneratorNSF(
inter_channels,
resblock,
resblock_kernel_sizes,
resblock_dilation_sizes,
upsample_rates,
upsample_initial_channel,
upsample_kernel_sizes,
gin_channels=gin_channels,
sr=sr,
is_half=kwargs["is_half"],
)
self.enc_q = PosteriorEncoder(
spec_channels,
inter_channels,
hidden_channels,
5,
1,
16,
gin_channels=gin_channels,
)
self.flow = ResidualCouplingBlock(
inter_channels, hidden_channels, 5, 1, 3, gin_channels=gin_channels
)
self.emb_g = nn.Embedding(self.spk_embed_dim, gin_channels)
logger.debug(
"gin_channels: "
+ str(gin_channels)
+ ", self.spk_embed_dim: "
+ str(self.spk_embed_dim)
)
def remove_weight_norm(self):
self.dec.remove_weight_norm()
self.flow.remove_weight_norm()
self.enc_q.remove_weight_norm()
def __prepare_scriptable__(self):
for hook in self.dec._forward_pre_hooks.values():
# The hook we want to remove is an instance of WeightNorm class, so
# normally we would do `if isinstance(...)` but this class is not accessible
# because of shadowing, so we check the module name directly.
# https://github.com/pytorch/pytorch/blob/be0ca00c5ce260eb5bcec3237357f7a30cc08983/torch/nn/utils/__init__.py#L3
if (
hook.__module__ == "torch.nn.utils.weight_norm"
and hook.__class__.__name__ == "WeightNorm"
):
torch.nn.utils.remove_weight_norm(self.dec)
for hook in self.flow._forward_pre_hooks.values():
if (
hook.__module__ == "torch.nn.utils.weight_norm"
and hook.__class__.__name__ == "WeightNorm"
):
torch.nn.utils.remove_weight_norm(self.flow)
if hasattr(self, "enc_q"):
for hook in self.enc_q._forward_pre_hooks.values():
if (
hook.__module__ == "torch.nn.utils.weight_norm"
and hook.__class__.__name__ == "WeightNorm"
):
torch.nn.utils.remove_weight_norm(self.enc_q)
return self
@torch.jit.ignore
def forward(
self, phone, phone_lengths, pitch, pitchf, y, y_lengths, ds
): # 这里ds是id[bs,1]
# print(1,pitch.shape)#[bs,t]
g = self.emb_g(ds).unsqueeze(-1) # [b, 256, 1]##1是t广播的
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
z, m_q, logs_q, y_mask = self.enc_q(y, y_lengths, g=g)
z_p = self.flow(z, y_mask, g=g)
z_slice, ids_slice = commons.rand_slice_segments(
z, y_lengths, self.segment_size
)
# print(-1,pitchf.shape,ids_slice,self.segment_size,self.hop_length,self.segment_size//self.hop_length)
pitchf = commons.slice_segments2(pitchf, ids_slice, self.segment_size)
# print(-2,pitchf.shape,z_slice.shape)
o = self.dec(z_slice, pitchf, g=g)
return o, ids_slice, x_mask, y_mask, (z, z_p, m_p, logs_p, m_q, logs_q)
@torch.jit.export
def infer(
self,
phone: torch.Tensor,
phone_lengths: torch.Tensor,
pitch: torch.Tensor,
nsff0: torch.Tensor,
sid: torch.Tensor,
rate: Optional[torch.Tensor] = None,
):
g = self.emb_g(sid).unsqueeze(-1)
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
if rate is not None:
head = int(z_p.shape[2] * (1.0 - rate.item()))
z_p = z_p[:, :, head:]
x_mask = x_mask[:, :, head:]
nsff0 = nsff0[:, head:]
z = self.flow(z_p, x_mask, g=g, reverse=True)
o = self.dec(z * x_mask, nsff0, g=g)
return o, x_mask, (z, z_p, m_p, logs_p)
class SynthesizerTrnMs256NSFsid_nono(nn.Module):
@ -998,7 +875,8 @@ class SynthesizerTrnMs256NSFsid_nono(nn.Module):
self.gin_channels = gin_channels
# self.hop_length = hop_length#
self.spk_embed_dim = spk_embed_dim
self.enc_p = TextEncoder256(
self.enc_p = TextEncoder(
256,
inter_channels,
hidden_channels,
filter_channels,
@ -1041,7 +919,8 @@ class SynthesizerTrnMs256NSFsid_nono(nn.Module):
def remove_weight_norm(self):
self.dec.remove_weight_norm()
self.flow.remove_weight_norm()
self.enc_q.remove_weight_norm()
if hasattr(self, "enc_q"):
self.enc_q.remove_weight_norm()
def __prepare_scriptable__(self):
for hook in self.dec._forward_pre_hooks.values():
@ -1087,22 +966,32 @@ class SynthesizerTrnMs256NSFsid_nono(nn.Module):
phone: torch.Tensor,
phone_lengths: torch.Tensor,
sid: torch.Tensor,
rate: Optional[torch.Tensor] = None,
skip_head: Optional[torch.Tensor] = None,
return_length: Optional[torch.Tensor] = None,
return_length2: Optional[torch.Tensor] = None,
):
g = self.emb_g(sid).unsqueeze(-1)
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
if rate is not None:
head = int(z_p.shape[2] * (1.0 - rate.item()))
z_p = z_p[:, :, head:]
x_mask = x_mask[:, :, head:]
nsff0 = nsff0[:, head:]
z = self.flow(z_p, x_mask, g=g, reverse=True)
o = self.dec(z * x_mask, g=g)
if skip_head is not None and return_length is not None:
assert isinstance(skip_head, torch.Tensor)
assert isinstance(return_length, torch.Tensor)
head = int(skip_head.item())
length = int(return_length.item())
flow_head = torch.clamp(skip_head - 24, min=0)
dec_head = head - int(flow_head.item())
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths, flow_head)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
z = self.flow(z_p, x_mask, g=g, reverse=True)
z = z[:, :, dec_head : dec_head + length]
x_mask = x_mask[:, :, dec_head : dec_head + length]
else:
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
z = self.flow(z_p, x_mask, g=g, reverse=True)
o = self.dec(z * x_mask, g=g, n_res=return_length2)
return o, x_mask, (z, z_p, m_p, logs_p)
class SynthesizerTrnMs768NSFsid_nono(nn.Module):
class SynthesizerTrnMs768NSFsid_nono(SynthesizerTrnMs256NSFsid_nono):
def __init__(
self,
spec_channels,
@ -1125,26 +1014,30 @@ class SynthesizerTrnMs768NSFsid_nono(nn.Module):
sr=None,
**kwargs
):
super(self, SynthesizerTrnMs768NSFsid_nono).__init__()
self.spec_channels = spec_channels
self.inter_channels = inter_channels
self.hidden_channels = hidden_channels
self.filter_channels = filter_channels
self.n_heads = n_heads
self.n_layers = n_layers
self.kernel_size = kernel_size
self.p_dropout = float(p_dropout)
self.resblock = resblock
self.resblock_kernel_sizes = resblock_kernel_sizes
self.resblock_dilation_sizes = resblock_dilation_sizes
self.upsample_rates = upsample_rates
self.upsample_initial_channel = upsample_initial_channel
self.upsample_kernel_sizes = upsample_kernel_sizes
self.segment_size = segment_size
self.gin_channels = gin_channels
# self.hop_length = hop_length#
self.spk_embed_dim = spk_embed_dim
self.enc_p = TextEncoder768(
super(SynthesizerTrnMs768NSFsid_nono, self).__init__(
spec_channels,
segment_size,
inter_channels,
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size,
p_dropout,
resblock,
resblock_kernel_sizes,
resblock_dilation_sizes,
upsample_rates,
upsample_initial_channel,
upsample_kernel_sizes,
spk_embed_dim,
gin_channels,
sr,
**kwargs
)
del self.enc_p
self.enc_p = TextEncoder(
768,
inter_channels,
hidden_channels,
filter_channels,
@ -1154,98 +1047,6 @@ class SynthesizerTrnMs768NSFsid_nono(nn.Module):
float(p_dropout),
f0=False,
)
self.dec = Generator(
inter_channels,
resblock,
resblock_kernel_sizes,
resblock_dilation_sizes,
upsample_rates,
upsample_initial_channel,
upsample_kernel_sizes,
gin_channels=gin_channels,
)
self.enc_q = PosteriorEncoder(
spec_channels,
inter_channels,
hidden_channels,
5,
1,
16,
gin_channels=gin_channels,
)
self.flow = ResidualCouplingBlock(
inter_channels, hidden_channels, 5, 1, 3, gin_channels=gin_channels
)
self.emb_g = nn.Embedding(self.spk_embed_dim, gin_channels)
logger.debug(
"gin_channels: "
+ str(gin_channels)
+ ", self.spk_embed_dim: "
+ str(self.spk_embed_dim)
)
def remove_weight_norm(self):
self.dec.remove_weight_norm()
self.flow.remove_weight_norm()
self.enc_q.remove_weight_norm()
def __prepare_scriptable__(self):
for hook in self.dec._forward_pre_hooks.values():
# The hook we want to remove is an instance of WeightNorm class, so
# normally we would do `if isinstance(...)` but this class is not accessible
# because of shadowing, so we check the module name directly.
# https://github.com/pytorch/pytorch/blob/be0ca00c5ce260eb5bcec3237357f7a30cc08983/torch/nn/utils/__init__.py#L3
if (
hook.__module__ == "torch.nn.utils.weight_norm"
and hook.__class__.__name__ == "WeightNorm"
):
torch.nn.utils.remove_weight_norm(self.dec)
for hook in self.flow._forward_pre_hooks.values():
if (
hook.__module__ == "torch.nn.utils.weight_norm"
and hook.__class__.__name__ == "WeightNorm"
):
torch.nn.utils.remove_weight_norm(self.flow)
if hasattr(self, "enc_q"):
for hook in self.enc_q._forward_pre_hooks.values():
if (
hook.__module__ == "torch.nn.utils.weight_norm"
and hook.__class__.__name__ == "WeightNorm"
):
torch.nn.utils.remove_weight_norm(self.enc_q)
return self
@torch.jit.ignore
def forward(self, phone, phone_lengths, y, y_lengths, ds): # 这里ds是id[bs,1]
g = self.emb_g(ds).unsqueeze(-1) # [b, 256, 1]##1是t广播的
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
z, m_q, logs_q, y_mask = self.enc_q(y, y_lengths, g=g)
z_p = self.flow(z, y_mask, g=g)
z_slice, ids_slice = commons.rand_slice_segments(
z, y_lengths, self.segment_size
)
o = self.dec(z_slice, g=g)
return o, ids_slice, x_mask, y_mask, (z, z_p, m_p, logs_p, m_q, logs_q)
@torch.jit.export
def infer(
self,
phone: torch.Tensor,
phone_lengths: torch.Tensor,
sid: torch.Tensor,
rate: Optional[torch.Tensor] = None,
):
g = self.emb_g(sid).unsqueeze(-1)
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
if rate is not None:
head = int(z_p.shape[2] * (1.0 - rate.item()))
z_p = z_p[:, :, head:]
x_mask = x_mask[:, :, head:]
nsff0 = nsff0[:, head:]
z = self.flow(z_p, x_mask, g=g, reverse=True)
o = self.dec(z * x_mask, g=g)
return o, x_mask, (z, z_p, m_p, logs_p)
class MultiPeriodDiscriminator(torch.nn.Module):

View File

@ -1,3 +1,12 @@
############################## Warning! ##############################
# #
# Onnx Export Not Support All Of Non-Torch Types #
# Include Python Built-in Types!!!!!!!!!!!!!!!!! #
# If You Want TO Change This File #
# Do Not Use All Of Non-Torch Types! #
# #
############################## Warning! ##############################
import math
import logging
@ -10,7 +19,8 @@ from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
from torch.nn import functional as F
from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
from infer.lib.infer_pack import attentions, commons, modules
from infer.lib.infer_pack import commons, modules
import infer.lib.infer_pack.attentions_onnx as attentions
from infer.lib.infer_pack.commons import get_padding, init_weights
@ -149,7 +159,7 @@ class ResidualCouplingBlock(nn.Module):
x, _ = flow(x, x_mask, g=g, reverse=reverse)
else:
for flow in reversed(self.flows):
x = flow(x, x_mask, g=g, reverse=reverse)
x, _ = flow(x, x_mask, g=g, reverse=reverse)
return x
def remove_weight_norm(self):
@ -315,9 +325,29 @@ class SineGen(torch.nn.Module):
# generate uv signal
uv = torch.ones_like(f0)
uv = uv * (f0 > self.voiced_threshold)
if uv.device.type == "privateuseone": # for DirectML
uv = uv.float()
return uv
def forward(self, f0, upp):
def _f02sine(self, f0, upp):
""" f0: (batchsize, length, dim)
where dim indicates fundamental tone and overtones
"""
a = torch.arange(1, upp + 1, dtype=f0.dtype, device=f0.device)
rad = f0 / self.sampling_rate * a
rad2 = torch.fmod(rad[:, :-1, -1:].float() + 0.5, 1.0) - 0.5
rad_acc = rad2.cumsum(dim=1).fmod(1.0).to(f0)
rad += F.pad(rad_acc, (0, 0, 1, 0), mode='constant')
rad = rad.reshape(f0.shape[0], -1, 1)
b = torch.arange(1, self.dim + 1, dtype=f0.dtype, device=f0.device).reshape(1, 1, -1)
rad *= b
rand_ini = torch.rand(1, 1, self.dim, device=f0.device)
rand_ini[..., 0] = 0
rad += rand_ini
sines = torch.sin(2 * np.pi * rad)
return sines
def forward(self, f0: torch.Tensor, upp: int):
"""sine_tensor, uv = forward(f0)
input F0: tensor(batchsize=1, length, dim=1)
f0 for unvoiced steps should be 0
@ -325,44 +355,11 @@ class SineGen(torch.nn.Module):
output uv: tensor(batchsize=1, length, 1)
"""
with torch.no_grad():
f0 = f0[:, None].transpose(1, 2)
f0_buf = torch.zeros(f0.shape[0], f0.shape[1], self.dim, device=f0.device)
# fundamental component
f0_buf[:, :, 0] = f0[:, :, 0]
for idx in np.arange(self.harmonic_num):
f0_buf[:, :, idx + 1] = f0_buf[:, :, 0] * (
idx + 2
) # idx + 2: the (idx+1)-th overtone, (idx+2)-th harmonic
rad_values = (f0_buf / self.sampling_rate) % 1 ###%1意味着n_har的乘积无法后处理优化
rand_ini = torch.rand(
f0_buf.shape[0], f0_buf.shape[2], device=f0_buf.device
)
rand_ini[:, 0] = 0
rad_values[:, 0, :] = rad_values[:, 0, :] + rand_ini
tmp_over_one = torch.cumsum(rad_values, 1) # % 1 #####%1意味着后面的cumsum无法再优化
tmp_over_one *= upp
tmp_over_one = F.interpolate(
tmp_over_one.transpose(2, 1),
scale_factor=upp,
mode="linear",
align_corners=True,
).transpose(2, 1)
rad_values = F.interpolate(
rad_values.transpose(2, 1), scale_factor=upp, mode="nearest"
).transpose(
2, 1
) #######
tmp_over_one %= 1
tmp_over_one_idx = (tmp_over_one[:, 1:, :] - tmp_over_one[:, :-1, :]) < 0
cumsum_shift = torch.zeros_like(rad_values)
cumsum_shift[:, 1:, :] = tmp_over_one_idx * -1.0
sine_waves = torch.sin(
torch.cumsum(rad_values + cumsum_shift, dim=1) * 2 * np.pi
)
sine_waves = sine_waves * self.sine_amp
f0 = f0.unsqueeze(-1)
sine_waves = self._f02sine(f0, upp) * self.sine_amp
uv = self._f02uv(f0)
uv = F.interpolate(
uv.transpose(2, 1), scale_factor=upp, mode="nearest"
uv.transpose(2, 1), scale_factor=float(upp), mode="nearest"
).transpose(2, 1)
noise_amp = uv * self.noise_std + (1 - uv) * self.sine_amp / 3
noise = noise_amp * torch.randn_like(sine_waves)

View File

@ -65,7 +65,7 @@ class HarvestF0Predictor(F0Predictor):
p_len = wav.shape[0] // self.hop_length
f0, t = pyworld.harvest(
wav.astype(np.double),
fs=self.hop_length,
fs=self.sampling_rate,
f0_ceil=self.f0_max,
f0_floor=self.f0_min,
frame_period=1000 * self.hop_length / self.sampling_rate,

View File

@ -34,4 +34,5 @@ def get_synthesizer(pth_path, device=torch.device("cpu")):
net_g.load_state_dict(cpt["weight"], strict=False)
net_g = net_g.float()
net_g.eval().to(device)
net_g.remove_weight_norm()
return net_g, cpt

View File

@ -593,16 +593,18 @@ class RMVPE:
def infer_from_audio(self, audio, thred=0.03):
# torch.cuda.synchronize()
t0 = ttime()
# t0 = ttime()
if not torch.is_tensor(audio):
audio = torch.from_numpy(audio)
mel = self.mel_extractor(
torch.from_numpy(audio).float().to(self.device).unsqueeze(0), center=True
audio.float().to(self.device).unsqueeze(0), center=True
)
# print(123123123,mel.device.type)
# torch.cuda.synchronize()
t1 = ttime()
# t1 = ttime()
hidden = self.mel2hidden(mel)
# torch.cuda.synchronize()
t2 = ttime()
# t2 = ttime()
# print(234234,hidden.device.type)
if "privateuseone" not in str(self.device):
hidden = hidden.squeeze(0).cpu().numpy()
@ -613,7 +615,7 @@ class RMVPE:
f0 = self.decode(hidden, thred=thred)
# torch.cuda.synchronize()
t3 = ttime()
# t3 = ttime()
# print("hmvpe:%s\t%s\t%s\t%s"%(t1-t0,t2-t1,t3-t2,t3-t0))
return f0

461
infer/lib/rtrvc.py Normal file
View File

@ -0,0 +1,461 @@
from io import BytesIO
import os
import sys
import traceback
from infer.lib import jit
from infer.lib.jit.get_synthesizer import get_synthesizer
from time import time as ttime
import fairseq
import faiss
import numpy as np
import parselmouth
import pyworld
import scipy.signal as signal
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchcrepe
from torchaudio.transforms import Resample
now_dir = os.getcwd()
sys.path.append(now_dir)
from multiprocessing import Manager as M
from configs.config import Config
# config = Config()
mm = M()
def printt(strr, *args):
if len(args) == 0:
print(strr)
else:
print(strr % args)
# config.device=torch.device("cpu")########强制cpu测试
# config.is_half=False########强制cpu测试
class RVC:
def __init__(
self,
key,
formant,
pth_path,
index_path,
index_rate,
n_cpu,
inp_q,
opt_q,
config: Config,
last_rvc=None,
) -> None:
"""
初始化
"""
try:
if config.dml == True:
def forward_dml(ctx, x, scale):
ctx.scale = scale
res = x.clone().detach()
return res
fairseq.modules.grad_multiply.GradMultiply.forward = forward_dml
# global config
self.config = config
self.inp_q = inp_q
self.opt_q = opt_q
# device="cpu"########强制cpu测试
self.device = config.device
self.f0_up_key = key
self.formant_shift = formant
self.f0_min = 50
self.f0_max = 1100
self.f0_mel_min = 1127 * np.log(1 + self.f0_min / 700)
self.f0_mel_max = 1127 * np.log(1 + self.f0_max / 700)
self.n_cpu = n_cpu
self.use_jit = self.config.use_jit
self.is_half = config.is_half
if index_rate != 0:
self.index = faiss.read_index(index_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
printt("Index search enabled")
self.pth_path: str = pth_path
self.index_path = index_path
self.index_rate = index_rate
self.cache_pitch: torch.Tensor = torch.zeros(
1024, device=self.device, dtype=torch.long
)
self.cache_pitchf = torch.zeros(
1024, device=self.device, dtype=torch.float32
)
self.resample_kernel = {}
if last_rvc is None:
models, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task(
["assets/hubert/hubert_base.pt"],
suffix="",
)
hubert_model = models[0]
hubert_model = hubert_model.to(self.device)
if self.is_half:
hubert_model = hubert_model.half()
else:
hubert_model = hubert_model.float()
hubert_model.eval()
self.model = hubert_model
else:
self.model = last_rvc.model
self.net_g: nn.Module = None
def set_default_model():
self.net_g, cpt = get_synthesizer(self.pth_path, self.device)
self.tgt_sr = cpt["config"][-1]
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0]
self.if_f0 = cpt.get("f0", 1)
self.version = cpt.get("version", "v1")
if self.is_half:
self.net_g = self.net_g.half()
else:
self.net_g = self.net_g.float()
def set_jit_model():
jit_pth_path = self.pth_path.rstrip(".pth")
jit_pth_path += ".half.jit" if self.is_half else ".jit"
reload = False
if str(self.device) == "cuda":
self.device = torch.device("cuda:0")
if os.path.exists(jit_pth_path):
cpt = jit.load(jit_pth_path)
model_device = cpt["device"]
if model_device != str(self.device):
reload = True
else:
reload = True
if reload:
cpt = jit.synthesizer_jit_export(
self.pth_path,
"script",
None,
device=self.device,
is_half=self.is_half,
)
self.tgt_sr = cpt["config"][-1]
self.if_f0 = cpt.get("f0", 1)
self.version = cpt.get("version", "v1")
self.net_g = torch.jit.load(
BytesIO(cpt["model"]), map_location=self.device
)
self.net_g.infer = self.net_g.forward
self.net_g.eval().to(self.device)
def set_synthesizer():
if self.use_jit and not config.dml:
if self.is_half and "cpu" in str(self.device):
printt(
"Use default Synthesizer model. \
Jit is not supported on the CPU for half floating point"
)
set_default_model()
else:
set_jit_model()
else:
set_default_model()
if last_rvc is None or last_rvc.pth_path != self.pth_path:
set_synthesizer()
else:
self.tgt_sr = last_rvc.tgt_sr
self.if_f0 = last_rvc.if_f0
self.version = last_rvc.version
self.is_half = last_rvc.is_half
if last_rvc.use_jit != self.use_jit:
set_synthesizer()
else:
self.net_g = last_rvc.net_g
if last_rvc is not None and hasattr(last_rvc, "model_rmvpe"):
self.model_rmvpe = last_rvc.model_rmvpe
if last_rvc is not None and hasattr(last_rvc, "model_fcpe"):
self.device_fcpe = last_rvc.device_fcpe
self.model_fcpe = last_rvc.model_fcpe
except:
printt(traceback.format_exc())
def change_key(self, new_key):
self.f0_up_key = new_key
def change_formant(self, new_formant):
self.formant_shift = new_formant
def change_index_rate(self, new_index_rate):
if new_index_rate != 0 and self.index_rate == 0:
self.index = faiss.read_index(self.index_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
printt("Index search enabled")
self.index_rate = new_index_rate
def get_f0_post(self, f0):
if not torch.is_tensor(f0):
f0 = torch.from_numpy(f0)
f0 = f0.float().to(self.device).squeeze()
f0_mel = 1127 * torch.log(1 + f0 / 700)
f0_mel[f0_mel > 0] = (f0_mel[f0_mel > 0] - self.f0_mel_min) * 254 / (
self.f0_mel_max - self.f0_mel_min
) + 1
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > 255] = 255
f0_coarse = torch.round(f0_mel).long()
return f0_coarse, f0
def get_f0(self, x, f0_up_key, n_cpu, method="harvest"):
n_cpu = int(n_cpu)
if method == "crepe":
return self.get_f0_crepe(x, f0_up_key)
if method == "rmvpe":
return self.get_f0_rmvpe(x, f0_up_key)
if method == "fcpe":
return self.get_f0_fcpe(x, f0_up_key)
x = x.cpu().numpy()
if method == "pm":
p_len = x.shape[0] // 160 + 1
f0_min = 65
l_pad = int(np.ceil(1.5 / f0_min * 16000))
r_pad = l_pad + 1
s = parselmouth.Sound(np.pad(x, (l_pad, r_pad)), 16000).to_pitch_ac(
time_step=0.01,
voicing_threshold=0.6,
pitch_floor=f0_min,
pitch_ceiling=1100,
)
assert np.abs(s.t1 - 1.5 / f0_min) < 0.001
f0 = s.selected_array["frequency"]
if len(f0) < p_len:
f0 = np.pad(f0, (0, p_len - len(f0)))
f0 = f0[:p_len]
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
if n_cpu == 1:
f0, t = pyworld.harvest(
x.astype(np.double),
fs=16000,
f0_ceil=1100,
f0_floor=50,
frame_period=10,
)
f0 = signal.medfilt(f0, 3)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
f0bak = np.zeros(x.shape[0] // 160 + 1, dtype=np.float64)
length = len(x)
part_length = 160 * ((length // 160 - 1) // n_cpu + 1)
n_cpu = (length // 160 - 1) // (part_length // 160) + 1
ts = ttime()
res_f0 = mm.dict()
for idx in range(n_cpu):
tail = part_length * (idx + 1) + 320
if idx == 0:
self.inp_q.put((idx, x[:tail], res_f0, n_cpu, ts))
else:
self.inp_q.put(
(idx, x[part_length * idx - 320 : tail], res_f0, n_cpu, ts)
)
while 1:
res_ts = self.opt_q.get()
if res_ts == ts:
break
f0s = [i[1] for i in sorted(res_f0.items(), key=lambda x: x[0])]
for idx, f0 in enumerate(f0s):
if idx == 0:
f0 = f0[:-3]
elif idx != n_cpu - 1:
f0 = f0[2:-3]
else:
f0 = f0[2:]
f0bak[part_length * idx // 160 : part_length * idx // 160 + f0.shape[0]] = (
f0
)
f0bak = signal.medfilt(f0bak, 3)
f0bak *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0bak)
def get_f0_crepe(self, x, f0_up_key):
if "privateuseone" in str(
self.device
): ###不支持dmlcpu又太慢用不成拿fcpe顶替
return self.get_f0(x, f0_up_key, 1, "fcpe")
# printt("using crepe,device:%s"%self.device)
f0, pd = torchcrepe.predict(
x.unsqueeze(0).float(),
16000,
160,
self.f0_min,
self.f0_max,
"full",
batch_size=512,
# device=self.device if self.device.type!="privateuseone" else "cpu",###crepe不用半精度全部是全精度所以不愁###cpu延迟高到没法用
device=self.device,
return_periodicity=True,
)
pd = torchcrepe.filter.median(pd, 3)
f0 = torchcrepe.filter.mean(f0, 3)
f0[pd < 0.1] = 0
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def get_f0_rmvpe(self, x, f0_up_key):
if hasattr(self, "model_rmvpe") == False:
from infer.lib.rmvpe import RMVPE
printt("Loading rmvpe model")
self.model_rmvpe = RMVPE(
"assets/rmvpe/rmvpe.pt",
is_half=self.is_half,
device=self.device,
use_jit=self.config.use_jit,
)
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def get_f0_fcpe(self, x, f0_up_key):
if hasattr(self, "model_fcpe") == False:
from torchfcpe import spawn_bundled_infer_model
printt("Loading fcpe model")
if "privateuseone" in str(self.device):
self.device_fcpe = "cpu"
else:
self.device_fcpe = self.device
self.model_fcpe = spawn_bundled_infer_model(self.device_fcpe)
f0 = self.model_fcpe.infer(
x.to(self.device_fcpe).unsqueeze(0).float(),
sr=16000,
decoder_mode="local_argmax",
threshold=0.006,
)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def infer(
self,
input_wav: torch.Tensor,
block_frame_16k,
skip_head,
return_length,
f0method,
) -> np.ndarray:
t1 = ttime()
with torch.no_grad():
if self.config.is_half:
feats = input_wav.half().view(1, -1)
else:
feats = input_wav.float().view(1, -1)
padding_mask = torch.BoolTensor(feats.shape).to(self.device).fill_(False)
inputs = {
"source": feats,
"padding_mask": padding_mask,
"output_layer": 9 if self.version == "v1" else 12,
}
logits = self.model.extract_features(**inputs)
feats = (
self.model.final_proj(logits[0]) if self.version == "v1" else logits[0]
)
feats = torch.cat((feats, feats[:, -1:, :]), 1)
t2 = ttime()
try:
if hasattr(self, "index") and self.index_rate != 0:
npy = feats[0][skip_head // 2 :].cpu().numpy().astype("float32")
score, ix = self.index.search(npy, k=8)
if (ix >= 0).all():
weight = np.square(1 / score)
weight /= weight.sum(axis=1, keepdims=True)
npy = np.sum(
self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1
)
if self.config.is_half:
npy = npy.astype("float16")
feats[0][skip_head // 2 :] = (
torch.from_numpy(npy).unsqueeze(0).to(self.device)
* self.index_rate
+ (1 - self.index_rate) * feats[0][skip_head // 2 :]
)
else:
printt(
"Invalid index. You MUST use added_xxxx.index but not trained_xxxx.index!"
)
else:
printt("Index search FAILED or disabled")
except:
traceback.print_exc()
printt("Index search FAILED")
t3 = ttime()
p_len = input_wav.shape[0] // 160
factor = pow(2, self.formant_shift / 12)
return_length2 = int(np.ceil(return_length * factor))
if self.if_f0 == 1:
f0_extractor_frame = block_frame_16k + 800
if f0method == "rmvpe":
f0_extractor_frame = 5120 * ((f0_extractor_frame - 1) // 5120 + 1) - 160
pitch, pitchf = self.get_f0(
input_wav[-f0_extractor_frame:], self.f0_up_key - self.formant_shift, self.n_cpu, f0method
)
shift = block_frame_16k // 160
self.cache_pitch[:-shift] = self.cache_pitch[shift:].clone()
self.cache_pitchf[:-shift] = self.cache_pitchf[shift:].clone()
self.cache_pitch[4 - pitch.shape[0] :] = pitch[3:-1]
self.cache_pitchf[4 - pitch.shape[0] :] = pitchf[3:-1]
cache_pitch = self.cache_pitch[None, -p_len:]
cache_pitchf = self.cache_pitchf[None, -p_len:] * return_length2 / return_length
t4 = ttime()
feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
feats = feats[:, :p_len, :]
p_len = torch.LongTensor([p_len]).to(self.device)
sid = torch.LongTensor([0]).to(self.device)
skip_head = torch.LongTensor([skip_head])
return_length2 = torch.LongTensor([return_length2])
return_length = torch.LongTensor([return_length])
with torch.no_grad():
if self.if_f0 == 1:
infered_audio, _, _ = self.net_g.infer(
feats,
p_len,
cache_pitch,
cache_pitchf,
sid,
skip_head,
return_length,
return_length2,
)
else:
infered_audio, _, _ = self.net_g.infer(
feats, p_len, sid, skip_head, return_length, return_length2
)
infered_audio = infered_audio.squeeze(1).float()
upp_res = int(np.floor(factor * self.tgt_sr // 100))
if upp_res != self.tgt_sr // 100:
if upp_res not in self.resample_kernel:
self.resample_kernel[upp_res] = Resample(
orig_freq=upp_res,
new_freq=self.tgt_sr // 100,
dtype=torch.float32,
).to(self.device)
infered_audio = self.resample_kernel[upp_res](
infered_audio[:, : return_length * upp_res]
)
t5 = ttime()
printt(
"Spent time: fea = %.3fs, index = %.3fs, f0 = %.3fs, model = %.3fs",
t2 - t1,
t3 - t2,
t4 - t3,
t5 - t4,
)
return infered_audio.squeeze()

View File

@ -52,11 +52,6 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
Returns:
:: (B, Freq, Frame) - Linear-frequency Linear-amplitude spectrogram
"""
# Validation
if torch.min(y) < -1.07:
logger.debug("min value is %s", str(torch.min(y)))
if torch.max(y) > 1.07:
logger.debug("max value is %s", str(torch.max(y)))
# Window - Cache if needed
global hann_window
@ -86,11 +81,11 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
pad_mode="reflect",
normalized=False,
onesided=True,
return_complex=False,
return_complex=True,
)
# Linear-frequency Linear-amplitude spectrogram :: (B, Freq, Frame, RealComplex=2) -> (B, Freq, Frame)
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
spec = torch.sqrt(spec.real.pow(2) + spec.imag.pow(2) + 1e-6)
return spec

View File

@ -278,8 +278,13 @@ def load_wav_to_torch(full_path):
def load_filepaths_and_text(filename, split="|"):
with open(filename, encoding="utf-8") as f:
filepaths_and_text = [line.strip().split(split) for line in f]
try:
with open(filename, encoding="utf-8") as f:
filepaths_and_text = [line.strip().split(split) for line in f]
except UnicodeDecodeError:
with open(filename) as f:
filepaths_and_text = [line.strip().split(split) for line in f]
return filepaths_and_text
@ -312,10 +317,10 @@ def get_hparams(init=True):
"-te", "--total_epoch", type=int, required=True, help="total_epoch"
)
parser.add_argument(
"-pg", "--pretrainG", type=str, default="", help="Pretrained Discriminator path"
"-pg", "--pretrainG", type=str, default="", help="Pretrained Generator path"
)
parser.add_argument(
"-pd", "--pretrainD", type=str, default="", help="Pretrained Generator path"
"-pd", "--pretrainD", type=str, default="", help="Pretrained Discriminator path"
)
parser.add_argument("-g", "--gpus", type=str, default="0", help="split by -")
parser.add_argument(

View File

@ -43,8 +43,8 @@ def wave_to_spectrogram(
wave_left = np.asfortranarray(wave[0])
wave_right = np.asfortranarray(wave[1])
spec_left = librosa.stft(wave_left, n_fft, hop_length=hop_length)
spec_right = librosa.stft(wave_right, n_fft, hop_length=hop_length)
spec_left = librosa.stft(wave_left, n_fft=n_fft, hop_length=hop_length)
spec_right = librosa.stft(wave_right, n_fft=n_fft, hop_length=hop_length)
spec = np.asfortranarray([spec_left, spec_right])
@ -78,7 +78,7 @@ def wave_to_spectrogram_mt(
kwargs={"y": wave_left, "n_fft": n_fft, "hop_length": hop_length},
)
thread.start()
spec_right = librosa.stft(wave_right, n_fft, hop_length=hop_length)
spec_right = librosa.stft(wave_right, n_fft=n_fft, hop_length=hop_length)
thread.join()
spec = np.asfortranarray([spec_left, spec_right])
@ -230,26 +230,30 @@ def cache_or_load(mix_path, inst_path, mp):
if d == len(mp.param["band"]): # high-end band
X_wave[d], _ = librosa.load(
mix_path, bp["sr"], False, dtype=np.float32, res_type=bp["res_type"]
mix_path,
sr=bp["sr"],
mono=False,
dtype=np.float32,
res_type=bp["res_type"]
)
y_wave[d], _ = librosa.load(
inst_path,
bp["sr"],
False,
sr=bp["sr"],
mono=False,
dtype=np.float32,
res_type=bp["res_type"],
)
else: # lower bands
X_wave[d] = librosa.resample(
X_wave[d + 1],
mp.param["band"][d + 1]["sr"],
bp["sr"],
orig_sr=mp.param["band"][d + 1]["sr"],
target_sr=bp["sr"],
res_type=bp["res_type"],
)
y_wave[d] = librosa.resample(
y_wave[d + 1],
mp.param["band"][d + 1]["sr"],
bp["sr"],
orig_sr=mp.param["band"][d + 1]["sr"],
target_sr=bp["sr"],
res_type=bp["res_type"],
)
@ -401,8 +405,8 @@ def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None):
mp.param["mid_side_b2"],
mp.param["reverse"],
),
bp["sr"],
sr,
orig_sr=bp["sr"],
target_sr=sr,
res_type="sinc_fastest",
)
else: # mid
@ -419,7 +423,7 @@ def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None):
),
)
# wave = librosa.core.resample(wave2, bp['sr'], sr, res_type="sinc_fastest")
wave = librosa.core.resample(wave2, bp["sr"], sr, res_type="scipy")
wave = librosa.resample(wave2, orig_sr=bp["sr"], target_sr=sr, res_type="scipy")
return wave.T
@ -506,8 +510,8 @@ def ensembling(a, specs):
def stft(wave, nfft, hl):
wave_left = np.asfortranarray(wave[0])
wave_right = np.asfortranarray(wave[1])
spec_left = librosa.stft(wave_left, nfft, hop_length=hl)
spec_right = librosa.stft(wave_right, nfft, hop_length=hl)
spec_left = librosa.stft(wave_left, n_fft=nfft, hop_length=hl)
spec_right = librosa.stft(wave_right, n_fft=nfft, hop_length=hl)
spec = np.asfortranarray([spec_left, spec_right])
return spec
@ -569,8 +573,8 @@ if __name__ == "__main__":
if d == len(mp.param["band"]): # high-end band
wave[d], _ = librosa.load(
args.input[i],
bp["sr"],
False,
sr=bp["sr"],
mono=False,
dtype=np.float32,
res_type=bp["res_type"],
)
@ -580,8 +584,8 @@ if __name__ == "__main__":
else: # lower bands
wave[d] = librosa.resample(
wave[d + 1],
mp.param["band"][d + 1]["sr"],
bp["sr"],
orig_sr=mp.param["band"][d + 1]["sr"],
target_sr=bp["sr"],
res_type=bp["res_type"],
)

View File

@ -62,12 +62,12 @@ def torch_bmm(input, mat2, *, out=None):
): # pylint: disable=invalid-name
start_idx_2 = i2 * split_2_slice_size
end_idx_2 = (i2 + 1) * split_2_slice_size
hidden_states[
start_idx:end_idx, start_idx_2:end_idx_2
] = original_torch_bmm(
input[start_idx:end_idx, start_idx_2:end_idx_2],
mat2[start_idx:end_idx, start_idx_2:end_idx_2],
out=out,
hidden_states[start_idx:end_idx, start_idx_2:end_idx_2] = (
original_torch_bmm(
input[start_idx:end_idx, start_idx_2:end_idx_2],
mat2[start_idx:end_idx, start_idx_2:end_idx_2],
out=out,
)
)
else:
hidden_states[start_idx:end_idx] = original_torch_bmm(
@ -138,61 +138,67 @@ def scaled_dot_product_attention(
start_idx_2 = i2 * split_2_slice_size
end_idx_2 = (i2 + 1) * split_2_slice_size
if no_shape_one:
hidden_states[
start_idx:end_idx, start_idx_2:end_idx_2
] = original_scaled_dot_product_attention(
query[start_idx:end_idx, start_idx_2:end_idx_2],
key[start_idx:end_idx, start_idx_2:end_idx_2],
value[start_idx:end_idx, start_idx_2:end_idx_2],
attn_mask=attn_mask[
start_idx:end_idx, start_idx_2:end_idx_2
]
if attn_mask is not None
else attn_mask,
dropout_p=dropout_p,
is_causal=is_causal,
hidden_states[start_idx:end_idx, start_idx_2:end_idx_2] = (
original_scaled_dot_product_attention(
query[start_idx:end_idx, start_idx_2:end_idx_2],
key[start_idx:end_idx, start_idx_2:end_idx_2],
value[start_idx:end_idx, start_idx_2:end_idx_2],
attn_mask=(
attn_mask[start_idx:end_idx, start_idx_2:end_idx_2]
if attn_mask is not None
else attn_mask
),
dropout_p=dropout_p,
is_causal=is_causal,
)
)
else:
hidden_states[
:, start_idx:end_idx, start_idx_2:end_idx_2
] = original_scaled_dot_product_attention(
query[:, start_idx:end_idx, start_idx_2:end_idx_2],
key[:, start_idx:end_idx, start_idx_2:end_idx_2],
value[:, start_idx:end_idx, start_idx_2:end_idx_2],
attn_mask=attn_mask[
:, start_idx:end_idx, start_idx_2:end_idx_2
]
if attn_mask is not None
else attn_mask,
dropout_p=dropout_p,
is_causal=is_causal,
hidden_states[:, start_idx:end_idx, start_idx_2:end_idx_2] = (
original_scaled_dot_product_attention(
query[:, start_idx:end_idx, start_idx_2:end_idx_2],
key[:, start_idx:end_idx, start_idx_2:end_idx_2],
value[:, start_idx:end_idx, start_idx_2:end_idx_2],
attn_mask=(
attn_mask[
:, start_idx:end_idx, start_idx_2:end_idx_2
]
if attn_mask is not None
else attn_mask
),
dropout_p=dropout_p,
is_causal=is_causal,
)
)
else:
if no_shape_one:
hidden_states[
start_idx:end_idx
] = original_scaled_dot_product_attention(
query[start_idx:end_idx],
key[start_idx:end_idx],
value[start_idx:end_idx],
attn_mask=attn_mask[start_idx:end_idx]
if attn_mask is not None
else attn_mask,
dropout_p=dropout_p,
is_causal=is_causal,
hidden_states[start_idx:end_idx] = (
original_scaled_dot_product_attention(
query[start_idx:end_idx],
key[start_idx:end_idx],
value[start_idx:end_idx],
attn_mask=(
attn_mask[start_idx:end_idx]
if attn_mask is not None
else attn_mask
),
dropout_p=dropout_p,
is_causal=is_causal,
)
)
else:
hidden_states[
:, start_idx:end_idx
] = original_scaled_dot_product_attention(
query[:, start_idx:end_idx],
key[:, start_idx:end_idx],
value[:, start_idx:end_idx],
attn_mask=attn_mask[:, start_idx:end_idx]
if attn_mask is not None
else attn_mask,
dropout_p=dropout_p,
is_causal=is_causal,
hidden_states[:, start_idx:end_idx] = (
original_scaled_dot_product_attention(
query[:, start_idx:end_idx],
key[:, start_idx:end_idx],
value[:, start_idx:end_idx],
attn_mask=(
attn_mask[:, start_idx:end_idx]
if attn_mask is not None
else attn_mask
),
dropout_p=dropout_p,
is_causal=is_causal,
)
)
else:
return original_scaled_dot_product_attention(

View File

@ -104,11 +104,11 @@ def return_xpu(device):
return (
f"xpu:{device[-1]}"
if isinstance(device, str) and ":" in device
else f"xpu:{device}"
if isinstance(device, int)
else torch.device("xpu")
if isinstance(device, torch.device)
else "xpu"
else (
f"xpu:{device}"
if isinstance(device, int)
else torch.device("xpu") if isinstance(device, torch.device) else "xpu"
)
)
@ -271,12 +271,16 @@ def ipex_hijacks():
"torch.batch_norm",
lambda orig_func, input, weight, bias, *args, **kwargs: orig_func(
input,
weight
if weight is not None
else torch.ones(input.size()[1], device=input.device),
bias
if bias is not None
else torch.zeros(input.size()[1], device=input.device),
(
weight
if weight is not None
else torch.ones(input.size()[1], device=input.device)
),
(
bias
if bias is not None
else torch.zeros(input.size()[1], device=input.device)
),
*args,
**kwargs,
),
@ -286,12 +290,16 @@ def ipex_hijacks():
"torch.instance_norm",
lambda orig_func, input, weight, bias, *args, **kwargs: orig_func(
input,
weight
if weight is not None
else torch.ones(input.size()[1], device=input.device),
bias
if bias is not None
else torch.zeros(input.size()[1], device=input.device),
(
weight
if weight is not None
else torch.ones(input.size()[1], device=input.device)
),
(
bias
if bias is not None
else torch.zeros(input.size()[1], device=input.device)
),
*args,
**kwargs,
),

View File

@ -1,8 +1,8 @@
import torch
import onnxsim
import onnx
from infer.lib.infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
def export_onnx(ModelPath, ExportedPath):
cpt = torch.load(ModelPath, map_location="cpu")
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0]
@ -44,9 +44,11 @@ def export_onnx(ModelPath, ExportedPath):
"rnd": [2],
},
do_constant_folding=False,
opset_version=13,
opset_version=18,
verbose=False,
input_names=input_names,
output_names=output_names,
)
model, _ = onnxsim.simplify(ExportedPath)
onnx.save(model, ExportedPath)
return "Finished"

View File

@ -143,7 +143,7 @@ if __name__ == "__main__":
# exp_dir=r"E:\codes\py39\dataset\mi-test"
# n_p=16
# f = open("%s/log_extract_f0.log"%exp_dir, "w")
printt(sys.argv)
printt(" ".join(sys.argv))
featureInput = FeatureInput()
paths = []
inp_root = "%s/1_16k_wavs" % (exp_dir)

View File

@ -106,7 +106,7 @@ if __name__ == "__main__":
# exp_dir=r"E:\codes\py39\dataset\mi-test"
# n_p=16
# f = open("%s/log_extract_f0.log"%exp_dir, "w")
printt(sys.argv)
printt(" ".join(sys.argv))
featureInput = FeatureInput()
paths = []
inp_root = "%s/1_16k_wavs" % (exp_dir)

View File

@ -104,7 +104,7 @@ if __name__ == "__main__":
# exp_dir=r"E:\codes\py39\dataset\mi-test"
# n_p=16
# f = open("%s/log_extract_f0.log"%exp_dir, "w")
printt(sys.argv)
printt(" ".join(sys.argv))
featureInput = FeatureInput()
paths = []
inp_root = "%s/1_16k_wavs" % (exp_dir)

View File

@ -8,14 +8,16 @@ os.environ["PYTORCH_MPS_HIGH_WATERMARK_RATIO"] = "0.0"
device = sys.argv[1]
n_part = int(sys.argv[2])
i_part = int(sys.argv[3])
if len(sys.argv) == 6:
if len(sys.argv) == 7:
exp_dir = sys.argv[4]
version = sys.argv[5]
is_half = sys.argv[6].lower() == "true"
else:
i_gpu = sys.argv[4]
exp_dir = sys.argv[5]
os.environ["CUDA_VISIBLE_DEVICES"] = str(i_gpu)
version = sys.argv[6]
is_half = sys.argv[7].lower() == "true"
import fairseq
import numpy as np
import soundfile as sf
@ -49,10 +51,10 @@ def printt(strr):
f.flush()
printt(sys.argv)
printt(" ".join(sys.argv))
model_path = "assets/hubert/hubert_base.pt"
printt(exp_dir)
printt("exp_dir: " + exp_dir)
wavPath = "%s/1_16k_wavs" % exp_dir
outPath = (
"%s/3_feature256" % exp_dir if version == "v1" else "%s/3_feature768" % exp_dir
@ -91,8 +93,9 @@ models, saved_cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task(
model = models[0]
model = model.to(device)
printt("move model to %s" % device)
if device not in ["mps", "cpu"]:
model = model.half()
if is_half:
if device not in ["mps", "cpu"]:
model = model.half()
model.eval()
todo = sorted(list(os.listdir(wavPath)))[i_part::n_part]
@ -113,9 +116,11 @@ else:
feats = readwave(wav_path, normalize=saved_cfg.task.normalize)
padding_mask = torch.BoolTensor(feats.shape).fill_(False)
inputs = {
"source": feats.half().to(device)
if device not in ["mps", "cpu"]
else feats.to(device),
"source": (
feats.half().to(device)
if is_half and device not in ["mps", "cpu"]
else feats.to(device)
),
"padding_mask": padding_mask.to(device),
"output_layer": 9 if version == "v1" else 12, # layer 9
}

View File

@ -6,14 +6,13 @@ from scipy import signal
now_dir = os.getcwd()
sys.path.append(now_dir)
print(sys.argv)
print(*sys.argv[1:])
inp_root = sys.argv[1]
sr = int(sys.argv[2])
n_p = int(sys.argv[3])
exp_dir = sys.argv[4]
noparallel = sys.argv[5] == "True"
per = float(sys.argv[6])
import multiprocessing
import os
import traceback
@ -24,16 +23,13 @@ from scipy.io import wavfile
from infer.lib.audio import load_audio
from infer.lib.slicer2 import Slicer
mutex = multiprocessing.Lock()
f = open("%s/preprocess.log" % exp_dir, "a+")
def println(strr):
mutex.acquire()
print(strr)
f.write("%s\n" % strr)
f.flush()
mutex.release()
class PreProcess:
@ -104,9 +100,9 @@ class PreProcess:
idx1 += 1
break
self.norm_write(tmp_audio, idx0, idx1)
println("%s->Suc." % path)
println("%s\t-> Success" % path)
except:
println("%s->%s" % (path, traceback.format_exc()))
println("%s\t-> %s" % (path, traceback.format_exc()))
def pipeline_mp(self, infos):
for path, idx0 in infos:
@ -138,7 +134,6 @@ class PreProcess:
def preprocess_trainset(inp_root, sr, n_p, exp_dir, per):
pp = PreProcess(sr, exp_dir, per)
println("start preprocess")
println(sys.argv)
pp.pipeline_mp_inp_dir(inp_root, n_p)
println("end preprocess")

View File

@ -23,16 +23,14 @@ try:
if torch.xpu.is_available():
from infer.modules.ipex import ipex_init
ipex_init()
from torch.xpu.amp import autocast
from infer.modules.ipex.gradscaler import gradscaler_init
from torch.xpu.amp import autocast
GradScaler = gradscaler_init()
ipex_init()
else:
from torch.cuda.amp import GradScaler, autocast
except Exception: # pylint: disable=broad-exception-caught
except Exception:
from torch.cuda.amp import GradScaler, autocast
torch.backends.cudnn.deterministic = False
@ -101,7 +99,7 @@ def main():
n_gpus = 1
if n_gpus < 1:
# patch to unblock people without gpus. there is probably a better way.
logger.warning("NO GPU DETECTED: falling back to CPU - this may take a while")
print("NO GPU DETECTED: falling back to CPU - this may take a while")
n_gpus = 1
os.environ["MASTER_ADDR"] = "localhost"
os.environ["MASTER_PORT"] = str(randint(20000, 55555))

View File

@ -216,16 +216,26 @@ class Predictor:
path_other = "%s/%s_others.wav" % (others_root, basename)
sf.write(path_vocal, mix - opt, rate)
sf.write(path_other, opt, rate)
opt_path_vocal = path_vocal[:-4] + ".%s" % format
opt_path_other = path_other[:-4] + ".%s" % format
if os.path.exists(path_vocal):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path_vocal, path_vocal[:-4] + ".%s" % format)
'ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path_vocal, opt_path_vocal)
)
if os.path.exists(opt_path_vocal):
try:
os.remove(path_vocal)
except:
pass
if os.path.exists(path_other):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path_other, path_other[:-4] + ".%s" % format)
'ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path_other, opt_path_other)
)
if os.path.exists(opt_path_other):
try:
os.remove(path_other)
except:
pass
class MDXNetDereverb:
@ -242,5 +252,5 @@ class MDXNetDereverb:
self.pred = Predictor(self)
self.device = device
def path_audio(self, input, vocal_root, others_root, format):
def _path_audio_(self, input, vocal_root, others_root, format, is_hp3=False):
self.pred.prediction(input, vocal_root, others_root, format)

View File

@ -9,7 +9,7 @@ import torch
from configs.config import Config
from infer.modules.uvr5.mdxnet import MDXNetDereverb
from infer.modules.uvr5.preprocess import AudioPre, AudioPreDeEcho
from infer.modules.uvr5.vr import AudioPre, AudioPreDeEcho
config = Config()
@ -36,6 +36,7 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
device=config.device,
is_half=config.is_half,
)
is_hp3 = "HP3" in model_name
if inp_root != "":
paths = [os.path.join(inp_root, name) for name in os.listdir(inp_root)]
else:
@ -52,7 +53,7 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
):
need_reformat = 0
pre_fun._path_audio_(
inp_path, save_root_ins, save_root_vocal, format0
inp_path, save_root_ins, save_root_vocal, format0, is_hp3=is_hp3
)
done = 1
except:
@ -64,13 +65,13 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
os.path.basename(inp_path),
)
os.system(
"ffmpeg -i %s -vn -acodec pcm_s16le -ac 2 -ar 44100 %s -y"
'ffmpeg -i "%s" -vn -acodec pcm_s16le -ac 2 -ar 44100 "%s" -y'
% (inp_path, tmp_path)
)
inp_path = tmp_path
try:
if done == 0:
pre_fun.path_audio(
pre_fun._path_audio_(
inp_path, save_root_ins, save_root_vocal, format0
)
infos.append("%s->Success" % (os.path.basename(inp_path)))

View File

@ -41,7 +41,9 @@ class AudioPre:
self.mp = mp
self.model = model
def _path_audio_(self, music_file, ins_root=None, vocal_root=None, format="flac"):
def _path_audio_(
self, music_file, ins_root=None, vocal_root=None, format="flac", is_hp3=False
):
if ins_root is None and vocal_root is None:
return "No save root."
name = os.path.basename(music_file)
@ -58,20 +60,20 @@ class AudioPre:
(
X_wave[d],
_,
) = librosa.core.load( # 理论上librosa读取可能对某些音频有bug应该上ffmpeg读取但是太麻烦了弃坑
) = librosa.load( # 理论上librosa读取可能对某些音频有bug应该上ffmpeg读取但是太麻烦了弃坑
music_file,
bp["sr"],
False,
sr=bp["sr"],
mono=False,
dtype=np.float32,
res_type=bp["res_type"],
)
if X_wave[d].ndim == 1:
X_wave[d] = np.asfortranarray([X_wave[d], X_wave[d]])
else: # lower bands
X_wave[d] = librosa.core.resample(
X_wave[d] = librosa.resample(
X_wave[d + 1],
self.mp.param["band"][d + 1]["sr"],
bp["sr"],
orig_sr=self.mp.param["band"][d + 1]["sr"],
target_sr=bp["sr"],
res_type=bp["res_type"],
)
# Stft of wave source
@ -120,18 +122,22 @@ class AudioPre:
else:
wav_instrument = spec_utils.cmb_spectrogram_to_wave(y_spec_m, self.mp)
logger.info("%s instruments done" % name)
if is_hp3 == True:
head = "vocal_"
else:
head = "instrument_"
if format in ["wav", "flac"]:
sf.write(
os.path.join(
ins_root,
"instrument_{}_{}.{}".format(name, self.data["agg"], format),
head + "{}_{}.{}".format(name, self.data["agg"], format),
),
(np.array(wav_instrument) * 32768).astype("int16"),
self.mp.param["sr"],
) #
else:
path = os.path.join(
ins_root, "instrument_{}_{}.wav".format(name, self.data["agg"])
ins_root, head + "{}_{}.wav".format(name, self.data["agg"])
)
sf.write(
path,
@ -139,11 +145,18 @@ class AudioPre:
self.mp.param["sr"],
)
if os.path.exists(path):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path, path[:-4] + ".%s" % format)
)
opt_format_path = path[:-4] + ".%s" % format
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
if os.path.exists(opt_format_path):
try:
os.remove(path)
except:
pass
if vocal_root is not None:
if is_hp3 == True:
head = "instrument_"
else:
head = "vocal_"
if self.data["high_end_process"].startswith("mirroring"):
input_high_end_ = spec_utils.mirroring(
self.data["high_end_process"], v_spec_m, input_high_end, self.mp
@ -158,14 +171,14 @@ class AudioPre:
sf.write(
os.path.join(
vocal_root,
"vocal_{}_{}.{}".format(name, self.data["agg"], format),
head + "{}_{}.{}".format(name, self.data["agg"], format),
),
(np.array(wav_vocals) * 32768).astype("int16"),
self.mp.param["sr"],
)
else:
path = os.path.join(
vocal_root, "vocal_{}_{}.wav".format(name, self.data["agg"])
vocal_root, head + "{}_{}.wav".format(name, self.data["agg"])
)
sf.write(
path,
@ -173,10 +186,13 @@ class AudioPre:
self.mp.param["sr"],
)
if os.path.exists(path):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path, path[:-4] + ".%s" % format)
)
opt_format_path = path[:-4] + ".%s" % format
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
if os.path.exists(opt_format_path):
try:
os.remove(path)
except:
pass
class AudioPreDeEcho:
@ -207,7 +223,7 @@ class AudioPreDeEcho:
self.model = model
def _path_audio_(
self, music_file, vocal_root=None, ins_root=None, format="flac"
self, music_file, vocal_root=None, ins_root=None, format="flac", is_hp3=False
): # 3个VR模型vocal和ins是反的
if ins_root is None and vocal_root is None:
return "No save root."
@ -225,20 +241,20 @@ class AudioPreDeEcho:
(
X_wave[d],
_,
) = librosa.core.load( # 理论上librosa读取可能对某些音频有bug应该上ffmpeg读取但是太麻烦了弃坑
) = librosa.load( # 理论上librosa读取可能对某些音频有bug应该上ffmpeg读取但是太麻烦了弃坑
music_file,
bp["sr"],
False,
sr=bp["sr"],
mono=False,
dtype=np.float32,
res_type=bp["res_type"],
)
if X_wave[d].ndim == 1:
X_wave[d] = np.asfortranarray([X_wave[d], X_wave[d]])
else: # lower bands
X_wave[d] = librosa.core.resample(
X_wave[d] = librosa.resample(
X_wave[d + 1],
self.mp.param["band"][d + 1]["sr"],
bp["sr"],
orig_sr=self.mp.param["band"][d + 1]["sr"],
target_sr=bp["sr"],
res_type=bp["res_type"],
)
# Stft of wave source
@ -291,14 +307,14 @@ class AudioPreDeEcho:
sf.write(
os.path.join(
ins_root,
"instrument_{}_{}.{}".format(name, self.data["agg"], format),
"vocal_{}_{}.{}".format(name, self.data["agg"], format),
),
(np.array(wav_instrument) * 32768).astype("int16"),
self.mp.param["sr"],
) #
else:
path = os.path.join(
ins_root, "instrument_{}_{}.wav".format(name, self.data["agg"])
ins_root, "vocal_{}_{}.wav".format(name, self.data["agg"])
)
sf.write(
path,
@ -306,10 +322,13 @@ class AudioPreDeEcho:
self.mp.param["sr"],
)
if os.path.exists(path):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path, path[:-4] + ".%s" % format)
)
opt_format_path = path[:-4] + ".%s" % format
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
if os.path.exists(opt_format_path):
try:
os.remove(path)
except:
pass
if vocal_root is not None:
if self.data["high_end_process"].startswith("mirroring"):
input_high_end_ = spec_utils.mirroring(
@ -325,14 +344,14 @@ class AudioPreDeEcho:
sf.write(
os.path.join(
vocal_root,
"vocal_{}_{}.{}".format(name, self.data["agg"], format),
"instrument_{}_{}.{}".format(name, self.data["agg"], format),
),
(np.array(wav_vocals) * 32768).astype("int16"),
self.mp.param["sr"],
)
else:
path = os.path.join(
vocal_root, "vocal_{}_{}.wav".format(name, self.data["agg"])
vocal_root, "instrument_{}_{}.wav".format(name, self.data["agg"])
)
sf.write(
path,
@ -340,7 +359,10 @@ class AudioPreDeEcho:
self.mp.param["sr"],
)
if os.path.exists(path):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path, path[:-4] + ".%s" % format)
)
opt_format_path = path[:-4] + ".%s" % format
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
if os.path.exists(opt_format_path):
try:
os.remove(path)
except:
pass

View File

@ -38,26 +38,28 @@ class VC:
to_return_protect0 = {
"visible": self.if_f0 != 0,
"value": to_return_protect[0]
if self.if_f0 != 0 and to_return_protect
else 0.5,
"value": (
to_return_protect[0] if self.if_f0 != 0 and to_return_protect else 0.5
),
"__type__": "update",
}
to_return_protect1 = {
"visible": self.if_f0 != 0,
"value": to_return_protect[1]
if self.if_f0 != 0 and to_return_protect
else 0.33,
"value": (
to_return_protect[1] if self.if_f0 != 0 and to_return_protect else 0.33
),
"__type__": "update",
}
if sid == "" or sid == []:
if self.hubert_model is not None: # 考虑到轮询, 需要加个判断看是否 sid 是由有模型切换到无模型的
if (
self.hubert_model is not None
): # 考虑到轮询, 需要加个判断看是否 sid 是由有模型切换到无模型的
logger.info("Clean model cache")
del (self.net_g, self.n_spk, self.hubert_model, self.tgt_sr) # ,cpt
self.hubert_model = (
self.net_g
) = self.n_spk = self.hubert_model = self.tgt_sr = None
self.hubert_model = self.net_g = self.n_spk = self.hubert_model = (
self.tgt_sr
) = None
if torch.cuda.is_available():
torch.cuda.empty_cache()
###楼下不这么折腾清理不干净
@ -169,8 +171,8 @@ class VC:
if self.hubert_model is None:
self.hubert_model = load_hubert(self.config)
file_index = (
(
if file_index:
file_index = (
file_index.strip(" ")
.strip('"')
.strip("\n")
@ -178,9 +180,10 @@ class VC:
.strip(" ")
.replace("trained", "added")
)
if file_index != ""
else file_index2
) # 防止小白写错,自动帮他替换掉
elif file_index2:
file_index = file_index2
else:
file_index = "" # 防止小白写错,自动帮他替换掉
audio_opt = self.pipeline.pipeline(
self.hubert_model,

View File

@ -321,14 +321,14 @@ class Pipeline(object):
if audio_pad.shape[0] > self.t_max:
audio_sum = np.zeros_like(audio)
for i in range(self.window):
audio_sum += audio_pad[i : i - self.window]
audio_sum += np.abs(audio_pad[i : i - self.window])
for t in range(self.t_center, audio.shape[0], self.t_center):
opt_ts.append(
t
- self.t_query
+ np.where(
np.abs(audio_sum[t - self.t_query : t + self.t_query])
== np.abs(audio_sum[t - self.t_query : t + self.t_query]).min()
audio_sum[t - self.t_query : t + self.t_query]
== audio_sum[t - self.t_query : t + self.t_query].min()
)[0][0]
)
s = 0

5175
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,56 +6,57 @@ authors = ["lj1995"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
torch = "^2.0.0"
torchaudio = "^2.0.1"
Cython = "^0.29.34"
gradio = "^3.34.0"
future = "^0.18.3"
pydub = "^0.25.1"
soundfile = "^0.12.1"
ffmpeg-python = "^0.2.0"
tensorboardX = "^2.6"
functorch = "^2.0.0"
fairseq = "^0.12.2"
faiss-cpu = "^1.7.2"
Jinja2 = "^3.1.2"
json5 = "^0.9.11"
python = "^3.9"
torch = "2.4.0"
torchaudio = "2.4.0"
Cython = "^3.0.11"
gradio = "3.34.0"
pydub = ">=0.25.1"
soundfile = ">=0.12.1"
ffmpeg-python = ">=0.2.0"
tensorboardX = "^2.6.2.2"
fairseq = "0.12.2"
faiss-cpu = "1.7.3"
Jinja2 = ">=3.1.2"
json5 = "^0.9.25"
librosa = "0.9.1"
llvmlite = "0.39.0"
Markdown = "^3.4.3"
matplotlib = "^3.7.1"
matplotlib-inline = "^0.1.6"
Markdown = "^3.6"
matplotlib = ">=3.7.0"
matplotlib-inline = ">=0.1.3"
numba = "0.56.4"
numpy = "1.23.5"
scipy = "1.9.3"
praat-parselmouth = "^0.4.3"
Pillow = "9.3.0"
pyworld = "^0.3.2"
resampy = "^0.4.2"
scikit-learn = "^1.2.2"
starlette = "^0.27.0"
tensorboard = "^2.12.1"
tensorboard-data-server = "^0.7.0"
tensorboard-plugin-wit = "^1.8.1"
torchgen = "^0.0.1"
tqdm = "^4.65.0"
tornado = "^6.3"
Werkzeug = "^2.2.3"
uc-micro-py = "^1.0.1"
sympy = "^1.11.1"
tabulate = "^0.9.0"
PyYAML = "^6.0"
pyasn1 = "^0.4.8"
pyasn1-modules = "^0.2.8"
fsspec = "^2023.3.0"
absl-py = "^1.4.0"
audioread = "^3.0.0"
uvicorn = "^0.21.1"
colorama = "^0.4.6"
scipy = "1.13.1"
praat-parselmouth = ">=0.4.2"
Pillow = ">=9.1.1"
pyworld = "0.3.2"
resampy = ">=0.4.2"
scikit-learn = "^1.5.1"
tensorboard = "^2.17.0"
tqdm = ">=4.63.1"
tornado = ">=6.1"
Werkzeug = ">=2.2.3"
uc-micro-py = ">=1.0.1"
sympy = ">=1.11.1"
tabulate = ">=0.8.10"
PyYAML = ">=6.0"
pyasn1 = ">=0.4.8"
pyasn1-modules = ">=0.2.8"
fsspec = ">=2022.11.0"
absl-py = ">=1.2.0"
audioread = "^3.0.1"
uvicorn = ">=0.21.1"
colorama = ">=0.4.5"
torchcrepe = "0.0.20"
python-dotenv = "^1.0.0"
python-dotenv = ">=1.0.0"
av = "^12.3.0"
joblib = ">=1.1.0"
httpx = "^0.27.0"
onnxruntime-gpu = "^1.18.1"
fastapi = "0.88"
torchfcpe = "^0.0.4"
ffmpy = "0.3.1"
torchvision = "0.19.0"
[tool.poetry.dev-dependencies]
[build-system]

View File

@ -3,7 +3,7 @@ joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy
librosa==0.9.1
librosa==0.10.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.3
@ -41,8 +41,9 @@ pyworld==0.3.2
httpx
onnxruntime
onnxruntime-gpu
torchcrepe==0.0.20
torchcrepe==0.0.23
fastapi==0.88
ffmpy==0.3.1
python-dotenv>=1.0.0
av
torchfcpe

View File

@ -2,7 +2,7 @@ joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy
librosa==0.9.1
librosa==0.10.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.3
@ -39,8 +39,9 @@ colorama>=0.4.5
pyworld==0.3.2
httpx
onnxruntime-directml
torchcrepe==0.0.20
torchcrepe==0.0.23
fastapi==0.88
ffmpy==0.3.1
python-dotenv>=1.0.0
av
torchfcpe

View File

@ -7,7 +7,7 @@ joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy
librosa==0.9.1
librosa==0.10.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.3
@ -45,10 +45,11 @@ pyworld==0.3.2
httpx
onnxruntime; sys_platform == 'darwin'
onnxruntime-gpu; sys_platform != 'darwin'
torchcrepe==0.0.20
torchcrepe==0.0.23
fastapi==0.88
ffmpy==0.3.1
python-dotenv>=1.0.0
av
PySimpleGUI
sounddevice
sounddevice<0.5.0
torchfcpe

48
requirements-py311.txt Normal file
View File

@ -0,0 +1,48 @@
joblib>=1.1.0
numba
numpy
scipy
librosa==0.10.2
llvmlite
fairseq @ git+https://github.com/One-sixth/fairseq.git
faiss-cpu
gradio==3.34.0
Cython
pydub>=0.25.1
soundfile>=0.12.1
ffmpeg-python>=0.2.0
tensorboardX
Jinja2>=3.1.2
json5
Markdown
matplotlib>=3.7.0
matplotlib-inline>=0.1.3
praat-parselmouth>=0.4.2
Pillow>=9.1.1
resampy>=0.4.2
scikit-learn
tensorboard
tqdm>=4.63.1
tornado>=6.1
Werkzeug>=2.2.3
uc-micro-py>=1.0.1
sympy>=1.11.1
tabulate>=0.8.10
PyYAML>=6.0
pyasn1>=0.4.8
pyasn1-modules>=0.2.8
fsspec>=2022.11.0
absl-py>=1.2.0
audioread
uvicorn>=0.21.1
colorama>=0.4.5
pyworld==0.3.2
httpx
onnxruntime; sys_platform == 'darwin'
onnxruntime-gpu; sys_platform != 'darwin'
torchcrepe==0.0.23
fastapi==0.88
torchfcpe
ffmpy==0.3.1
python-dotenv>=1.0.0
av

View File

@ -23,7 +23,8 @@ tensorboard
tqdm
wave
PySimpleGUI
sounddevice
sounddevice<0.5.0
gradio
noisereduce
onnxruntime-directml
onnxruntime-directml
torchfcpe

View File

@ -23,6 +23,7 @@ tensorboard
tqdm
wave
PySimpleGUI
sounddevice
sounddevice<0.5.0
gradio
noisereduce
torchfcpe

View File

@ -1,3 +1,4 @@
aria2
joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
@ -42,6 +43,7 @@ onnxruntime; sys_platform == 'darwin'
onnxruntime-gpu; sys_platform != 'darwin'
torchcrepe==0.0.20
fastapi==0.88
torchfcpe
ffmpy==0.3.1
python-dotenv>=1.0.0
av

29
run.sh
View File

@ -1,27 +1,27 @@
#!/bin/bash
#!/bin/sh
if [[ "$(uname)" == "Darwin" ]]; then
if [ "$(uname)" = "Darwin" ]; then
# macOS specific env:
export PYTORCH_ENABLE_MPS_FALLBACK=1
export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0
elif [[ "$(uname)" != "Linux" ]]; then
elif [ "$(uname)" != "Linux" ]; then
echo "Unsupported operating system."
exit 1
fi
if [ -d ".venv" ]; then
echo "Activate venv..."
source .venv/bin/activate
. .venv/bin/activate
else
echo "Create venv..."
requirements_file="requirements.txt"
# Check if Python 3.8 is installed
if ! command -v python3 &> /dev/null; then
if ! command -v python3.8 >/dev/null 2>&1 || pyenv versions --bare | grep -q "3.8"; then
echo "Python 3 not found. Attempting to install 3.8..."
if [[ "$(uname)" == "Darwin" ]] && command -v brew &> /dev/null; then
if [ "$(uname)" = "Darwin" ] && command -v brew >/dev/null 2>&1; then
brew install python@3.8
elif [[ "$(uname)" == "Linux" ]] && command -v apt-get &> /dev/null; then
elif [ "$(uname)" = "Linux" ] && command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install python3.8
else
@ -30,18 +30,18 @@ else
fi
fi
python3 -m venv .venv
source .venv/bin/activate
python3.8 -m venv .venv
. .venv/bin/activate
# Check if required packages are installed and install them if not
if [ -f "${requirements_file}" ]; then
installed_packages=$(python3 -m pip freeze)
installed_packages=$(python3.8 -m pip freeze)
while IFS= read -r package; do
[[ "${package}" =~ ^#.* ]] && continue
expr "${package}" : "^#.*" > /dev/null && continue
package_name=$(echo "${package}" | sed 's/[<>=!].*//')
if ! echo "${installed_packages}" | grep -q "${package_name}"; then
echo "${package_name} not found. Attempting to install..."
python3 -m pip install --upgrade "${package}"
python3.8 -m pip install --upgrade "${package}"
fi
done < "${requirements_file}"
else
@ -51,11 +51,12 @@ else
fi
# Download models
chmod +x tools/dlmodels.sh
./tools/dlmodels.sh
if [[ $? -ne 0 ]]; then
if [ $? -ne 0 ]; then
exit 1
fi
# Run the main script
python3 infer-web.py --pycmd python3
python3.8 infer-web.py --pycmd python3.8

View File

@ -59,12 +59,18 @@ with app:
)
sid.change(fn=vc.get_vc, inputs=[sid], outputs=[spk_item])
gr.Markdown(
value=i18n("男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ")
value=i18n(
"男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. "
)
)
vc_input3 = gr.Audio(label="上传音频长度小于90秒")
vc_transform0 = gr.Number(label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"), value=0)
vc_transform0 = gr.Number(
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"), value=0
)
f0method0 = gr.Radio(
label=i18n("选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU"),
label=i18n(
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU"
),
choices=["pm", "harvest", "crepe", "rmvpe"],
value="pm",
interactive=True,
@ -72,7 +78,9 @@ with app:
filter_radius0 = gr.Slider(
minimum=0,
maximum=7,
label=i18n(">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音"),
label=i18n(
">=3则使用对harvest音高识别的结果使用中值滤波数值为滤波半径使用可以削弱哑音"
),
value=3,
step=1,
interactive=True,
@ -107,19 +115,25 @@ with app:
rms_mix_rate0 = gr.Slider(
minimum=0,
maximum=1,
label=i18n("输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络"),
label=i18n(
"输入源音量包络替换输出音量包络融合比例越靠近1越使用输出包络"
),
value=1,
interactive=True,
)
protect0 = gr.Slider(
minimum=0,
maximum=0.5,
label=i18n("保护清辅音和呼吸声防止电音撕裂等artifact拉满0.5不开启,调低加大保护力度但可能降低索引效果"),
label=i18n(
"保护清辅音和呼吸声防止电音撕裂等artifact拉满0.5不开启,调低加大保护力度但可能降低索引效果"
),
value=0.33,
step=0.01,
interactive=True,
)
f0_file = gr.File(label=i18n("F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调"))
f0_file = gr.File(
label=i18n("F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调")
)
but0 = gr.Button(i18n("转换"), variant="primary")
vc_output1 = gr.Textbox(label=i18n("输出信息"))
vc_output2 = gr.Audio(label=i18n("输出音频(右下角三个点,点了可以下载)"))

View File

@ -63,6 +63,9 @@ set hb=hubert_base.pt
set dlhb=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt
set rmvpe=rmvpe.pt
set dlrmvpe=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt
echo dir check start.
echo=
@ -332,7 +335,7 @@ if exist "%~dp0assets\uvr5_weights\onnx_dereverb_By_FoxJoy\%onnx_dereverb%" (
echo checking %hb%
if exist "%~dp0assets\hubert\%hb%" (
echo %hb% in .\assets\hubert\pretrained checked.
echo %hb% in .\assets\hubert checked.
echo=
) else (
echo failed. starting download from huggingface.
@ -341,6 +344,17 @@ if exist "%~dp0assets\hubert\%hb%" (
echo=)
)
echo checking %rmvpe%
if exist "%~dp0assets\rmvpe\%rmvpe%" (
echo %rmvpe% in .\assets\rmvpe checked.
echo=
) else (
echo failed. starting download from huggingface.
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlrmvpe% -d %~dp0assets\rmvpe\ -o %rmvpe%
if exist "%~dp0assets\rmvpe\%rmvpe%" (echo download successful.) else (echo please try again!
echo=)
)
echo required files check finished.
echo envfiles check complete.
pause

View File

@ -1,566 +1,81 @@
#!/bin/bash
#!/bin/sh
echo working dir is $(pwd)
echo downloading requirement aria2 check.
printf "working dir is %s\n" "$PWD"
echo "downloading requirement aria2 check."
if command -v aria2c &> /dev/null
if command -v aria2c > /dev/null 2>&1
then
echo "aria2c command found"
echo "aria2 command found"
else
echo failed. please install aria2
sleep 5
echo "failed. please install aria2"
exit 1
fi
d32="f0D32k.pth"
d40="f0D40k.pth"
d48="f0D48k.pth"
g32="f0G32k.pth"
g40="f0G40k.pth"
g48="f0G48k.pth"
echo "dir check start."
d40v2="f0D40k.pth"
g40v2="f0G40k.pth"
check_dir() {
[ -d "$1" ] && printf "dir %s checked\n" "$1" || \
printf "failed. generating dir %s\n" "$1" && mkdir -p "$1"
}
dld32="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D32k.pth"
dld40="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D40k.pth"
dld48="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D48k.pth"
dlg32="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G32k.pth"
dlg40="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G40k.pth"
dlg48="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G48k.pth"
check_dir "./assets/pretrained"
check_dir "./assets/pretrained_v2"
check_dir "./assets/uvr5_weights"
check_dir "./assets/uvr5_weights/onnx_dereverb_By_FoxJoy"
dld40v2="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D40k.pth"
dlg40v2="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G40k.pth"
echo "dir check finished."
hp2_all="HP2_all_vocals.pth"
hp3_all="HP3_all_vocals.pth"
hp5_only="HP5_only_main_vocal.pth"
VR_DeEchoAggressive="VR-DeEchoAggressive.pth"
VR_DeEchoDeReverb="VR-DeEchoDeReverb.pth"
VR_DeEchoNormal="VR-DeEchoNormal.pth"
onnx_dereverb="vocals.onnx"
rmvpe="rmvpe.pt"
echo "required files check start."
check_file_pretrained() {
printf "checking %s\n" "$2"
if [ -f "./assets/""$1""/""$2""" ]; then
printf "%s in ./assets/%s checked.\n" "$2" "$1"
else
echo failed. starting download from huggingface.
if command -v aria2c > /dev/null 2>&1; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/"$1"/"$2" -d ./assets/"$1" -o "$2"
[ -f "./assets/""$1""/""$2""" ] && echo "download successful." || { echo "please try again!" && exit 1; }
else
echo "aria2c command not found. Please install aria2c and try again."
exit 1
fi
fi
}
dlhp2_all="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2_all_vocals.pth"
dlhp3_all="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP3_all_vocals.pth"
dlhp5_only="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5_only_main_vocal.pth"
dlVR_DeEchoAggressive="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoAggressive.pth"
dlVR_DeEchoDeReverb="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoDeReverb.pth"
dlVR_DeEchoNormal="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoNormal.pth"
dlonnx_dereverb="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/onnx_dereverb_By_FoxJoy/vocals.onnx"
dlrmvpe="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt"
check_file_special() {
printf "checking %s\n" "$2"
if [ -f "./assets/""$1""/""$2""" ]; then
printf "%s in ./assets/%s checked.\n" "$2" "$1"
else
echo failed. starting download from huggingface.
if command -v aria2c > /dev/null 2>&1; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/"$2" -d ./assets/"$1" -o "$2"
[ -f "./assets/""$1""/""$2""" ] && echo "download successful." || { echo "please try again!" && exit 1; }
else
echo "aria2c command not found. Please install aria2c and try again."
exit 1
fi
fi
}
hb="hubert_base.pt"
check_file_pretrained pretrained D32k.pth
check_file_pretrained pretrained D40k.pth
check_file_pretrained pretrained D48k.pth
check_file_pretrained pretrained G32k.pth
check_file_pretrained pretrained G40k.pth
check_file_pretrained pretrained G48k.pth
check_file_pretrained pretrained_v2 f0D40k.pth
check_file_pretrained pretrained_v2 f0G40k.pth
check_file_pretrained pretrained_v2 D40k.pth
check_file_pretrained pretrained_v2 G40k.pth
check_file_pretrained uvr5_weights HP2_all_vocals.pth
check_file_pretrained uvr5_weights HP3_all_vocals.pth
check_file_pretrained uvr5_weights HP5_only_main_vocal.pth
check_file_pretrained uvr5_weights VR-DeEchoAggressive.pth
check_file_pretrained uvr5_weights VR-DeEchoDeReverb.pth
check_file_pretrained uvr5_weights VR-DeEchoNormal.pth
check_file_pretrained uvr5_weights "onnx_dereverb_By_FoxJoy/vocals.onnx"
check_file_special rmvpe rmvpe.pt
check_file_special hubert hubert_base.pt
dlhb="https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt"
echo dir check start.
if [ -d "./assets/pretrained" ]; then
echo dir ./assets/pretrained checked.
else
echo failed. generating dir ./assets/pretrained.
mkdir pretrained
fi
if [ -d "./assets/pretrained_v2" ]; then
echo dir ./assets/pretrained_v2 checked.
else
echo failed. generating dir ./assets/pretrained_v2.
mkdir pretrained_v2
fi
if [ -d "./assets/uvr5_weights" ]; then
echo dir ./assets/uvr5_weights checked.
else
echo failed. generating dir ./assets/uvr5_weights.
mkdir uvr5_weights
fi
if [ -d "./assets/uvr5_weights/onnx_dereverb_By_FoxJoy" ]; then
echo dir ./assets/uvr5_weights/onnx_dereverb_By_FoxJoy checked.
else
echo failed. generating dir ./assets/uvr5_weights/onnx_dereverb_By_FoxJoy.
mkdir uvr5_weights/onnx_dereverb_By_FoxJoy
fi
echo dir check finished.
echo required files check start.
echo checking D32k.pth
if [ -f "./assets/pretrained/D32k.pth" ]; then
echo D32k.pth in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d ./assets/pretrained -o D32k.pth
if [ -f "./assets/pretrained/D32k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking D40k.pth
if [ -f "./assets/pretrained/D40k.pth" ]; then
echo D40k.pth in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d ./assets/pretrained -o D40k.pth
if [ -f "./assets/pretrained/D40k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking D40k.pth
if [ -f "./assets/pretrained_v2/D40k.pth" ]; then
echo D40k.pth in ./assets/pretrained_v2 checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
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
if [ -f "./assets/pretrained_v2/D40k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking D48k.pth
if [ -f "./assets/pretrained/D48k.pth" ]; then
echo D48k.pth in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d ./assets/pretrained -o D48k.pth
if [ -f "./assets/pretrained/D48k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking G32k.pth
if [ -f "./assets/pretrained/G32k.pth" ]; then
echo G32k.pth in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G32k.pth -d ./assets/pretrained -o G32k.pth
if [ -f "./assets/pretrained/G32k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking G40k.pth
if [ -f "./assets/pretrained/G40k.pth" ]; then
echo G40k.pth in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G40k.pth -d ./assets/pretrained -o G40k.pth
if [ -f "./assets/pretrained/G40k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking G40k.pth
if [ -f "./assets/pretrained_v2/G40k.pth" ]; then
echo G40k.pth in ./assets/pretrained_v2 checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
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
if [ -f "./assets/pretrained_v2/G40k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking G48k.pth
if [ -f "./assets/pretrained/G48k.pth" ]; then
echo G48k.pth in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G48k.pth -d ./assets/pretrained -o G48k.pth
if [ -f "./assets/pretrained/G48k.pth" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $d32
if [ -f "./assets/pretrained/$d32" ]; then
echo $d32 in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dld32 -d ./assets/pretrained -o $d32
if [ -f "./assets/pretrained/$d32" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $d40
if [ -f "./assets/pretrained/$d40" ]; then
echo $d40 in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dld40 -d ./assets/pretrained -o $d40
if [ -f "./assets/pretrained/$d40" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $d40v2
if [ -f "./assets/pretrained_v2/$d40v2" ]; then
echo $d40v2 in ./assets/pretrained_v2 checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dld40v2 -d ./assets/pretrained_v2 -o $d40v2
if [ -f "./assets/pretrained_v2/$d40v2" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $d48
if [ -f "./assets/pretrained/$d48" ]; then
echo $d48 in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dld48 -d ./assets/pretrained -o $d48
if [ -f "./assets/pretrained/$d48" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $g32
if [ -f "./assets/pretrained/$g32" ]; then
echo $g32 in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlg32 -d ./assets/pretrained -o $g32
if [ -f "./assets/pretrained/$g32" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $g40
if [ -f "./assets/pretrained/$g40" ]; then
echo $g40 in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlg40 -d ./assets/pretrained -o $g40
if [ -f "./assets/pretrained/$g40" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $g40v2
if [ -f "./assets/pretrained_v2/$g40v2" ]; then
echo $g40v2 in ./assets/pretrained_v2 checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlg40v2 -d ./assets/pretrained_v2 -o $g40v2
if [ -f "./assets/pretrained_v2/$g40v2" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $g48
if [ -f "./assets/pretrained/$g48" ]; then
echo $g48 in ./assets/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlg48 -d ./assets/pretrained -o $g48
if [ -f "./assets/pretrained/$g48" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $hp2_all
if [ -f "./assets/uvr5_weights/$hp2_all" ]; then
echo $hp2_all in ./assets/uvr5_weights checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlhp2_all -d ./assets/uvr5_weights -o $hp2_all
if [ -f "./assets/uvr5_weights/$hp2_all" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $hp3_all
if [ -f "./assets/uvr5_weights/$hp3_all" ]; then
echo $hp3_all in ./assets/uvr5_weights checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlhp3_all -d ./assets/uvr5_weights -o $hp3_all
if [ -f "./assets/uvr5_weights/$hp3_all" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $hp5_only
if [ -f "./assets/uvr5_weights/$hp5_only" ]; then
echo $hp5_only in ./assets/uvr5_weights checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlhp5_only -d ./assets/uvr5_weights -o $hp5_only
if [ -f "./assets/uvr5_weights/$hp5_only" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $VR_DeEchoAggressive
if [ -f "./assets/uvr5_weights/$VR_DeEchoAggressive" ]; then
echo $VR_DeEchoAggressive in ./assets/uvr5_weights checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlVR_DeEchoAggressive -d ./assets/uvr5_weights -o $VR_DeEchoAggressive
if [ -f "./assets/uvr5_weights/$VR_DeEchoAggressive" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $VR_DeEchoDeReverb
if [ -f "./assets/uvr5_weights/$VR_DeEchoDeReverb" ]; then
echo $VR_DeEchoDeReverb in ./assets/uvr5_weights checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlVR_DeEchoDeReverb -d ./assets/uvr5_weights -o $VR_DeEchoDeReverb
if [ -f "./assets/uvr5_weights/$VR_DeEchoDeReverb" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $VR_DeEchoNormal
if [ -f "./assets/uvr5_weights/$VR_DeEchoNormal" ]; then
echo $VR_DeEchoNormal in ./assets/uvr5_weights checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlVR_DeEchoNormal -d ./assets/uvr5_weights -o $VR_DeEchoNormal
if [ -f "./assets/uvr5_weights/$VR_DeEchoNormal" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $onnx_dereverb
if [ -f "./assets/uvr5_weights/onnx_dereverb_By_FoxJoy/$onnx_dereverb" ]; then
echo $onnx_dereverb in ./assets/uvr5_weights/onnx_dereverb_By_FoxJoy checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlonnx_dereverb -d ./assets/uvr5_weights/onnx_dereverb_By_FoxJoy -o $onnx_dereverb
if [ -f "./assets/uvr5_weights/onnx_dereverb_By_FoxJoy/$onnx_dereverb" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $rmvpe
if [ -f "./assets/rmvpe/$rmvpe" ]; then
echo $rmvpe in ./assets/rmvpe checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlrmvpe -d ./assets/rmvpe -o $rmvpe
if [ -f "./assets/rmvpe/$rmvpe" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo checking $hb
if [ -f "./assets/hubert/$hb" ]; then
echo $hb in ./assets/hubert/pretrained checked.
else
echo failed. starting download from huggingface.
if command -v aria2c &> /dev/null; then
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M $dlhb -d ./assets/hubert/ -o $hb
if [ -f "./assets/hubert/$hb" ]; then
echo download successful.
else
echo please try again!
exit 1
fi
else
echo aria2c command not found. Please install aria2c and try again.
exit 1
fi
fi
echo required files check finished.
echo "required files check finished."

View File

@ -2,6 +2,7 @@
对源特征进行检索
"""
import os
import logging

View File

@ -1,6 +1,7 @@
"""
格式直接cid为自带的index位aid放不下了通过字典来查反正就5w个
"""
import os
import traceback
import logging

View File

@ -1,6 +1,7 @@
"""
格式直接cid为自带的index位aid放不下了通过字典来查反正就5w个
"""
import os
import logging

View File

@ -8,7 +8,9 @@ f0_up_key = 0 # 升降调
sid = 0 # 角色ID
f0_method = "dio" # F0提取算法
model_path = "ShirohaRVC.onnx" # 模型的完整路径
vec_name = "vec-256-layer-9" # 内部自动补齐为 f"pretrained/{vec_name}.onnx" 需要onnx的vec模型
vec_name = (
"vec-256-layer-9" # 内部自动补齐为 f"pretrained/{vec_name}.onnx" 需要onnx的vec模型
)
wav_path = "123.wav" # 输入路径或ByteIO实例
out_path = "out.wav" # 输出路径或ByteIO实例

View File

@ -1,425 +1,445 @@
from io import BytesIO
import os
import pickle
import sys
import traceback
from infer.lib import jit
from infer.lib.jit.get_synthesizer import get_synthesizer
from time import time as ttime
import fairseq
import faiss
import numpy as np
import parselmouth
import pyworld
import scipy.signal as signal
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchcrepe
from infer.lib.infer_pack.models import (
SynthesizerTrnMs256NSFsid,
SynthesizerTrnMs256NSFsid_nono,
SynthesizerTrnMs768NSFsid,
SynthesizerTrnMs768NSFsid_nono,
)
now_dir = os.getcwd()
sys.path.append(now_dir)
from multiprocessing import Manager as M
from configs.config import Config
# config = Config()
mm = M()
def printt(strr, *args):
if len(args) == 0:
print(strr)
else:
print(strr % args)
# config.device=torch.device("cpu")########强制cpu测试
# config.is_half=False########强制cpu测试
class RVC:
def __init__(
self,
key,
pth_path,
index_path,
index_rate,
n_cpu,
inp_q,
opt_q,
config: Config,
last_rvc=None,
) -> None:
"""
初始化
"""
try:
if config.dml == True:
def forward_dml(ctx, x, scale):
ctx.scale = scale
res = x.clone().detach()
return res
fairseq.modules.grad_multiply.GradMultiply.forward = forward_dml
# global config
self.config = config
self.inp_q = inp_q
self.opt_q = opt_q
# device="cpu"########强制cpu测试
self.device = config.device
self.f0_up_key = key
self.time_step = 160 / 16000 * 1000
self.f0_min = 50
self.f0_max = 1100
self.f0_mel_min = 1127 * np.log(1 + self.f0_min / 700)
self.f0_mel_max = 1127 * np.log(1 + self.f0_max / 700)
self.sr = 16000
self.window = 160
self.n_cpu = n_cpu
self.use_jit = self.config.use_jit
self.is_half = config.is_half
if index_rate != 0:
self.index = faiss.read_index(index_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
printt("Index search enabled")
self.pth_path: str = pth_path
self.index_path = index_path
self.index_rate = index_rate
if last_rvc is None:
models, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task(
["assets/hubert/hubert_base.pt"],
suffix="",
)
hubert_model = models[0]
hubert_model = hubert_model.to(self.device)
if self.is_half:
hubert_model = hubert_model.half()
else:
hubert_model = hubert_model.float()
hubert_model.eval()
self.model = hubert_model
else:
self.model = last_rvc.model
self.net_g: nn.Module = None
def set_default_model():
self.net_g, cpt = get_synthesizer(self.pth_path, self.device)
self.tgt_sr = cpt["config"][-1]
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0]
self.if_f0 = cpt.get("f0", 1)
self.version = cpt.get("version", "v1")
if self.is_half:
self.net_g = self.net_g.half()
else:
self.net_g = self.net_g.float()
def set_jit_model():
jit_pth_path = self.pth_path.rstrip(".pth")
jit_pth_path += ".half.jit" if self.is_half else ".jit"
reload = False
if str(self.device) == "cuda":
self.device = torch.device("cuda:0")
if os.path.exists(jit_pth_path):
cpt = jit.load(jit_pth_path)
model_device = cpt["device"]
if model_device != str(self.device):
reload = True
else:
reload = True
if reload:
cpt = jit.synthesizer_jit_export(
self.pth_path,
"script",
None,
device=self.device,
is_half=self.is_half,
)
self.tgt_sr = cpt["config"][-1]
self.if_f0 = cpt.get("f0", 1)
self.version = cpt.get("version", "v1")
self.net_g = torch.jit.load(
BytesIO(cpt["model"]), map_location=self.device
)
self.net_g.infer = self.net_g.forward
self.net_g.eval().to(self.device)
def set_synthesizer():
if self.use_jit and not config.dml:
if self.is_half and "cpu" in str(self.device):
printt(
"Use default Synthesizer model. \
Jit is not supported on the CPU for half floating point"
)
set_default_model()
else:
set_jit_model()
else:
set_default_model()
if last_rvc is None or last_rvc.pth_path != self.pth_path:
set_synthesizer()
else:
self.tgt_sr = last_rvc.tgt_sr
self.if_f0 = last_rvc.if_f0
self.version = last_rvc.version
self.is_half = last_rvc.is_half
if last_rvc.use_jit != self.use_jit:
set_synthesizer()
else:
self.net_g = last_rvc.net_g
if last_rvc is not None and hasattr(last_rvc, "model_rmvpe"):
self.model_rmvpe = last_rvc.model_rmvpe
except:
printt(traceback.format_exc())
def change_key(self, new_key):
self.f0_up_key = new_key
def change_index_rate(self, new_index_rate):
if new_index_rate != 0 and self.index_rate == 0:
self.index = faiss.read_index(self.index_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
printt("Index search enabled")
self.index_rate = new_index_rate
def get_f0_post(self, f0):
f0_min = self.f0_min
f0_max = self.f0_max
f0_mel_min = 1127 * np.log(1 + f0_min / 700)
f0_mel_max = 1127 * np.log(1 + f0_max / 700)
f0bak = f0.copy()
f0_mel = 1127 * np.log(1 + f0 / 700)
f0_mel[f0_mel > 0] = (f0_mel[f0_mel > 0] - f0_mel_min) * 254 / (
f0_mel_max - f0_mel_min
) + 1
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > 255] = 255
f0_coarse = np.rint(f0_mel).astype(np.int32)
return f0_coarse, f0bak
def get_f0(self, x, f0_up_key, n_cpu, method="harvest"):
n_cpu = int(n_cpu)
if method == "crepe":
return self.get_f0_crepe(x, f0_up_key)
if method == "rmvpe":
return self.get_f0_rmvpe(x, f0_up_key)
if method == "pm":
p_len = x.shape[0] // 160 + 1
f0 = (
parselmouth.Sound(x, 16000)
.to_pitch_ac(
time_step=0.01,
voicing_threshold=0.6,
pitch_floor=50,
pitch_ceiling=1100,
)
.selected_array["frequency"]
)
pad_size = (p_len - len(f0) + 1) // 2
if pad_size > 0 or p_len - len(f0) - pad_size > 0:
# printt(pad_size, p_len - len(f0) - pad_size)
f0 = np.pad(
f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant"
)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
if n_cpu == 1:
f0, t = pyworld.harvest(
x.astype(np.double),
fs=16000,
f0_ceil=1100,
f0_floor=50,
frame_period=10,
)
f0 = signal.medfilt(f0, 3)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
f0bak = np.zeros(x.shape[0] // 160 + 1, dtype=np.float64)
length = len(x)
part_length = 160 * ((length // 160 - 1) // n_cpu + 1)
n_cpu = (length // 160 - 1) // (part_length // 160) + 1
ts = ttime()
res_f0 = mm.dict()
for idx in range(n_cpu):
tail = part_length * (idx + 1) + 320
if idx == 0:
self.inp_q.put((idx, x[:tail], res_f0, n_cpu, ts))
else:
self.inp_q.put(
(idx, x[part_length * idx - 320 : tail], res_f0, n_cpu, ts)
)
while 1:
res_ts = self.opt_q.get()
if res_ts == ts:
break
f0s = [i[1] for i in sorted(res_f0.items(), key=lambda x: x[0])]
for idx, f0 in enumerate(f0s):
if idx == 0:
f0 = f0[:-3]
elif idx != n_cpu - 1:
f0 = f0[2:-3]
else:
f0 = f0[2:]
f0bak[
part_length * idx // 160 : part_length * idx // 160 + f0.shape[0]
] = f0
f0bak = signal.medfilt(f0bak, 3)
f0bak *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0bak)
def get_f0_crepe(self, x, f0_up_key):
if "privateuseone" in str(self.device): ###不支持dmlcpu又太慢用不成拿pm顶替
return self.get_f0(x, f0_up_key, 1, "pm")
audio = torch.tensor(np.copy(x))[None].float()
# printt("using crepe,device:%s"%self.device)
f0, pd = torchcrepe.predict(
audio,
self.sr,
160,
self.f0_min,
self.f0_max,
"full",
batch_size=512,
# device=self.device if self.device.type!="privateuseone" else "cpu",###crepe不用半精度全部是全精度所以不愁###cpu延迟高到没法用
device=self.device,
return_periodicity=True,
)
pd = torchcrepe.filter.median(pd, 3)
f0 = torchcrepe.filter.mean(f0, 3)
f0[pd < 0.1] = 0
f0 = f0[0].cpu().numpy()
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def get_f0_rmvpe(self, x, f0_up_key):
if hasattr(self, "model_rmvpe") == False:
from infer.lib.rmvpe import RMVPE
printt("Loading rmvpe model")
self.model_rmvpe = RMVPE(
# "rmvpe.pt", is_half=self.is_half if self.device.type!="privateuseone" else False, device=self.device if self.device.type!="privateuseone"else "cpu"####dml时强制对rmvpe用cpu跑
# "rmvpe.pt", is_half=False, device=self.device####dml配置
# "rmvpe.pt", is_half=False, device="cpu"####锁定cpu配置
"assets/rmvpe/rmvpe.pt",
is_half=self.is_half,
device=self.device, ####正常逻辑
use_jit=self.config.use_jit,
)
# self.model_rmvpe = RMVPE("aug2_58000_half.pt", is_half=self.is_half, device=self.device)
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def infer(
self,
feats: torch.Tensor,
indata: np.ndarray,
block_frame_16k,
rate,
cache_pitch,
cache_pitchf,
f0method,
) -> np.ndarray:
feats = feats.view(1, -1)
if self.config.is_half:
feats = feats.half()
else:
feats = feats.float()
feats = feats.to(self.device)
t1 = ttime()
with torch.no_grad():
padding_mask = torch.BoolTensor(feats.shape).to(self.device).fill_(False)
inputs = {
"source": feats,
"padding_mask": padding_mask,
"output_layer": 9 if self.version == "v1" else 12,
}
logits = self.model.extract_features(**inputs)
feats = (
self.model.final_proj(logits[0]) if self.version == "v1" else logits[0]
)
feats = F.pad(feats, (0, 0, 1, 0))
t2 = ttime()
try:
if hasattr(self, "index") and self.index_rate != 0:
leng_replace_head = int(rate * feats[0].shape[0])
npy = feats[0][-leng_replace_head:].cpu().numpy().astype("float32")
score, ix = self.index.search(npy, k=8)
weight = np.square(1 / score)
weight /= weight.sum(axis=1, keepdims=True)
npy = np.sum(self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1)
if self.config.is_half:
npy = npy.astype("float16")
feats[0][-leng_replace_head:] = (
torch.from_numpy(npy).unsqueeze(0).to(self.device) * self.index_rate
+ (1 - self.index_rate) * feats[0][-leng_replace_head:]
)
else:
printt("Index search FAILED or disabled")
except:
traceback.printt_exc()
printt("Index search FAILED")
feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
t3 = ttime()
if self.if_f0 == 1:
pitch, pitchf = self.get_f0(indata, self.f0_up_key, self.n_cpu, f0method)
start_frame = block_frame_16k // 160
end_frame = len(cache_pitch) - (pitch.shape[0] - 4) + start_frame
cache_pitch[:] = np.append(cache_pitch[start_frame:end_frame], pitch[3:-1])
cache_pitchf[:] = np.append(
cache_pitchf[start_frame:end_frame], pitchf[3:-1]
)
p_len = min(feats.shape[1], 13000, cache_pitch.shape[0])
else:
cache_pitch, cache_pitchf = None, None
p_len = min(feats.shape[1], 13000)
t4 = ttime()
feats = feats[:, :p_len, :]
if self.if_f0 == 1:
cache_pitch = cache_pitch[:p_len]
cache_pitchf = cache_pitchf[:p_len]
cache_pitch = torch.LongTensor(cache_pitch).unsqueeze(0).to(self.device)
cache_pitchf = torch.FloatTensor(cache_pitchf).unsqueeze(0).to(self.device)
p_len = torch.LongTensor([p_len]).to(self.device)
ii = 0 # sid
sid = torch.LongTensor([ii]).to(self.device)
with torch.no_grad():
if self.if_f0 == 1:
# printt(12222222222,feats.device,p_len.device,cache_pitch.device,cache_pitchf.device,sid.device,rate2)
infered_audio = self.net_g.infer(
feats,
p_len,
cache_pitch,
cache_pitchf,
sid,
torch.FloatTensor([rate]),
)[0][0, 0].data.float()
else:
infered_audio = self.net_g.infer(
feats, p_len, sid, torch.FloatTensor([rate])
)[0][0, 0].data.float()
t5 = ttime()
printt(
"Spent time: fea = %.2fs, index = %.2fs, f0 = %.2fs, model = %.2fs",
t2 - t1,
t3 - t2,
t4 - t3,
t5 - t4,
)
return infered_audio
from io import BytesIO
import os
import pickle
import sys
import traceback
from infer.lib import jit
from infer.lib.jit.get_synthesizer import get_synthesizer
from time import time as ttime
import fairseq
import faiss
import numpy as np
import parselmouth
import pyworld
import scipy.signal as signal
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchcrepe
from infer.lib.infer_pack.models import (
SynthesizerTrnMs256NSFsid,
SynthesizerTrnMs256NSFsid_nono,
SynthesizerTrnMs768NSFsid,
SynthesizerTrnMs768NSFsid_nono,
)
now_dir = os.getcwd()
sys.path.append(now_dir)
from multiprocessing import Manager as M
from configs.config import Config
# config = Config()
mm = M()
def printt(strr, *args):
if len(args) == 0:
print(strr)
else:
print(strr % args)
# config.device=torch.device("cpu")########强制cpu测试
# config.is_half=False########强制cpu测试
class RVC:
def __init__(
self,
key,
pth_path,
index_path,
index_rate,
n_cpu,
inp_q,
opt_q,
config: Config,
last_rvc=None,
) -> None:
"""
初始化
"""
try:
if config.dml == True:
def forward_dml(ctx, x, scale):
ctx.scale = scale
res = x.clone().detach()
return res
fairseq.modules.grad_multiply.GradMultiply.forward = forward_dml
# global config
self.config = config
self.inp_q = inp_q
self.opt_q = opt_q
# device="cpu"########强制cpu测试
self.device = config.device
self.f0_up_key = key
self.f0_min = 50
self.f0_max = 1100
self.f0_mel_min = 1127 * np.log(1 + self.f0_min / 700)
self.f0_mel_max = 1127 * np.log(1 + self.f0_max / 700)
self.n_cpu = n_cpu
self.use_jit = self.config.use_jit
self.is_half = config.is_half
if index_rate != 0:
self.index = faiss.read_index(index_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
printt("Index search enabled")
self.pth_path: str = pth_path
self.index_path = index_path
self.index_rate = index_rate
self.cache_pitch: torch.Tensor = torch.zeros(
1024, device=self.device, dtype=torch.long
)
self.cache_pitchf = torch.zeros(
1024, device=self.device, dtype=torch.float32
)
if last_rvc is None:
models, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task(
["assets/hubert/hubert_base.pt"],
suffix="",
)
hubert_model = models[0]
hubert_model = hubert_model.to(self.device)
if self.is_half:
hubert_model = hubert_model.half()
else:
hubert_model = hubert_model.float()
hubert_model.eval()
self.model = hubert_model
else:
self.model = last_rvc.model
self.net_g: nn.Module = None
def set_default_model():
self.net_g, cpt = get_synthesizer(self.pth_path, self.device)
self.tgt_sr = cpt["config"][-1]
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0]
self.if_f0 = cpt.get("f0", 1)
self.version = cpt.get("version", "v1")
if self.is_half:
self.net_g = self.net_g.half()
else:
self.net_g = self.net_g.float()
def set_jit_model():
jit_pth_path = self.pth_path.rstrip(".pth")
jit_pth_path += ".half.jit" if self.is_half else ".jit"
reload = False
if str(self.device) == "cuda":
self.device = torch.device("cuda:0")
if os.path.exists(jit_pth_path):
cpt = jit.load(jit_pth_path)
model_device = cpt["device"]
if model_device != str(self.device):
reload = True
else:
reload = True
if reload:
cpt = jit.synthesizer_jit_export(
self.pth_path,
"script",
None,
device=self.device,
is_half=self.is_half,
)
self.tgt_sr = cpt["config"][-1]
self.if_f0 = cpt.get("f0", 1)
self.version = cpt.get("version", "v1")
self.net_g = torch.jit.load(
BytesIO(cpt["model"]), map_location=self.device
)
self.net_g.infer = self.net_g.forward
self.net_g.eval().to(self.device)
def set_synthesizer():
if self.use_jit and not config.dml:
if self.is_half and "cpu" in str(self.device):
printt(
"Use default Synthesizer model. \
Jit is not supported on the CPU for half floating point"
)
set_default_model()
else:
set_jit_model()
else:
set_default_model()
if last_rvc is None or last_rvc.pth_path != self.pth_path:
set_synthesizer()
else:
self.tgt_sr = last_rvc.tgt_sr
self.if_f0 = last_rvc.if_f0
self.version = last_rvc.version
self.is_half = last_rvc.is_half
if last_rvc.use_jit != self.use_jit:
set_synthesizer()
else:
self.net_g = last_rvc.net_g
if last_rvc is not None and hasattr(last_rvc, "model_rmvpe"):
self.model_rmvpe = last_rvc.model_rmvpe
if last_rvc is not None and hasattr(last_rvc, "model_fcpe"):
self.device_fcpe = last_rvc.device_fcpe
self.model_fcpe = last_rvc.model_fcpe
except:
printt(traceback.format_exc())
def change_key(self, new_key):
self.f0_up_key = new_key
def change_index_rate(self, new_index_rate):
if new_index_rate != 0 and self.index_rate == 0:
self.index = faiss.read_index(self.index_path)
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
printt("Index search enabled")
self.index_rate = new_index_rate
def get_f0_post(self, f0):
if not torch.is_tensor(f0):
f0 = torch.from_numpy(f0)
f0 = f0.float().to(self.device).squeeze()
f0_mel = 1127 * torch.log(1 + f0 / 700)
f0_mel[f0_mel > 0] = (f0_mel[f0_mel > 0] - self.f0_mel_min) * 254 / (
self.f0_mel_max - self.f0_mel_min
) + 1
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > 255] = 255
f0_coarse = torch.round(f0_mel).long()
return f0_coarse, f0
def get_f0(self, x, f0_up_key, n_cpu, method="harvest"):
n_cpu = int(n_cpu)
if method == "crepe":
return self.get_f0_crepe(x, f0_up_key)
if method == "rmvpe":
return self.get_f0_rmvpe(x, f0_up_key)
if method == "fcpe":
return self.get_f0_fcpe(x, f0_up_key)
x = x.cpu().numpy()
if method == "pm":
p_len = x.shape[0] // 160 + 1
f0_min = 65
l_pad = int(np.ceil(1.5 / f0_min * 16000))
r_pad = l_pad + 1
s = parselmouth.Sound(np.pad(x, (l_pad, r_pad)), 16000).to_pitch_ac(
time_step=0.01,
voicing_threshold=0.6,
pitch_floor=f0_min,
pitch_ceiling=1100,
)
assert np.abs(s.t1 - 1.5 / f0_min) < 0.001
f0 = s.selected_array["frequency"]
if len(f0) < p_len:
f0 = np.pad(f0, (0, p_len - len(f0)))
f0 = f0[:p_len]
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
if n_cpu == 1:
f0, t = pyworld.harvest(
x.astype(np.double),
fs=16000,
f0_ceil=1100,
f0_floor=50,
frame_period=10,
)
f0 = signal.medfilt(f0, 3)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
f0bak = np.zeros(x.shape[0] // 160 + 1, dtype=np.float64)
length = len(x)
part_length = 160 * ((length // 160 - 1) // n_cpu + 1)
n_cpu = (length // 160 - 1) // (part_length // 160) + 1
ts = ttime()
res_f0 = mm.dict()
for idx in range(n_cpu):
tail = part_length * (idx + 1) + 320
if idx == 0:
self.inp_q.put((idx, x[:tail], res_f0, n_cpu, ts))
else:
self.inp_q.put(
(idx, x[part_length * idx - 320 : tail], res_f0, n_cpu, ts)
)
while 1:
res_ts = self.opt_q.get()
if res_ts == ts:
break
f0s = [i[1] for i in sorted(res_f0.items(), key=lambda x: x[0])]
for idx, f0 in enumerate(f0s):
if idx == 0:
f0 = f0[:-3]
elif idx != n_cpu - 1:
f0 = f0[2:-3]
else:
f0 = f0[2:]
f0bak[part_length * idx // 160 : part_length * idx // 160 + f0.shape[0]] = (
f0
)
f0bak = signal.medfilt(f0bak, 3)
f0bak *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0bak)
def get_f0_crepe(self, x, f0_up_key):
if "privateuseone" in str(
self.device
): ###不支持dmlcpu又太慢用不成拿fcpe顶替
return self.get_f0(x, f0_up_key, 1, "fcpe")
# printt("using crepe,device:%s"%self.device)
f0, pd = torchcrepe.predict(
x.unsqueeze(0).float(),
16000,
160,
self.f0_min,
self.f0_max,
"full",
batch_size=512,
# device=self.device if self.device.type!="privateuseone" else "cpu",###crepe不用半精度全部是全精度所以不愁###cpu延迟高到没法用
device=self.device,
return_periodicity=True,
)
pd = torchcrepe.filter.median(pd, 3)
f0 = torchcrepe.filter.mean(f0, 3)
f0[pd < 0.1] = 0
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def get_f0_rmvpe(self, x, f0_up_key):
if hasattr(self, "model_rmvpe") == False:
from infer.lib.rmvpe import RMVPE
printt("Loading rmvpe model")
self.model_rmvpe = RMVPE(
"assets/rmvpe/rmvpe.pt",
is_half=self.is_half,
device=self.device,
use_jit=self.config.use_jit,
)
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def get_f0_fcpe(self, x, f0_up_key):
if hasattr(self, "model_fcpe") == False:
from torchfcpe import spawn_bundled_infer_model
printt("Loading fcpe model")
if "privateuseone" in str(self.device):
self.device_fcpe = "cpu"
else:
self.device_fcpe = self.device
self.model_fcpe = spawn_bundled_infer_model(self.device_fcpe)
f0 = self.model_fcpe.infer(
x.to(self.device_fcpe).unsqueeze(0).float(),
sr=16000,
decoder_mode="local_argmax",
threshold=0.006,
)
f0 *= pow(2, f0_up_key / 12)
return self.get_f0_post(f0)
def infer(
self,
input_wav: torch.Tensor,
block_frame_16k,
skip_head,
return_length,
f0method,
) -> np.ndarray:
t1 = ttime()
with torch.no_grad():
if self.config.is_half:
feats = input_wav.half().view(1, -1)
else:
feats = input_wav.float().view(1, -1)
padding_mask = torch.BoolTensor(feats.shape).to(self.device).fill_(False)
inputs = {
"source": feats,
"padding_mask": padding_mask,
"output_layer": 9 if self.version == "v1" else 12,
}
logits = self.model.extract_features(**inputs)
feats = (
self.model.final_proj(logits[0]) if self.version == "v1" else logits[0]
)
feats = torch.cat((feats, feats[:, -1:, :]), 1)
t2 = ttime()
try:
if hasattr(self, "index") and self.index_rate != 0:
npy = feats[0][skip_head // 2 :].cpu().numpy().astype("float32")
score, ix = self.index.search(npy, k=8)
if (ix >= 0).all():
weight = np.square(1 / score)
weight /= weight.sum(axis=1, keepdims=True)
npy = np.sum(
self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1
)
if self.config.is_half:
npy = npy.astype("float16")
feats[0][skip_head // 2 :] = (
torch.from_numpy(npy).unsqueeze(0).to(self.device)
* self.index_rate
+ (1 - self.index_rate) * feats[0][skip_head // 2 :]
)
else:
printt(
"Invalid index. You MUST use added_xxxx.index but not trained_xxxx.index!"
)
else:
printt("Index search FAILED or disabled")
except:
traceback.print_exc()
printt("Index search FAILED")
t3 = ttime()
p_len = input_wav.shape[0] // 160
if self.if_f0 == 1:
f0_extractor_frame = block_frame_16k + 800
if f0method == "rmvpe":
f0_extractor_frame = 5120 * ((f0_extractor_frame - 1) // 5120 + 1) - 160
pitch, pitchf = self.get_f0(
input_wav[-f0_extractor_frame:], self.f0_up_key, self.n_cpu, f0method
)
shift = block_frame_16k // 160
self.cache_pitch[:-shift] = self.cache_pitch[shift:].clone()
self.cache_pitchf[:-shift] = self.cache_pitchf[shift:].clone()
self.cache_pitch[4 - pitch.shape[0] :] = pitch[3:-1]
self.cache_pitchf[4 - pitch.shape[0] :] = pitchf[3:-1]
cache_pitch = self.cache_pitch[None, -p_len:]
cache_pitchf = self.cache_pitchf[None, -p_len:]
t4 = ttime()
feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
feats = feats[:, :p_len, :]
p_len = torch.LongTensor([p_len]).to(self.device)
sid = torch.LongTensor([0]).to(self.device)
skip_head = torch.LongTensor([skip_head])
return_length = torch.LongTensor([return_length])
with torch.no_grad():
if self.if_f0 == 1:
infered_audio, _, _ = self.net_g.infer(
feats,
p_len,
cache_pitch,
cache_pitchf,
sid,
skip_head,
return_length,
)
else:
infered_audio, _, _ = self.net_g.infer(
feats, p_len, sid, skip_head, return_length
)
t5 = ttime()
printt(
"Spent time: fea = %.3fs, index = %.3fs, f0 = %.3fs, model = %.3fs",
t2 - t1,
t3 - t2,
t4 - t3,
t5 - t4,
)
return infered_audio.squeeze().float()

View File

@ -9,4 +9,5 @@ torchgate imports all the functions from PyTorch, and in addition provides:
TorchGating --- A PyTorch module that applies a spectral gate to an input signal
"""
from .torchgate import TorchGate

View File

@ -1 +1,3 @@
#!/bin/sh
python3.8 -m venv .venv