so-vits-svc README

The project's README from github.com/svc-develop-team/so-vits-svc. As one markdown file: README.md.

LOGO

SoftVC VITS Singing Voice Conversion

English | 中文简体

Open In Colab Licence

This round of limited time update is coming to an end, the warehouse will enter the Archieve state, please know

✨ A studio that contains visible f0 editor, speaker mix timeline editor and other features (Where the Onnx models are used) : MoeVoiceStudio

✨ A fork with a greatly improved user interface: 34j/so-vits-svc-fork

✨ A client supports real-time conversion: w-okada/voice-changer

This project differs fundamentally from VITS, as it focuses on Singing Voice Conversion (SVC) rather than Text-to-Speech (TTS). In this project, TTS functionality is not supported, and VITS is incapable of performing SVC tasks. It's important to note that the models used in these two projects are not interchangeable or universally applicable.

Announcement

The purpose of this project was to enable developers to have their beloved anime characters perform singing tasks. The developers' intention was to focus solely on fictional characters and avoid any involvement of real individuals, anything related to real individuals deviates from the developer's original intention.

Disclaimer

This project is an open-source, offline endeavor, and all members of SvcDevelopTeam, as well as other developers and maintainers involved (hereinafter referred to as contributors), have no control over the project. The contributors have never provided any form of assistance to any organization or individual, including but not limited to dataset extraction, dataset processing, computing support, training support, inference, and so on. The contributors do not and cannot be aware of the purposes for which users utilize the project. Therefore, any AI models and synthesized audio produced through the training of this project are unrelated to the contributors. Any issues or consequences arising from their use are the sole responsibility of the user.

This project is run completely offline and does not collect any user information or gather user input data. Therefore, contributors to this project are not aware of all user input and models and therefore are not responsible for any user input.

This project serves as a framework only and does not possess speech synthesis functionality by itself. All functionalities require users to train the models independently. Furthermore, this project does not come bundled with any models, and any secondary distributed projects are independent of the contributors of this project.

📏 Terms of Use

Warning: Please ensure that you address any authorization issues related to the dataset on your own. You bear full responsibility for any problems arising from the usage of non-authorized datasets for training, as well as any resulting consequences. The repository and its maintainer, svc develop team, disclaim any association with or liability for the consequences.

  1. This project is exclusively established for academic purposes, aiming to facilitate communication and learning. It is not intended for deployment in production environments.
  2. Any sovits-based video posted to a video platform must clearly specify in the introduction the input source vocals and audio used for the voice changer conversion, e.g., if you use someone else's video/audio and convert it by separating the vocals as the input source, you must give a clear link to the original video or music; if you use your own vocals or a voice synthesized by another voice synthesis engine as the input source, you must also state this in your introduction.
  3. You are solely responsible for any infringement issues caused by the input source and all consequences. When using other commercial vocal synthesis software as an input source, please ensure that you comply with the regulations of that software, noting that the regulations of many vocal synthesis engines explicitly state that they cannot be used to convert input sources!
  4. Engaging in illegal activities, as well as religious and political activities, is strictly prohibited when using this project. The project developers vehemently oppose the aforementioned activities. If you disagree with this provision, the usage of the project is prohibited.
  5. If you continue to use the program, you will be deemed to have agreed to the terms and conditions set forth in README and README has discouraged you and is not responsible for any subsequent problems.
  6. If you intend to employ this project for any other purposes, kindly contact and inform the maintainers of this repository in advance.

📝 Model Introduction

The singing voice conversion model uses SoftVC content encoder to extract speech features from the source audio. These feature vectors are directly fed into VITS without the need for conversion to a text-based intermediate representation. As a result, the pitch and intonations of the original audio are preserved. Meanwhile, the vocoder was replaced with NSF HiFiGAN to solve the problem of sound interruption.

🆕 4.1-Stable Version Update Content

🆕 Questions about compatibility with the 4.0 model

  "model": {
    .........
    "ssl_dim": 256,
    "n_speakers": 200,
    "speech_encoder":"vec256l9"
  }

🆕 Shallow diffusion

Diagram

💬 Python Version

Based on our testing, we have determined that the project runs stable on Python 3.8.9.

📥 Pre-trained Model Files

Required

You need to select one encoder from the list below

1. If using contentvec as speech encoder(recommended)

vec768l12 and vec256l9 require the encoder

Or download the following ContentVec, which is only 199MB in size but has the same effect:

# contentvec
wget -P pretrain/ https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -O checkpoint_best_legacy_500.pt
# Alternatively, you can manually download and place it in the hubert directory
2. If hubertsoft is used as the speech encoder
3. If whisper-ppg as the encoder
4. If cnhubertlarge as the encoder
5. If dphubert as the encoder
6. If WavLM is used as the encoder
7. If OnnxHubert/ContentVec as the encoder

