mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-05 09:10:25 +08:00
optimize(all): tidy project structure
This commit is contained in:
@@ -1,362 +0,0 @@
|
||||
@echo off && chcp 65001
|
||||
|
||||
echo working dir is %cd%
|
||||
echo downloading requirement aria2 check.
|
||||
echo=
|
||||
dir /a:d/b | findstr "aria2" > flag.txt
|
||||
findstr "aria2" flag.txt >nul
|
||||
if %errorlevel% ==0 (
|
||||
echo aria2 checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. please downloading aria2 from webpage!
|
||||
echo unzip it and put in this directory!
|
||||
timeout /T 5
|
||||
start https://github.com/aria2/aria2/releases/tag/release-1.36.0
|
||||
echo=
|
||||
goto end
|
||||
)
|
||||
|
||||
echo envfiles checking start.
|
||||
echo=
|
||||
|
||||
for /f %%x in ('findstr /i /c:"aria2" "flag.txt"') do (set aria2=%%x)&goto endSch
|
||||
:endSch
|
||||
|
||||
set d32=f0D32k.pth
|
||||
set d40=f0D40k.pth
|
||||
set d48=f0D48k.pth
|
||||
set g32=f0G32k.pth
|
||||
set g40=f0G40k.pth
|
||||
set g48=f0G48k.pth
|
||||
|
||||
set d40v2=f0D40k.pth
|
||||
set g40v2=f0G40k.pth
|
||||
|
||||
set dld32=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D32k.pth
|
||||
set dld40=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D40k.pth
|
||||
set dld48=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D48k.pth
|
||||
set dlg32=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G32k.pth
|
||||
set dlg40=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G40k.pth
|
||||
set dlg48=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G48k.pth
|
||||
|
||||
set dld40v2=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0D40k.pth
|
||||
set dlg40v2=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/f0G40k.pth
|
||||
|
||||
set hp2_all=HP2_all_vocals.pth
|
||||
set hp3_all=HP3_all_vocals.pth
|
||||
set hp5_only=HP5_only_main_vocal.pth
|
||||
set VR_DeEchoAggressive=VR-DeEchoAggressive.pth
|
||||
set VR_DeEchoDeReverb=VR-DeEchoDeReverb.pth
|
||||
set VR_DeEchoNormal=VR-DeEchoNormal.pth
|
||||
set onnx_dereverb=vocals.onnx
|
||||
|
||||
set dlhp2_all=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2_all_vocals.pth
|
||||
set dlhp3_all=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP3_all_vocals.pth
|
||||
set dlhp5_only=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5_only_main_vocal.pth
|
||||
set dlVR_DeEchoAggressive=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoAggressive.pth
|
||||
set dlVR_DeEchoDeReverb=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoDeReverb.pth
|
||||
set dlVR_DeEchoNormal=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/VR-DeEchoNormal.pth
|
||||
set dlonnx_dereverb=https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/onnx_dereverb_By_FoxJoy/vocals.onnx
|
||||
|
||||
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=
|
||||
|
||||
if exist "%~dp0assets\pretrained" (
|
||||
echo dir .\assets\pretrained checked.
|
||||
) else (
|
||||
echo failed. generating dir .\assets\pretrained.
|
||||
mkdir pretrained
|
||||
)
|
||||
if exist "%~dp0assets\pretrained_v2" (
|
||||
echo dir .\assets\pretrained_v2 checked.
|
||||
) else (
|
||||
echo failed. generating dir .\assets\pretrained_v2.
|
||||
mkdir pretrained_v2
|
||||
)
|
||||
if exist "%~dp0assets\uvr5_weights" (
|
||||
echo dir .\assets\uvr5_weights checked.
|
||||
) else (
|
||||
echo failed. generating dir .\assets\uvr5_weights.
|
||||
mkdir uvr5_weights
|
||||
)
|
||||
if exist "%~dp0assets\uvr5_weights\onnx_dereverb_By_FoxJoy" (
|
||||
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
|
||||
)
|
||||
|
||||
echo=
|
||||
echo dir check finished.
|
||||
|
||||
echo=
|
||||
echo required files check start.
|
||||
|
||||
echo checking D32k.pth
|
||||
if exist "%~dp0assets\pretrained\D32k.pth" (
|
||||
echo D32k.pth in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d %~dp0assets\pretrained -o D32k.pth
|
||||
if exist "%~dp0assets\pretrained\D32k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking D40k.pth
|
||||
if exist "%~dp0assets\pretrained\D40k.pth" (
|
||||
echo D40k.pth in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d %~dp0assets\pretrained -o D40k.pth
|
||||
if exist "%~dp0assets\pretrained\D40k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking D40k.pth
|
||||
if exist "%~dp0assets\pretrained_v2\D40k.pth" (
|
||||
echo D40k.pth in .\assets\pretrained_v2 checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/D40k.pth -d %~dp0assets\pretrained_v2 -o D40k.pth
|
||||
if exist "%~dp0assets\pretrained_v2\D40k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking D48k.pth
|
||||
if exist "%~dp0assets\pretrained\D48k.pth" (
|
||||
echo D48k.pth in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d %~dp0assets\pretrained -o D48k.pth
|
||||
if exist "%~dp0assets\pretrained\D48k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking G32k.pth
|
||||
if exist "%~dp0assets\pretrained\G32k.pth" (
|
||||
echo G32k.pth in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G32k.pth -d %~dp0assets\pretrained -o G32k.pth
|
||||
if exist "%~dp0assets\pretrained\G32k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking G40k.pth
|
||||
if exist "%~dp0assets\pretrained\G40k.pth" (
|
||||
echo G40k.pth in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G40k.pth -d %~dp0assets\pretrained -o G40k.pth
|
||||
if exist "%~dp0assets\pretrained\G40k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking G40k.pth
|
||||
if exist "%~dp0assets\pretrained_v2\G40k.pth" (
|
||||
echo G40k.pth in .\assets\pretrained_v2 checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained_v2/G40k.pth -d %~dp0assets\pretrained_v2 -o G40k.pth
|
||||
if exist "%~dp0assets\pretrained_v2\G40k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking G48k.pth
|
||||
if exist "%~dp0assets\pretrained\G48k.pth" (
|
||||
echo G48k.pth in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G48k.pth -d %~dp0assets\pretrained -o G48k.pth
|
||||
if exist "%~dp0assets\pretrained\G48k.pth" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
|
||||
echo checking %d32%
|
||||
if exist "%~dp0assets\pretrained\%d32%" (
|
||||
echo %d32% in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld32% -d %~dp0assets\pretrained -o %d32%
|
||||
if exist "%~dp0assets\pretrained\%d32%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %d40%
|
||||
if exist "%~dp0assets\pretrained\%d40%" (
|
||||
echo %d40% in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld40% -d %~dp0assets\pretrained -o %d40%
|
||||
if exist "%~dp0assets\pretrained\%d40%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %d40v2%
|
||||
if exist "%~dp0assets\pretrained_v2\%d40v2%" (
|
||||
echo %d40v2% in .\assets\pretrained_v2 checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld40v2% -d %~dp0assets\pretrained_v2 -o %d40v2%
|
||||
if exist "%~dp0assets\pretrained_v2\%d40v2%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %d48%
|
||||
if exist "%~dp0assets\pretrained\%d48%" (
|
||||
echo %d48% in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dld48% -d %~dp0assets\pretrained -o %d48%
|
||||
if exist "%~dp0assets\pretrained\%d48%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %g32%
|
||||
if exist "%~dp0assets\pretrained\%g32%" (
|
||||
echo %g32% in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg32% -d %~dp0assets\pretrained -o %g32%
|
||||
if exist "%~dp0assets\pretrained\%g32%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %g40%
|
||||
if exist "%~dp0assets\pretrained\%g40%" (
|
||||
echo %g40% in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg40% -d %~dp0assets\pretrained -o %g40%
|
||||
if exist "%~dp0assets\pretrained\%g40%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %g40v2%
|
||||
if exist "%~dp0assets\pretrained_v2\%g40v2%" (
|
||||
echo %g40v2% in .\assets\pretrained_v2 checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg40v2% -d %~dp0assets\pretrained_v2 -o %g40v2%
|
||||
if exist "%~dp0assets\pretrained_v2\%g40v2%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %g48%
|
||||
if exist "%~dp0assets\pretrained\%g48%" (
|
||||
echo %g48% in .\assets\pretrained checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlg48% -d %~dp0assets\pretrained -o %g48%
|
||||
if exist "%~dp0assets\pretrained\%g48%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
|
||||
echo checking %hp2_all%
|
||||
if exist "%~dp0assets\uvr5_weights\%hp2_all%" (
|
||||
echo %hp2_all% in .\assets\uvr5_weights checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhp2_all% -d %~dp0assets\uvr5_weights -o %hp2_all%
|
||||
if exist "%~dp0assets\uvr5_weights\%hp2_all%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %hp3_all%
|
||||
if exist "%~dp0assets\uvr5_weights\%hp3_all%" (
|
||||
echo %hp3_all% in .\assets\uvr5_weights checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhp3_all% -d %~dp0assets\uvr5_weights -o %hp3_all%
|
||||
if exist "%~dp0assets\uvr5_weights\%hp3_all%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %hp5_only%
|
||||
if exist "%~dp0assets\uvr5_weights\%hp5_only%" (
|
||||
echo %hp5_only% in .\assets\uvr5_weights checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhp5_only% -d %~dp0assets\uvr5_weights -o %hp5_only%
|
||||
if exist "%~dp0assets\uvr5_weights\%hp5_only%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %VR_DeEchoAggressive%
|
||||
if exist "%~dp0assets\uvr5_weights\%VR_DeEchoAggressive%" (
|
||||
echo %VR_DeEchoAggressive% in .\assets\uvr5_weights checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlVR_DeEchoAggressive% -d %~dp0assets\uvr5_weights -o %VR_DeEchoAggressive%
|
||||
if exist "%~dp0assets\uvr5_weights\%VR_DeEchoAggressive%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %VR_DeEchoDeReverb%
|
||||
if exist "%~dp0assets\uvr5_weights\%VR_DeEchoDeReverb%" (
|
||||
echo %VR_DeEchoDeReverb% in .\assets\uvr5_weights checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlVR_DeEchoDeReverb% -d %~dp0assets\uvr5_weights -o %VR_DeEchoDeReverb%
|
||||
if exist "%~dp0assets\uvr5_weights\%VR_DeEchoDeReverb%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %VR_DeEchoNormal%
|
||||
if exist "%~dp0assets\uvr5_weights\%VR_DeEchoNormal%" (
|
||||
echo %VR_DeEchoNormal% in .\assets\uvr5_weights checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlVR_DeEchoNormal% -d %~dp0assets\uvr5_weights -o %VR_DeEchoNormal%
|
||||
if exist "%~dp0assets\uvr5_weights\%VR_DeEchoNormal%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
echo checking %onnx_dereverb%
|
||||
if exist "%~dp0assets\uvr5_weights\onnx_dereverb_By_FoxJoy\%onnx_dereverb%" (
|
||||
echo %onnx_dereverb% in .\assets\uvr5_weights\onnx_dereverb_By_FoxJoy checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlonnx_dereverb% -d %~dp0assets\uvr5_weights\onnx_dereverb_By_FoxJoy -o %onnx_dereverb%
|
||||
if exist "%~dp0assets\uvr5_weights\onnx_dereverb_By_FoxJoy\%onnx_dereverb%" (echo download successful.) else (echo please try again!
|
||||
echo=)
|
||||
)
|
||||
|
||||
echo checking %hb%
|
||||
if exist "%~dp0assets\hubert\%hb%" (
|
||||
echo %hb% in .\assets\hubert checked.
|
||||
echo=
|
||||
) else (
|
||||
echo failed. starting download from huggingface.
|
||||
%~dp0%aria2%\aria2c --console-log-level=error -c -x 16 -s 16 -k 1M %dlhb% -d %~dp0assets\hubert\ -o %hb%
|
||||
if exist "%~dp0assets\hubert\%hb%" (echo download successful.) else (echo please try again!
|
||||
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
|
||||
:end
|
||||
del flag.txt
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
printf "working dir is %s\n" "$PWD"
|
||||
echo "downloading requirement aria2 check."
|
||||
|
||||
if command -v aria2c > /dev/null 2>&1
|
||||
then
|
||||
echo "aria2 command found"
|
||||
else
|
||||
echo "failed. please install aria2"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "dir check start."
|
||||
|
||||
check_dir() {
|
||||
[ -d "$1" ] && printf "dir %s checked\n" "$1" || \
|
||||
printf "failed. generating dir %s\n" "$1" && mkdir -p "$1"
|
||||
}
|
||||
|
||||
check_dir "./assets/pretrained"
|
||||
check_dir "./assets/pretrained_v2"
|
||||
check_dir "./assets/uvr5_weights"
|
||||
check_dir "./assets/uvr5_weights/onnx_dereverb_By_FoxJoy"
|
||||
|
||||
echo "dir check finished."
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
echo "required files check finished."
|
||||
@@ -1,79 +0,0 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
import requests
|
||||
|
||||
RVC_DOWNLOAD_LINK = "https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/"
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def dl_model(link, model_name, dir_name):
|
||||
with requests.get(f"{link}{model_name}") as r:
|
||||
r.raise_for_status()
|
||||
os.makedirs(os.path.dirname(dir_name / model_name), exist_ok=True)
|
||||
with open(dir_name / model_name, "wb") as f:
|
||||
for chunk in r.iter_content(chunk_size=8192):
|
||||
f.write(chunk)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Downloading hubert_base.pt...")
|
||||
dl_model(RVC_DOWNLOAD_LINK, "hubert_base.pt", BASE_DIR / "assets/hubert")
|
||||
print("Downloading rmvpe.pt...")
|
||||
dl_model(RVC_DOWNLOAD_LINK, "rmvpe.pt", BASE_DIR / "assets/rmvpe")
|
||||
print("Downloading vocals.onnx...")
|
||||
dl_model(
|
||||
RVC_DOWNLOAD_LINK + "uvr5_weights/onnx_dereverb_By_FoxJoy/",
|
||||
"vocals.onnx",
|
||||
BASE_DIR / "assets/uvr5_weights/onnx_dereverb_By_FoxJoy",
|
||||
)
|
||||
|
||||
rvc_models_dir = BASE_DIR / "assets/pretrained"
|
||||
|
||||
print("Downloading pretrained models:")
|
||||
|
||||
model_names = [
|
||||
"D32k.pth",
|
||||
"D40k.pth",
|
||||
"D48k.pth",
|
||||
"G32k.pth",
|
||||
"G40k.pth",
|
||||
"G48k.pth",
|
||||
"f0D32k.pth",
|
||||
"f0D40k.pth",
|
||||
"f0D48k.pth",
|
||||
"f0G32k.pth",
|
||||
"f0G40k.pth",
|
||||
"f0G48k.pth",
|
||||
]
|
||||
for model in model_names:
|
||||
print(f"Downloading {model}...")
|
||||
dl_model(RVC_DOWNLOAD_LINK + "pretrained/", model, rvc_models_dir)
|
||||
|
||||
rvc_models_dir = BASE_DIR / "assets/pretrained_v2"
|
||||
|
||||
print("Downloading pretrained models v2:")
|
||||
|
||||
for model in model_names:
|
||||
print(f"Downloading {model}...")
|
||||
dl_model(RVC_DOWNLOAD_LINK + "pretrained_v2/", model, rvc_models_dir)
|
||||
|
||||
print("Downloading uvr5_weights:")
|
||||
|
||||
rvc_models_dir = BASE_DIR / "assets/uvr5_weights"
|
||||
|
||||
model_names = [
|
||||
"HP2-%E4%BA%BA%E5%A3%B0vocals%2B%E9%9D%9E%E4%BA%BA%E5%A3%B0instrumentals.pth",
|
||||
"HP2_all_vocals.pth",
|
||||
"HP3_all_vocals.pth",
|
||||
"HP5-%E4%B8%BB%E6%97%8B%E5%BE%8B%E4%BA%BA%E5%A3%B0vocals%2B%E5%85%B6%E4%BB%96instrumentals.pth",
|
||||
"HP5_only_main_vocal.pth",
|
||||
"VR-DeEchoAggressive.pth",
|
||||
"VR-DeEchoDeReverb.pth",
|
||||
"VR-DeEchoNormal.pth",
|
||||
]
|
||||
for model in model_names:
|
||||
print(f"Downloading {model}...")
|
||||
dl_model(RVC_DOWNLOAD_LINK + "uvr5_weights/", model, rvc_models_dir)
|
||||
|
||||
print("All models downloaded!")
|
||||
@@ -1,353 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "WHBMn6dOWm-S"
|
||||
},
|
||||
"source": [
|
||||
"# [Retrieval-based-Voice-Conversion-WebUI](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI) Training notebook"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ZFFCx5J80SGa"
|
||||
},
|
||||
"source": [
|
||||
"[](https://colab.research.google.com/github/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/tools/colab/v1.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "GmFP6bN9dvOq"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 查看显卡\n",
|
||||
"!nvidia-smi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "jwu07JgqoFON"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 挂载谷歌云盘\n",
|
||||
"\n",
|
||||
"from google.colab import drive\n",
|
||||
"\n",
|
||||
"drive.mount(\"/content/drive\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "wjddIFr1oS3W"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 安装依赖\n",
|
||||
"!apt -y install build-essential python3-dev ffmpeg\n",
|
||||
"!pip3 install --upgrade setuptools wheel\n",
|
||||
"!pip3 install --upgrade pip"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "ge_97mfpgqTm"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 克隆仓库\n",
|
||||
"\n",
|
||||
"!git clone --depth=1 -b v1 https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI\n",
|
||||
"%cd /content/Retrieval-based-Voice-Conversion-WebUI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "BLDEZADkvlw1"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 安装依赖\n",
|
||||
"!pip install -r requirements.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "pqE0PrnuRqI2"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 下载安装 RVC-Models-Downloader\n",
|
||||
"!wget https://github.com/RVC-Project/RVC-Models-Downloader/releases/download/v0.2.3/rvcmd_linux_amd64.deb\n",
|
||||
"!apt install ./rvcmd_linux_amd64.deb"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "UG3XpUwEomUz"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 下载所需资源\n",
|
||||
"!rvcmd -notrs -w 1 -notui assets/v1\n",
|
||||
"!rvcmd -notrs -w 1 -notui assets/rmvpe"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "Mwk7Q0Loqzjx"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 从谷歌云盘加载打包好的数据集到/content/dataset\n",
|
||||
"\n",
|
||||
"# @markdown 数据集位置\n",
|
||||
"DATASET = \"/content/drive/MyDrive/mydataset.zip\" # @param {type:\"string\"}\n",
|
||||
"\n",
|
||||
"!mkdir -p /content/dataset\n",
|
||||
"!unzip -d /content/dataset -B {DATASET}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "PDlFxWHWEynD"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 重命名数据集中的重名文件\n",
|
||||
"!ls -a /content/dataset/\n",
|
||||
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "7vh6vphDwO0b"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 启动web\n",
|
||||
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
||||
"# %load_ext tensorboard\n",
|
||||
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
||||
"!python3 infer-web.py --colab --pycmd python3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "FgJuNeAwx5Y_"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动将训练后的模型文件备份到谷歌云盘\n",
|
||||
"# @markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
||||
"\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/added_*.index /content/drive/MyDrive/\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/total_*.npy /content/drive/MyDrive/\n",
|
||||
"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "OVQoLQJXS7WX"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 从谷歌云盘恢复pth\n",
|
||||
"# @markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
||||
"\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
||||
"\n",
|
||||
"!cp /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/drive/MyDrive/*.index /content/\n",
|
||||
"!cp /content/drive/MyDrive/*.npy /content/\n",
|
||||
"!cp /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "ZKAyuKb9J6dz"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动预处理(不推荐)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 采样率\n",
|
||||
"BITRATE = 48000 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 使用的进程数\n",
|
||||
"THREADCOUNT = 8 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "CrxJqzAUKmPJ"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动提取特征(不推荐)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 使用的进程数\n",
|
||||
"THREADCOUNT = 8 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 音高提取算法\n",
|
||||
"ALGO = \"harvest\" # @param {type:\"string\"}\n",
|
||||
"\n",
|
||||
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
||||
"\n",
|
||||
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME} True"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "IMLPLKOaKj58"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动训练(不推荐)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 使用的GPU\n",
|
||||
"USEGPU = \"0\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 批大小\n",
|
||||
"BATCHSIZE = 32 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 停止的epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 保存epoch间隔\n",
|
||||
"EPOCHSAVE = 100 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 采样率\n",
|
||||
"MODELSAMPLE = \"48k\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 是否缓存训练集\n",
|
||||
"CACHEDATA = 1 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 是否仅保存最新的ckpt文件\n",
|
||||
"ONLYLATEST = 0 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "haYA81hySuDl"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 删除其它pth,只留选中的(慎点,仔细看代码)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 选中模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!echo \"备份选中的模型。。。\"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"正在删除。。。\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
||||
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
||||
"\n",
|
||||
"!echo \"恢复选中的模型。。。\"\n",
|
||||
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
||||
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"删除完成\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "QhSiPTVPoIRh"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 清除项目下所有文件,只留选中的模型(慎点,仔细看代码)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 选中模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!echo \"备份选中的模型。。。\"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"正在删除。。。\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
||||
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
||||
"\n",
|
||||
"!echo \"恢复选中的模型。。。\"\n",
|
||||
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
||||
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"删除完成\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"private_outputs": true,
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -1,352 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "QTSdqTqGcbyr"
|
||||
},
|
||||
"source": [
|
||||
"# [Retrieval-based-Voice-Conversion-WebUI](https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI) Training notebook"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "ZFFCx5J80SGa"
|
||||
},
|
||||
"source": [
|
||||
"[](https://colab.research.google.com/github/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/main/tools/colab/v2.ipynb)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "GmFP6bN9dvOq"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #查看显卡\n",
|
||||
"!nvidia-smi"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "jwu07JgqoFON"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 挂载谷歌云盘\n",
|
||||
"\n",
|
||||
"from google.colab import drive\n",
|
||||
"\n",
|
||||
"drive.mount(\"/content/drive\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "wjddIFr1oS3W"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #安装依赖\n",
|
||||
"!apt -y install build-essential python3-dev ffmpeg\n",
|
||||
"!pip3 install --upgrade setuptools wheel\n",
|
||||
"!pip3 install --upgrade pip"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "ge_97mfpgqTm"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #克隆仓库\n",
|
||||
"\n",
|
||||
"!git clone --depth=1 -b v2.2 https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI\n",
|
||||
"%cd /content/Retrieval-based-Voice-Conversion-WebUI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "BLDEZADkvlw1"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 安装依赖\n",
|
||||
"!pip install -r requirements.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "pqE0PrnuRqI2"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 下载安装 RVC-Models-Downloader\n",
|
||||
"!wget https://github.com/RVC-Project/RVC-Models-Downloader/releases/download/v0.2.3/rvcmd_linux_amd64.deb\n",
|
||||
"!apt install ./rvcmd_linux_amd64.deb"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "UG3XpUwEomUz"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 下载所需资源\n",
|
||||
"!rvcmd -notrs -w 1 -notui assets/all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "Mwk7Q0Loqzjx"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #从谷歌云盘加载打包好的数据集到/content/dataset\n",
|
||||
"\n",
|
||||
"# @markdown 数据集位置\n",
|
||||
"DATASET = \"/content/drive/MyDrive/mydataset.zip\" # @param {type:\"string\"}\n",
|
||||
"\n",
|
||||
"!mkdir -p /content/dataset\n",
|
||||
"!unzip -d /content/dataset -B {DATASET}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "PDlFxWHWEynD"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #重命名数据集中的重名文件\n",
|
||||
"!ls -a /content/dataset/\n",
|
||||
"!rename 's/(\\w+)\\.(\\w+)~(\\d*)/$1_$3.$2/' /content/dataset/*.*~*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "7vh6vphDwO0b"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #启动webui\n",
|
||||
"%cd /content/Retrieval-based-Voice-Conversion-WebUI\n",
|
||||
"# %load_ext tensorboard\n",
|
||||
"# %tensorboard --logdir /content/Retrieval-based-Voice-Conversion-WebUI/logs\n",
|
||||
"!python3 infer-web.py --colab --pycmd python3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "FgJuNeAwx5Y_"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title #手动将训练后的模型文件备份到谷歌云盘\n",
|
||||
"# @markdown #需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
||||
"\n",
|
||||
"# @markdown #模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown #模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/added_*.index /content/drive/MyDrive/\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/total_*.npy /content/drive/MyDrive/\n",
|
||||
"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "OVQoLQJXS7WX"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 从谷歌云盘恢复pth\n",
|
||||
"# @markdown 需要自己查看logs文件夹下模型的文件名,手动修改下方命令末尾的文件名\n",
|
||||
"\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!mkdir -p /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
||||
"\n",
|
||||
"!cp /content/drive/MyDrive/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/drive/MyDrive/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/drive/MyDrive/*.index /content/\n",
|
||||
"!cp /content/drive/MyDrive/*.npy /content/\n",
|
||||
"!cp /content/drive/MyDrive/{MODELNAME}{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/weights/{MODELNAME}.pth"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "ZKAyuKb9J6dz"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动预处理(不推荐)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 采样率\n",
|
||||
"BITRATE = 48000 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 使用的进程数\n",
|
||||
"THREADCOUNT = 8 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!python3 trainset_preprocess_pipeline_print.py /content/dataset {BITRATE} {THREADCOUNT} logs/{MODELNAME} True"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "CrxJqzAUKmPJ"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动提取特征(不推荐)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 使用的进程数\n",
|
||||
"THREADCOUNT = 8 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 音高提取算法\n",
|
||||
"ALGO = \"harvest\" # @param {type:\"string\"}\n",
|
||||
"\n",
|
||||
"!python3 extract_f0_print.py logs/{MODELNAME} {THREADCOUNT} {ALGO}\n",
|
||||
"\n",
|
||||
"!python3 extract_feature_print.py cpu 1 0 0 logs/{MODELNAME} True"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "IMLPLKOaKj58"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 手动训练(不推荐)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 使用的GPU\n",
|
||||
"USEGPU = \"0\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 批大小\n",
|
||||
"BATCHSIZE = 32 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 停止的epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 保存epoch间隔\n",
|
||||
"EPOCHSAVE = 100 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 采样率\n",
|
||||
"MODELSAMPLE = \"48k\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 是否缓存训练集\n",
|
||||
"CACHEDATA = 1 # @param {type:\"integer\"}\n",
|
||||
"# @markdown 是否仅保存最新的ckpt文件\n",
|
||||
"ONLYLATEST = 0 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!python3 train_nsf_sim_cache_sid_load_pretrain.py -e lulu -sr {MODELSAMPLE} -f0 1 -bs {BATCHSIZE} -g {USEGPU} -te {MODELEPOCH} -se {EPOCHSAVE} -pg pretrained/f0G{MODELSAMPLE}.pth -pd pretrained/f0D{MODELSAMPLE}.pth -l {ONLYLATEST} -c {CACHEDATA}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "haYA81hySuDl"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 删除其它pth,只留选中的(慎点,仔细看代码)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 选中模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!echo \"备份选中的模型。。。\"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"正在删除。。。\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
||||
"!rm /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*.pth\n",
|
||||
"\n",
|
||||
"!echo \"恢复选中的模型。。。\"\n",
|
||||
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
||||
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"删除完成\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "QhSiPTVPoIRh"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# @title 清除项目下所有文件,只留选中的模型(慎点,仔细看代码)\n",
|
||||
"# @markdown 模型名\n",
|
||||
"MODELNAME = \"mymodel\" # @param {type:\"string\"}\n",
|
||||
"# @markdown 选中模型epoch\n",
|
||||
"MODELEPOCH = 3200 # @param {type:\"integer\"}\n",
|
||||
"\n",
|
||||
"!echo \"备份选中的模型。。。\"\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth /content/{MODELNAME}_D_{MODELEPOCH}.pth\n",
|
||||
"!cp /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth /content/{MODELNAME}_G_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"正在删除。。。\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}\n",
|
||||
"!rm -rf /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/*\n",
|
||||
"\n",
|
||||
"!echo \"恢复选中的模型。。。\"\n",
|
||||
"!mv /content/{MODELNAME}_D_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/G_{MODELEPOCH}.pth\n",
|
||||
"!mv /content/{MODELNAME}_G_{MODELEPOCH}.pth /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}/D_{MODELEPOCH}.pth\n",
|
||||
"\n",
|
||||
"!echo \"删除完成\"\n",
|
||||
"!ls /content/Retrieval-based-Voice-Conversion-WebUI/logs/{MODELNAME}"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"private_outputs": true,
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
Reference in New Issue
Block a user