1편 포스트에서 소개했던 Easy GUI 일단 저번에 찾지 못했던 개발자 repo를 발견했다.
https://github.com/luisesantillan/project
23년 9월 12일 버젼으로 업데이트가 있었는데
Easy GUI 가 어쩌면 유료화하려고 각을 재고 있는건지도 모르겠단 생각이 든다. 그 이유는 아래와 같은데,
#@markdown Check to load models from your Google Drive RVC folder
import os, zipfile, shutil, tarfile
import ipywidgets as widgets
from IPython.display import clear_output
backup = {
'hubert_base.pt':'https://drive.google.com/file/d/1tHNmjoSHJj7G2xX_Knz4zZ8Mg7g-VhAW/view?usp=sharing',
'pretrained_v2/D40k.pth':'https://drive.google.com/file/d/1BJ3TKdn2xAK9VbV8UIDoo_9K4Yyfjs7-/view?usp=sharing -O pretrained_v2/D40k.pth',
'pretrained_v2/G40k.pth':'https://drive.google.com/file/d/1BJ3TKdn2xAK9VbV8UIDoo_9K4Yyfjs7-/view?usp=sharing -O pretrained_v2/G40k.pth',
'pretrained_v2/f0D40k.pth':'https://drive.google.com/file/d/1A33v5MT1L_-v4iP550ibl5givEqgDus1/view?usp=sharing -O pretrained_v2/f0D40k.pth',
'pretrained_v2/f0G40k.pth':'https://drive.google.com/file/d/1mMEOosc4FO3QRhYxIhHr-GVCxF05tjwV/view?usp=sharing -O pretrained_v2/f0G40k.pth',
'rmvpe.pt':'https://drive.google.com/file/d/1ABwfoHKBlUsyGIy-f_axaHM6vcXxZzQU/view?usp=drive_link'
}
def aria_backup(missing_file):
url = backup[missing_file]
!gdown --fuzzy $url
gdrive=False#@param {type:"boolean"}
tensorboard=False#@param {type:"boolean"}
f_key = 'WebUI'
e_key = 'E' + 'V' + 'C'
success=widgets.Button(description="\u2714 Success.",disabled=True, button_style="success")
if not "installed" in locals():
!wget https://github.com/777gt/{e_key}/raw/main/wav2lip-HD.tar.gz
!wget https://github.com/777gt/{e_key}/raw/main/wav2lip-cache.tar.gz
import tarfile, os
with tarfile.open('/content/wav2lip-cache.tar.gz', 'r:gz') as tar:
for member in tar.getmembers():
target_path = os.path.join('/', member.name)
try:
tar.extract(member, '/')
except:
pass
with tarfile.open('/content/wav2lip-HD.tar.gz') as tar:
tar.extractall('/content')
if gdrive:
from google.colab import drive
drive.mount('/content/drive')
if os.path.exists('/content/drive'):
!mkdir -p /content/drive/MyDrive/RVC_Packages
if not os.path.exists('/content/drive/MyDrive/RVC_Packages/Packages.tar.gz'):
!wget https://github.com/777gt/{e_key}/raw/main/Packages.tar.gz -O /content/drive/MyDrive/RVC_Packages/Packages.tar.gz
with tarfile.open('/content/drive/MyDrive/RVC_Packages/Packages.tar.gz', 'r:gz') as tar:
for member in tar.getmembers():
target_path = os.path.join('/', member.name)
tar.extract(member, '/')
else:
!wget https://github.com/777gt/{e_key}/raw/main/Packages.tar.gz -O /content/Packages.tar.gz
with tarfile.open('/content/Packages.tar.gz', 'r:gz') as tar:
for member in tar.getmembers():
target_path = os.path.join('/', member.name)
tar.extract(member, '/')
else:
!wget https://github.com/777gt/{e_key}/raw/main/Packages.tar.gz -O /content/Packages.tar.gz
with tarfile.open('/content/Packages.tar.gz', 'r:gz') as tar:
for member in tar.getmembers():
target_path = os.path.join('/', member.name)
tar.extract(member, '/')
!pip install -q gTTS torchcrepe
!pip install gradio --upgrade
%cd /content
!git clone https://github.com/777gt/-EVC-
%cd /content/-EVC-
!wget https://huggingface.co/lj1995/VoiceConversion{f_key}/resolve/main/rmvpe.pt
!wget https://huggingface.co/lj1995/VoiceConversion{f_key}/resolve/main/hubert_base.pt
!wget https://huggingface.co/lj1995/VoiceConversion{f_key}/resolve/main/pretrained_v2/D40k.pth -O /content/-EVC-/pretrained_v2/D40k.pth
!wget https://huggingface.co/lj1995/VoiceConversion{f_key}/resolve/main/pretrained_v2/G40k.pth -O /content/-EVC-/pretrained_v2/G40k.pth
!wget https://huggingface.co/lj1995/VoiceConversion{f_key}/resolve/main/pretrained_v2/f0D40k.pth -O /content/-EVC-/pretrained_v2/f0D40k.pth
!wget https://huggingface.co/lj1995/VoiceConversion{f_key}/resolve/main/pretrained_v2/f0G40k.pth -O /content/-EVC-/pretrained_v2/f0G40k.pth
for file in list(backup.keys()):
if not os.path.exists(file): aria_backup(file)
installed=True
clear_output()
display(success)
if gdrive:
if os.path.exists('/content/drive/MyDrive/RVC'):
%cd /content/drive/MyDrive/RVC
else:
!mkdir -p /content/drive/MyDrive/RVC
%cd /content/drive/MyDrive/RVC
!mkdir -p /content/unzips
for file in os.listdir():
if file.endswith('.zip'):
file_name=file.split('.')[0]
zip_path = f'/content/drive/MyDrive/RVC/{file}'
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
for member in zip_ref.infolist():
if member.filename.endswith('.pth'):
extraction_dir=f'/content/unzips/{file_name}'
file_size = member.file_size
if file_size < 100 * 1024 * 1024:
with zip_ref.open(member) as file:
if len(file.read()) < 100 * 1024 * 1024:
zip_ref.extract(member, path=extraction_dir)
!find /content/unzips/{file_name} -name '*.pth' -exec mv {{}} /content/-EVC-/weights/{file_name}.pth \;
if member.filename.endswith('.index'):
extraction_dir=f'/content/unzips/'
with zip_ref.open(member) as file:
zip_ref.extract(member, path=extraction_dir)
!mkdir -p /content/-EVC-/logs/{file_name}
os.chdir(f"/content/-EVC-/logs/{file_name}")
!find /content/unzips -name *.index -exec mv {} . \;
if os.path.exists('/content/unzips'):
shutil.rmtree('/content/unzips')
pass
if tensorboard:
%load_ext tensorboard
%tensorboard --logdir /content/-EVC-/logs
%cd /content/-EVC-
!mkdir -p ./audios
!python3 GUI.py --colab --pycmd python3
tensorboard=True#@param {type:"boolean"}
if not "installed" in locals():
from IPython.display import clear_output
from ipywidgets import Button
%cd /content
!git clone https://github.com/luisesantillan/project
%cd /content/project
!pip install -r requirements.txt
!python download_files.py
clear_output()
Button(description="\u2714 Success", button_style='success')
installed=True
%cd /content/project
if tensorboard:
%load_ext tensorboard
%tensorboard --logdir ./logs
!python app.py --colab
개인적으로 해당 툴을 매우 잘 활용하고 있지만 버젼 업데이트가 되면서 여러 에러와 이슈들이 새로 생긴 부분이 아쉽다. 개인 repo에 fork 해서 디버깅이나 세부 기능을 추가하는 방식으로 기여해보고 싶다.
다행히 나는 해당 프로젝트가 언젠가 비공개 코드로 전환되고 유료화될 수도 있다는 생각에 개인 저장소에 사본은 저장해놨다. 초반 코드부터 분석하면서 내 덕질용 니즈와 입맛에 맞게 커스터마이징 하는 것도 재밌을 것 같다.
코드를 보면 우선 첫번째로 눈에 띄는게
https://github.com/777gt 와 https://huggingface.co/lj1995 에서 wget으로 중요해 보이는 파일을 받아온다는 것이다.
일단 이런 기본적인 분석부터 시작해서 커스터마이징을 시작할 수 있는 지점을 찾아야 겠다.