Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Jhonnytech90 patch 3 #7

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
83 changes: 42 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div align="center">

<h1>RVC GUI<br><br>
<h1>RVC GUI MODIFICADO PARA MAC-OS INTEL 🇧🇷<br><br>

For audio file inference only

em breve para M1/M2/M3
<br>


Expand All @@ -15,62 +15,75 @@ For audio file inference only



## GUI
## INTERFACE

![GUI](https://github.com/Tiger14n/RVC-GUI/raw/main/docs/GUI.JPG)
![GUI](https://github.com/jhonnytech90/RVC-GUI/blob/main/docs/RVC_GUI_MAC-OS.png)
<br><br>

## Direct setup for Windows users
## [Windows-pkg](https://github.com/Tiger14n/RVC-GUI/releases/tag/Windows-pkg)

<br><br>
## Preparing the environment
## PREPARANDO SUA MAQUINA


* Install Python version +3.8 if you have not:
* INSTALE O PYTHON VERSÃO +3.8:
* DONWLOAD https://www.python.org/downloads/
Caso tiver problemas instale outras versões

* Execute these commands
## VERSOES RECOMENDADAS
3.8.5
3.9.1
3.13


* EXECUTE ESTES COMANDOS

Windows with Nvidia cards
```bash
python -m pip install -U pip setuptools wheel
pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
```
Other
```
python -m pip install -U pip setuptools wheel
pip install -U torch torchaudio
pip install -r requirements.txt
```

Apple silicon Macs fix
* SE TIVER PROBLEMAS EXECUTE ESTES
```
python3 -m pip install -U pip setuptools wheel
pip3 install -U torch torchaudio
pip3 install -r requirements.txt
```

## SE TIVER PROBLEMAS COM DEPENDENCIAS
Recomendo que instale de forma manual usando o brew ou o pip/pip3 por exemplo
brew install ffmpeg
pip install ffmpeg
pip3 install ffmpeg
(estes coomandos sao exemplos)

* CORRIJA PROBLEMAS DO APPLE SILICON COM ESTES COMANDOS(M1/M2/M3)
```
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

export PYTORCH_ENABLE_MPS_FALLBACK=1
```
<br>

* Downlaod [hubert_base.pt](https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt/) and place it in the root folder
* BAIXE [hubert_base.pt](https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt/) E COLE NA PASTA RAIZ DO PROGRAMA

<br>

* Then use this command to start RVC GUI:
* USE ESTES COMANDOS PARA INICIAR O RVC GUI NO MACOS:
```bash
python rvcgui.py
```
Or run this file on windows
cd (ARRASTE A PASTA DO RVC PARA DENTRO DO TERMINAL OU COLE O ENDEREÇO DA LOCALIZAÇÃO DA PASTA)
```
RVC-GUI.bat
POR EXEMPLO : ( cd /user/desktop/RVC_GUI/) e em seguida:
```bash
python3 rvcgui.py
```
ou simplesmente abra o terminal e digite: (python3) de um espaço e arraste o arquivo RVC_gui.py dentro do terminal e de ENTER(RETURN)

# Loading models
use the import button to import a model from a zip file,
* The .zip must contain the ".pth" weight file.
* The .zip is recommended to contain the feature retrieval files ".index"
# CARREGANDO MODELOS
use o botão importar para importar um modelo de um arquivo zip,
* O .zip deve conter o arquivo de peso ".pth".
* O .zip é recomendado para conter os arquivos de recuperação de recursos ".index"

Or place the model manually in root/models
Ou coloque o modelo manualmente em root/models
```
models
├───Person1
Expand All @@ -84,15 +97,3 @@ models
````
<br>


<br>

### How to get models?.
* Join the[ AI Hub](https://discord.gg/aihub) Discord
* [Community Models on HuggingFace](https://huggingface.co/QuickWick/Music-AI-Voices/tree/main) by Wicked aka QuickWick

<br>

K7#4523


Binary file added docs/RVC_GUI_MAC-OS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 23 additions & 21 deletions rvcgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ def extract_model_from_zip(zip_path, output_dir):

def play_audio(file_path):
if sys.platform == 'win32':
audio_file = os.path.abspath(file_path)
subprocess.call(['start', '', audio_file], shell=True)
subprocess.call(['start', '', file_path], shell=True)
elif sys.platform == 'darwin':
audio_file = 'path/to/audio/file.wav'
subprocess.call(['open', audio_file])
subprocess.call(['open', file_path])
elif sys.platform == 'linux':
audio_file = 'path/to/audio/file.wav'
subprocess.call(['xdg-open', audio_file])
subprocess.call(['xdg-open', file_path])

else:
print("Arquivo de áudio não encontrado.")


def get_full_path(path):
return os.path.abspath(path)
Expand Down Expand Up @@ -325,31 +326,32 @@ def browse_zip():
extract_model_from_zip(zip_file, models_dir)
refresh_model_list()






def get_output_path(file_path):

output_dir = os.path.join(now_dir, "output")

if not os.path.exists(output_dir):
os.makedirs(output_dir)

if not os.path.exists(file_path):
# change the file extension to .wav

return file_path # File path does not exist, return as is
return os.path.join(output_dir, "output.wav")

# Split file path into directory, base filename, and extension
dir_name, file_name = os.path.split(file_path)
file_name, file_ext = os.path.splitext(file_name)

# Initialize index to 1
index = 1

# Increment index until a new file path is found
while True:
new_dir = f"{dir_name}\\{chosenOne}\\"
new_file_name = f"{file_name}_RVC_{index}{file_ext}"
new_file_path = os.path.join(new_dir, new_file_name)
new_file_name = f"{file_name}_RVC_{index}.wav"
new_file_path = os.path.join(output_dir, new_file_name)

if not os.path.exists(new_file_path):
# change the file extension to .wav
if not os.path.exists(new_dir):
os.makedirs(new_dir)
new_file_path = os.path.splitext(new_file_path)[0] + ".wav"
return new_file_path # Found new file path, return it
return new_file_path

index += 1

def on_button_click():
Expand Down