List of Encoders

Optional(Strongly recommend)

Get Sovits Pre-trained model from svc-develop-team(TBD) or anywhere else.

Diffusion model references Diffusion-SVC diffusion model. The pre-trained diffusion model is universal with the DDSP-SVC's. You can go to Diffusion-SVC's repo to get the pre-trained diffusion model.

While the pretrained model typically does not pose copyright concerns, it is essential to remain vigilant. It is advisable to consult with the author beforehand or carefully review the description to ascertain the permissible usage of the model. This helps ensure compliance with any specified guidelines or restrictions regarding its utilization.

Optional(Select as Required)

NSF-HIFIGAN

If you are using the NSF-HIFIGAN enhancer or shallow diffusion, you will need to download the pre-trained NSF-HIFIGAN model.

# nsf_hifigan
wget -P pretrain/ https://github.com/openvpi/vocoders/releases/download/nsf-hifigan-v1/nsf_hifigan_20221211.zip
unzip -od pretrain/nsf_hifigan pretrain/nsf_hifigan_20221211.zip
# Alternatively, you can manually download and place it in the pretrain/nsf_hifigan directory
# URL: https://github.com/openvpi/vocoders/releases/tag/nsf-hifigan-v1
RMVPE

If you are using the rmvpe F0 Predictor, you will need to download the pre-trained RMVPE model.

FCPE(Preview version)

FCPE(Fast Context-base Pitch Estimator) is a dedicated F0 predictor designed for real-time voice conversion and will become the preferred F0 predictor for sovits real-time voice conversion in the future.(The paper is being written)

If you are using the fcpe F0 Predictor, you will need to download the pre-trained FCPE model.

📊 Dataset Preparation

Simply place the dataset in the dataset_raw directory with the following file structure:

dataset_raw
├───speaker0
│   ├───xxx1-xxx1.wav
│   ├───...
│   └───Lxx-0xx8.wav
└───speaker1
    ├───xx2-0xxx2.wav
    ├───...
    └───xxx7-xxx007.wav

