Install OpenVoice v2 Locally - Instantly Clone Voice with AI
conda create -nopenvoice python=3.9
conda activate openvoice
git clone https://github.com/myshell-ai/openVoice.git
cd openVoice
pip install -e .
mkdir checkpoints_v2
cd checkpoints_v2
wget https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip
unzip checkpoints_v2_0417.zip
mv checkpoints_v2 ~/openVoice
pip install git+https://github.com/cocktailpeanut/ov2.git
cd ..
pip install git+https://github.com/myshell-ai/MeloTTS.git
python -m unidic download
cd resources
python3
import os
import torch
from openvoice import se_extractor
from openvoice.api import ToneColorConverter
ckpt_converter = 'checkpoints_v2/converter'
device = "cuda:0" if torch.cuda.is_available() else "cpu"
output_dir = 'outputs_v2'
tone_color_converter = ToneColorCOnverter(f' {ckpt_converter} /config.json', device=device)
tone_color_converter.load_ckpt(f' {ckpt_converter} /checkpoint.pth')
os.makedirs (output_dir, exist_ok=True)
reference_speaker = 'resources/example_reference.mp3'