||22 hours ago|
|cluster||2 weeks ago|
|configs||2 weeks ago|
|configs_template||2 weeks ago|
|dataset_raw||2 weeks ago|
|filelists||2 weeks ago|
|hubert||2 weeks ago|
|inference||2 days ago|
|logs/44k||2 weeks ago|
|modules||2 weeks ago|
|onnxexport||2 weeks ago|
|raw||2 weeks ago|
|vdecoder||2 weeks ago|
|.gitignore||2 weeks ago|
|LICENSE||2 weeks ago|
|README.md||22 hours ago|
|README_zh_CN.md||22 hours ago|
|app.py||2 weeks ago|
|data_utils.py||2 weeks ago|
|flask_api.py||2 weeks ago|
|flask_api_full_song.py||1 week ago|
|inference_main.py||2 days ago|
|models.py||2 weeks ago|
|onnx_export.py||1 week ago|
|preprocess_flist_config.py||1 day ago|
|preprocess_hubert_f0.py||6 days ago|
|requirements.txt||1 week ago|
|requirements_win.txt||2 weeks ago|
|resample.py||2 weeks ago|
|spec_gen.py||2 weeks ago|
|train.py||4 days ago|
|utils.py||2 weeks ago|
|wav_upload.py||2 weeks ago|
SoftVC VITS Singing Voice Conversion
✨ A fork with a greatly improved interface: 34j/so-vits-svc-fork
✨ A client supports real-time conversion: w-okada/voice-changer
Warning: Please solve the authorization problem of the dataset on your own. You shall be solely responsible for any problems caused by the use of non-authorized datasets for training and all consequences thereof.The repository and its maintainer, svc develop team, have nothing to do with the consequences!
- This project is established for academic exchange purposes only and is intended for communication and learning purposes. It is not intended for production environments.
- Any videos based on sovits that are published on video platforms must clearly indicate in the description that they are used for voice changing and specify the input source of the voice or audio, for example, using videos or audios published by others and separating the vocals as input source for conversion, which must provide clear original video or music links. If your own voice or other synthesized voices from other commercial vocal synthesis software are used as the input source for conversion, you must also explain it in the description.
- Continuing to use this project is deemed as agreeing to the relevant provisions stated in this repository README. This repository README has the obligation to persuade, and is not responsible for any subsequent problems that may arise.
- If you distribute this repository's code or publish any results produced by this project publicly (including but not limited to video sharing platforms), please indicate the original author and code source (this repository).
- If you use this project for any other plan, please contact and inform the author of this repository in advance. Thank you very much.
Updated the 4.0-v2 model, the entire process is the same as 4.0. Compared to 4.0, there is some improvement in certain scenarios, but there are also some cases where it has regressed. Please refer to the 4.0-v2 branch for more information.
📝 Model Introduction
The singing voice conversion model uses SoftVC content encoder to extract source audio speech features, then the vectors are directly fed into VITS instead of converting to a text based intermediate; thus the pitch and intonations are conserved. Additionally, the vocoder is changed to NSF HiFiGAN to solve the problem of sound interruption.
🆕 4.0 Version Update Content
- Feature input is changed to Content Vec
- The sampling rate is unified to use 44100Hz
- Due to the change of hop size and other parameters, as well as the streamlining of some model structures, the required GPU memory for inference is significantly reduced. The 44kHz GPU memory usage of version 4.0 is even smaller than the 32kHz usage of version 3.0.
- Some code structures have been adjusted
- The dataset creation and training process are consistent with version 3.0, but the model is completely non-universal, and the data set needs to be fully pre-processed again.
- Added an option 1: automatic pitch prediction for vc mode, which means that you don't need to manually enter the pitch key when converting speech, and the pitch of male and female voices can be automatically converted. However, this mode will cause pitch shift when converting songs.
- Added option 2: reduce timbre leakage through k-means clustering scheme, making the timbre more similar to the target timbre.
📥 Pre-trained Model Files
- ContentVec: checkpoint_best_legacy_500.pt
- Place it under the
- Place it under the
# contentvec wget -P hubert/ http://obs.cstcloud.cn/share/obs/sankagenkeshi/checkpoint_best_legacy_500.pt # Alternatively, you can manually download and place it in the hubert directory
- Pre-trained model files:
- Place them under the
- Place them under the
Get them from svc-develop-team(TBD) or anywhere else.
Although the pretrained model generally does not cause any copyright problems, please pay attention to it. For example, ask the author in advance, or the author has indicated the feasible use in the description clearly.
📊 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
- Resample to 44100hz
- Automatically split the dataset into training, validation, and test sets, and generate configuration files
- Generate hubert and f0
After completing the above steps, the dataset directory will contain the preprocessed data, and the dataset_raw folder can be deleted.
python train.py -c configs/config.json -m 44k
Note: During training, the old models will be automatically cleared and only the latest three models will be kept. If you want to prevent overfitting, you need to manually backup the model checkpoints, or modify the configuration file
keep_ckpts to 0 to never clear them.
Up to this point, the usage of version 4.0 (training and inference) is exactly the same as version 3.0, with no changes (inference now has command line support).
# Example python inference_main.py -m "logs/44k/G_30400.pth" -c "configs/config.json" -n "君の知らない物語-src.wav" -t 0 -s "nen"
- -m, --model_path: path to the model.
- -c, --config_path: path to the configuration file.
- -n, --clean_names: a list of wav file names located in the raw folder.
- -t, --trans: pitch adjustment, supports positive and negative (semitone) values.
- -s, --spk_list: target speaker name for synthesis.
Optional parameters: see the next section
- -a, --auto_predict_f0: automatic pitch prediction for voice conversion, do not enable this when converting songs as it can cause serious pitch issues.
- -cm, --cluster_model_path: path to the clustering model, fill in any value if clustering is not trained.
- -cr, --cluster_infer_ratio: proportion of the clustering solution, range 0-1, fill in 0 if the clustering model is not trained.
🤔 Optional Settings
If the results from the previous section are satisfactory, or if you didn't understand what is being discussed in the following section, you can skip it, and it won't affect the model usage. (These optional settings have a relatively small impact, and they may have some effect on certain specific data, but in most cases, the difference may not be noticeable.)
Automatic f0 prediction
During the 4.0 model training, an f0 predictor is also trained, which can be used for automatic pitch prediction during voice conversion. However, if the effect is not good, manual pitch prediction can be used instead. But please do not enable this feature when converting singing voice as it may cause serious pitch shifting!
- Set "auto_predict_f0" to true in inference_main.
Cluster-based timbre leakage control
Introduction: The clustering scheme can reduce timbre leakage and make the trained model sound more like the target's timbre (although this effect is not very obvious), but using clustering alone will lower the model's clarity (the model may sound unclear). Therefore, this model adopts a fusion method to linearly control the proportion of clustering and non-clustering schemes. In other words, you can manually adjust the ratio between "sounding like the target's timbre" and "being clear and articulate" to find a suitable trade-off point.
The existing steps before clustering do not need to be changed. All you need to do is to train an additional clustering model, which has a relatively low training cost.
- Training process:
- Train on a machine with a good CPU performance. According to my experience, it takes about 4 minutes to train each speaker on a Tencent Cloud 6-core CPU.
- Execute "python cluster/train_cluster.py". The output of the model will be saved in "logs/44k/kmeans_10000.pt".
- Inference process:
- Specify "cluster_model_path" in inference_main.
- Specify "cluster_infer_ratio" in inference_main, where 0 means not using clustering at all, 1 means only using clustering, and usually 0.5 is sufficient.
[23/03/16] No longer need to download hubert manually
📤 Exporting to Onnx
- Create a folder named
checkpointsand open it
- Create a folder in the
checkpointsfolder as your project folder, naming it after your project, for example
- Rename your model as
model.pth, the configuration file as
config.json, and place them in the
aziplayerfolder you just created
path = "NyaruTaffy"in onnx_export.py to your project name,
path = "aziplayer"
- Run onnx_export.py
- Wait for it to finish running. A
model.onnxwill be generated in your project folder, which is the exported model.
UI support for Onnx models
Note: For Hubert Onnx models, please use the models provided by MoeSS. Currently, they cannot be exported on their own (Hubert in fairseq has many unsupported operators and things involving constants that can cause errors or result in problems with the input/output shape and results when exported.) Hubert4.0
For some reason the author deleted the original repository. Because of the negligence of the organization members, the contributor list was cleared because all files were directly reuploaded to this repository at the beginning of the reconstruction of this repository. Now add a previous contributor list to README.md.
Some members have not listed according to their personal wishes.
📚 Some legal provisions for reference
任何组织或者个人不得以丑化、污损，或者利用信息技术手段伪造等方式侵害他人的肖像权。未经肖像权人同意，不得制作、使用、公开肖像权人的肖像，但是法律另有规定的除外。 未经肖像权人同意，肖像作品权利人不得以发表、复制、发行、出租、展览等方式使用或者公开肖像权人的肖像。 对自然人声音的保护，参照适用肖像权保护的有关规定。