There are no specific restrictions on the format of the name for each audio file (naming conventions such as 000001.wav to 999999.wav are also valid), but the file type must be `WAV``.

You can customize the speaker's name as showed below:

dataset_raw
└───suijiSUI
    ├───1.wav
    ├───...
    └───25788785-20221210-200143-856_01_(Vocals)_0_0.wav

🛠️ Preprocessing

0. Slice audio

To avoid video memory overflow during training or pre-processing, it is recommended to limit the length of audio clips. Cutting the audio to a length of "5s - 15s" is more recommended. Slightly longer times are acceptable, however, excessively long clips may cause problems such as torch.cuda.OutOfMemoryError.

To facilitate the slicing process, you can use audio-slicer-GUI or audio-slicer-CLI

In general, only the Minimum Interval needs to be adjusted. For spoken audio, the default value usually suffices, while for singing audio, it can be adjusted to around 100 or even 50, depending on the specific requirements.

After slicing, it is recommended to remove any audio clips that are excessively long or too short.

If you are using whisper-ppg encoder for training, the audio clips must shorter than 30s.

1. Resample to 44100Hz and mono

python resample.py

Cautions

Although this project has resample.py scripts for resampling, mono and loudness matching, the default loudness matching is to match to 0db. This can cause damage to the sound quality. While python's loudness matching package pyloudnorm does not limit the level, this can lead to sonic boom. Therefore, it is recommended to consider using professional sound processing software, such as adobe audition for loudness matching. If you are already using other software for loudness matching, add the parameter -skip_loudnorm to the run command:

python resample.py --skip_loudnorm

2. Automatically split the dataset into training and validation sets, and generate configuration files.

python preprocess_flist_config.py --speech_encoder vec768l12

speech_encoder has the following options

vec768l12
vec256l9
hubertsoft
whisper-ppg
cnhubertlarge
dphubert
whisper-ppg-large
wavlmbase+

If the speech_encoder argument is omitted, the default value is vec768l12

Use loudness embedding

Add --vol_aug if you want to enable loudness embedding:

python preprocess_flist_config.py --speech_encoder vec768l12 --vol_aug

After enabling loudness embedding, the trained model will match the loudness of the input source; otherwise, it will match the loudness of the training set.

You can modify some parameters in the generated config.json and diffusion.yaml

diffusion.yaml
List of Vocoders
nsf-hifigan
nsf-snake-hifigan

3. Generate hubert and f0

python preprocess_hubert_f0.py --f0_predictor dio

f0_predictor has the following options

crepe
dio
pm
harvest
rmvpe
fcpe

If the training set is too noisy,it is recommended to use crepe to handle f0

If the f0_predictor parameter is omitted, the default value is rmvpe

If you want shallow diffusion (optional), you need to add the --use_diff parameter, for example:

python preprocess_hubert_f0.py --f0_predictor dio --use_diff

Speed Up preprocess

If your dataset is pretty large,you can increase the param --num_processes like that:

python preprocess_hubert_f0.py --f0_predictor dio --num_processes 8

All the worker will be assigned to different GPU if you have more than one GPUs.

After completing the above steps, the dataset directory will contain the preprocessed data, and the dataset_raw folder can be deleted.

🏋️‍ Training

Sovits Model

python train.py -c configs/config.json -m 44k

Diffusion Model (optional)

If the shallow diffusion function is needed, the diffusion model needs to be trained. The diffusion model training method is as follows:

python train_diff.py -c configs/diffusion.yaml

During training, the model files will be saved to logs/44k, and the diffusion model will be saved to logs/44k/diffusion

🤖 Inference

Use inference_main.py

# Example
python inference_main.py -m "logs/44k/G_30400.pth" -c "configs/config.json" -n "君の知らない物語-src.wav" -t 0 -s "nen"

Required parameters:

Optional parameters: see the next section

so-vits-svc (svc-develop-team/so-vits-svc)

Searching Database…

28.1K ·GitHub
archived
Что это такое?Открытый ИИ-фреймворк для конвертации поющего голоса (SVC): он обучает модели на PyTorch, которые заставляют один голос петь строки другого, используя речевые признаки SoftVC, подаваемые в VITS с вокодером NSF-HiFiGAN.
Это готовое приложение для смены голоса или мне придётся всё обучать самому?Это фреймворк для обучения и инференса, а не готовое приложение — моделей в комплекте нет, и для любой функции нужно обучить свою. В отличие от VITS, он умеет только SVC: поддержки TTS нет, и модели между ними не взаимозаменяемы.
Что нужно сделать, чтобы получить рабочую модель голоса?Подготовьте WAV-фрагменты (нарезать на куски по 5-15 секунд, пересэмплировать в 44100 Гц моно) в папке datasetraw, скачайте предобученный речевой энкодер и базовые чекпоинты в pretrain/ и logs/44k, затем запустите скрипты предобработки и обучения.
Что нужно установить и скачать перед обучением?Python 3.8.9 — версия, которую тестирование показало стабильной, — плюс предобученные файлы: речевой энкодер, например ContentVec (рекомендуется), базовые модели G0.pth и D0.pth, а по желанию — вокодер NSF-HiFiGAN и предиктор высоты тона RMVPE.
Проект ещё поддерживается?Нет — в README сказано, что финальный ограниченный по времени раунд обновлений завершён и репозиторий переходит в архивное состояние, так что новых исправлений и функций ждать не стоит.
Мои аудио или данные куда-то отправляются с моего компьютера?Ничего не покидает ваш компьютер: проект полностью работает офлайн и не собирает никакую информацию о пользователях или входные данные.
Есть ли подводные камни в лицензии или условиях использования?AGPL-3.0 плюс строгие дополнительные условия: только академическое использование, никаких развёртываний в продакшене; в SVC-видео, которые вы публикуете, нужно указывать источник входного вокала; а незаконное, религиозное и политическое использование прямо запрещено.
Мой ноутбук справится с обучением или нужна нормальная видеокарта?Для обучения по-настоящему нужна видеокарта с CUDA: размер батча должен помещаться в видеопамять, а слишком длинные фрагменты вызывают torch.cuda.OutOfMemoryError — именно поэтому рекомендуется нарезать аудио на куски по 5-15 секунд.
Зачем авторы создали этот проект?Чтобы разработчики могли заставить любимых аниме-персонажей петь. Команда подчёркивает, что проект задумывался только для вымышленных персонажей — всё, что связано с реальными людьми, отклоняется от первоначального замысла.
Умеет ли он конвертировать голос в реальном времени?Сам этот репозиторий — нет, но README ссылается на w-okada/voice-changer как на клиент с поддержкой конвертации в реальном времени, а предиктор высоты тона FCPE был создан специально для такой конвертации.
Какие речевые энкодеры можно выбрать?Перечислено тринадцать, включая vec768l12 (по умолчанию, использует рекомендуемый ContentVec), vec256l9, hubertsoft, whisper-ppg и whisper-ppg-large, cnhubertlarge, dphubert, wavlmbase+ (WavLM), а также несколько вариантов на ONNX.
Есть ли более удобные форки или дополнительные инструменты?Да: у 34j/so-vits-svc-fork значительно улучшенный пользовательский интерфейс, MoeVoiceStudio — студия с наглядным редактором f0 и таймлайном сведения спикеров, а клиент w-okada voice-changer закрывает работу в реальном времени.
Size
10.9 MB
Stars
28.1K
Updated
CommitOct 03
Age
3y
Commits · 90 Days