Merge pull request #131 from Alienpups/main

Installation and usage guide on Windows via VSC
This commit is contained in:
Zengyi Qin 2024-02-18 22:45:59 -05:00 committed by GitHub
commit 3fb455f11d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 49 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# Usage
## Table of Content
- [Use in MyShell](#use-in-myshell): directly use the Instant Voice Clone and TTS services.
- [Minimal Demo](#minimal-demo): quickly try OpenVoice and do not require high quality.
- [Linux Install](#linux-install): for researchers and developers only.
@ -10,19 +11,25 @@
For most users, the most convenient way is to directly use the free TTS and Instant Voice Clone services in MyShell.
### TTS
Go to [https://app.myshell.ai/explore](https://app.myshell.ai/explore) and follow the instructions below:
<div align="center">
<img src="../resources/tts-guide.png" width="1200"/>
</div>
### Voice Clone
Go to [https://app.myshell.ai/explore](https://app.myshell.ai/explore) and follow the instructions below:
<div align="center">
<img src="../resources/voice-clone-guide.png" width="61200"/>
</div>
## Minimal Demo
For users who want to quickly try OpenVoice and do not require high quality or stability, click any of the following links:
<div align="center">
<a href="https://www.lepton.ai/playground/openvoice"><img src="../resources/lepton-hd.png" height="28"></a>
&nbsp;&nbsp;&nbsp;&nbsp;
@ -32,14 +39,17 @@ For users who want to quickly try OpenVoice and do not require high quality or s
</div>
## Linux Install
This section is only for developers and researchers who are familiar with Linux, Python and PyTorch. Clone this repo, and run
```
conda create -n openvoice python=3.9
conda activate openvoice
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
pip install -r requirements.txt
```
Download the checkpoint from [here](https://myshell-public-repo-hosting.s3.amazonaws.com/checkpoints_1226.zip) and extract it to the `checkpoints` folder
Download the checkpoint from [here](https://myshell-public-repo-hosting.s3.amazonaws.com/checkpoints_1226.zip) and extract it to the `checkpoints` folder
**1. Flexible Voice Style Control.**
Please see [`demo_part1.ipynb`](../demo_part1.ipynb) for an example usage of how OpenVoice enables flexible style control over the cloned voice.
@ -54,3 +64,7 @@ The base speaker model can be replaced with any model (in any language and style
**4. Tips to Generate Natural Speech.**
There are many single or multi-speaker TTS methods that can generate natural speech, and are readily available. By simply replacing the base speaker model with the model you prefer, you can push the speech naturalness to a level you desire.
## Windows Install (VS Code)
Please use [this guide](https://github.com/Alienpups/OpenVoice/blob/main/docs/USAGE_WINDOWS.md) if you want to install and use OpenVoice on Windows.

34
docs/USAGE_WINDOWS.md Normal file
View File

@ -0,0 +1,34 @@
# How to install Python 3.9 via Microsoft Store
1. Open the Microsoft Store app on your Windows 10/11 device. You can search for it in the Start menu or press the Windows logo key + S and type "store".
2. In the Microsoft Store app, search for "Python 3.9" or click on this link: [Python 3.9].
3. On the Python 3.9 app page, click on the "Get" button to download and install it. You may need to sign in with your Microsoft account if you haven't already.
4. Once the installation is complete, you can launch Python 3.9 from the Start menu or by typing "python" in the command prompt.
5. To verify that Python 3.9 is installed correctly, you can run the following command in the command prompt: `python --version`. It should display something like "Python 3.9.0".
6. Congratulations, you have successfully installed Python 3.9 via Microsoft Store. You can now use it to create and run Python scripts, modules, and applications. 🐍
# How to install Visual Studio Code via Microsoft Store
1. Open the Microsoft Store app on your Windows 10/11 device. You can search for it in the Start menu or press the Windows logo key + S and type "store".
2. In the Microsoft Store app, search for "Visual Studio Code" or click on this link: [Visual Studio Code](https://apps.microsoft.com/detail/XP9KHM4BK9FZ7Q?hl=en-US&gl=US).
3. On the Visual Studio Code app page, click on the "Get" button to download and install it. You may need to sign in with your Microsoft account if you haven't already.
4. Once the installation is complete, you can launch Visual Studio Code from the Start menu.
5. Congratulations, you have successfully installed Visual Studio Code via Microsoft Store. You can now use it to edit and debug code in various languages and frameworks. 💻
# How to install OpenVoice from GitHub using Visual Studio Code terminal
1. Launch Visual Studio Code and open a folder where you want to store the openvoice project. You can use the File > Open Folder menu command.
2. Open the integrated terminal in Visual Studio Code by using the Terminal > New Terminal menu command. Make sure that the terminal shows the same folder name as the one you opened in the previous step. If not, you can use the cd command to change the directory.
3. Clone the openvoice repository from GitHub by running this command in the terminal: `git clone https://github.com/myshell-ai/OpenVoice.git`.
4. Create a Python environment for the openvoice project. Press F1 and select the Python: Create Environment command.
5. Choose venv as the environment type and Python 3.9 as the interpreter. The environment will be created in the ".venv" folder within your project.
6. VS Code will ask you if you want to install the dependencies that are in the requirements.txt in the openvoice folder. Confirm this with Yes. If the prompt does not appear, go to step 10.
7. Make sure that the venv is activated in the terminal. You can tell if the venv is activated by looking at the prefix of the terminal prompt. It should show the name of the venv in parentheses, e.g. "(.venv)". If the venv is not activated, go to step 8. If the venv is activated, go to step 11.
8. Activate the venv manually by running this command in the terminal: `.\.venv\Scripts\activate`. Or create a new terminal in VS Code, which will activate the venv automatically for you.
9. Install ipykernel to run the notebooks. VS Code may prompt you to do this automatically. Confirm this with Yes. If not, install ipykernel manually by running this command in the terminal: `pip install ipykernel`.
10. Install the dependencies manually by running this command in the terminal: `pip install -r requirements.txt`. This step is only necessary if the dependencies were not installed automatically in step 6.
11. Download the required model checkpoints from this link: [Checkpoints](https://myshell-public-repo-hosting.s3.amazonaws.com/checkpoints_1226.zip), extract the zip and place the checkpoints folder in the openvoice folder.
12. To use openvoice, you can open and run the Jupyter notebooks that are in the openvoice folder. These notebooks will show you how to use openvoice to clone voices in various languages and styles. You can open the notebooks in VS Code by clicking on them in the Explorer on the left side.
13. To run the notebooks, you will need to install the Jupyter extension for VS Code. You can do this by pressing F1 and selecting the Extensions: Install Extensions command. Search for "Jupyter" and install the extension by Microsoft.
14. After installing the extension, you can run the notebooks by clicking on the play button next to the code blocks. The first notebook you should run is demo_part1.ipynb, which will guide you through the basic steps of using openvoice. You will need to provide a reference audio file for tone color extraction. You can use the sample audio files that are in the openvoice/resources folder or use your own audio file which you can also place inside the recources folder. The notebook will show you how to load the audio file, extract the tone color, and synthesize a new voice with the same tone color. You can also run the other notebooks, such as demo_part2.ipynb to see more advanced features of openvoice, such as style transfer and voice cloning. If you get a message that says something about ipywidgets being outdated or missing, you can install ipywidgets by running this command in the terminal: `pip install ipywidgets`.
15. Congratulations, you have successfully installed OpenVoice from GitHub using Visual Studio Code terminal. You can now use it to clone voices in various languages and styles. 🎙️