sh-lee-prml / HierSpeechpp
- среда, 6 декабря 2023 г. в 00:00:05
The official implementation of HierSpeech++
Sang-Hoon Lee, Ha-Yeong Choi, Seung-Bin Kim, Seong-Whan Lee
Department of Artificial Intelligence, Korea University, Seoul, Korea
Large language models (LLM)-based speech synthesis has been widely adopted in zero-shot speech synthesis. However, they require a large-scale data and possess the same limitations as previous autoregressive speech models, including slow inference speed and lack of robustness. This paper proposes HierSpeech++, a fast and strong zero-shot speech synthesizer for text-to-speech (TTS) and voice conversion (VC). We verified that hierarchical speech synthesis frameworks could significantly improve the robustness and expressiveness of the synthetic speech. Furthermore, we significantly improve the naturalness and speaker similarity of synthetic speech even in zero-shot speech synthesis scenarios. For text-to-speech, we adopt the text-to-vec framework, which generates a self-supervised speech representation and an F0 representation based on text representations and prosody prompts. Then, HierSpeech++ generates speech from the generated vector, F0, and voice prompt. We further introduce a high-efficient speech super-resolution framework from 16 kHz to 48 kHz. The experimental results demonstrated that the hierarchical variational autoencoder could be a strong zero-shot speech synthesizer given that it outperforms LLM-based and diffusion-based models. Moreover, we achieved the first human-level quality zero-shot speech synthesis.
This repository contains:
This paper is an extension version of above papers.
pip install -r requirements.txt
pip install phonemizer
sudo apt-get install espeak-ng
Model | Sampling Rate | Params | Dataset | Hour | Speaker | Checkpoint |
---|---|---|---|---|---|---|
HierSpeech2 | 16 kHz | 97M | LibriTTS (train-460) | 245 | 1,151 | [Download] |
HierSpeech2 | 16 kHz | 97M | LibriTTS (train-960) | 555 | 2,311 | [Download] |
HierSpeech2 | 16 kHz | 97M | LibriTTS (train-960), Libri-light (Small, Medium), Expresso, MSSS(Kor), NIKL(Kor) | 2,796 | 7,299 | [Download] |
Model | Language | Params | Dataset | Hour | Speaker | Checkpoint |
---|---|---|---|---|---|---|
TTV | Eng | 107M | LibriTTS (train-960) | 555 | 2,311 | [Download] |
Model | Sampling Rate | Params | Dataset | Checkpoint |
---|---|---|---|---|
SpeechSR-24k | 16kHz --> 24 kHz | 0.13M | LibriTTS (train-960), MSSS (Kor) | speechsr24k |
SpeechSR-48k | 16kHz --> 48 kHz | 0.13M | MSSS (Kor), Expresso (Eng), VCTK (Eng) | speechsr48k |
sh inference.sh
# --ckpt "logs/hierspeechpp_libritts460/hierspeechpp_lt460_ckpt.pth" \ LibriTTS-460
# --ckpt "logs/hierspeechpp_libritts960/hierspeechpp_lt960_ckpt.pth" \ LibriTTS-960
# --ckpt "logs/hierspeechpp_eng_kor/hierspeechpp_v1_ckpt.pth" \ Large_v1 epoch 60 (paper version)
# --ckpt "logs/hierspeechpp_eng_kor/hierspeechpp_v1.1_ckpt.pth" \ Large_v1.1 epoch 200 (20. Nov. 2023)
CUDA_VISIBLE_DEVICES=0 python3 inference.py \
--ckpt "logs/hierspeechpp_eng_kor/hierspeechpp_v1.1_ckpt.pth" \
--ckpt_text2w2v "logs/ttv_libritts_v1/ttv_lt960_ckpt.pth" \
--output_dir "tts_results_eng_kor_v2" \
--noise_scale_vc "0.333" \
--noise_scale_ttv "0.333" \
--denoise_ratio "0"
# without denoiser
--denoise_ratio "0"
# with denoiser
--denoise_ratio "1"
# Mixup (Recommend 0.6~0.8)
--denoise_rate "0.8"
sh inference_vc.sh
# --ckpt "logs/hierspeechpp_libritts460/hierspeechpp_lt460_ckpt.pth" \ LibriTTS-460
# --ckpt "logs/hierspeechpp_libritts960/hierspeechpp_lt960_ckpt.pth" \ LibriTTS-960
# --ckpt "logs/hierspeechpp_eng_kor/hierspeechpp_v1_ckpt.pth" \ Large_v1 epoch 60 (paper version)
# --ckpt "logs/hierspeechpp_eng_kor/hierspeechpp_v1.1_ckpt.pth" \ Large_v1.1 epoch 200 (20. Nov. 2023)
CUDA_VISIBLE_DEVICES=0 python3 inference_vc.py \
--ckpt "logs/hierspeechpp_eng_kor/hierspeechpp_v1.1_ckpt.pth" \
--output_dir "vc_results_eng_kor_v2" \
--noise_scale_vc "0.333" \
--noise_scale_ttv "0.333" \
--denoise_ratio "0"
--output_sr "48000" # Default
--output_sr "24000" #
--output_sr "16000" # without super-resolution.
if denoise == 0:
audio = torch.cat([audio.cuda(), audio.cuda()], dim=0)
else:
with torch.no_grad():
if ori_prompt_len > 80000:
denoised_audio = []
for i in range((ori_prompt_len//80000)):
denoised_audio.append(denoise(audio.squeeze(0).cuda()[i*80000:(i+1)*80000], denoiser, hps_denoiser))
denoised_audio.append(denoise(audio.squeeze(0).cuda()[(i+1)*80000:], denoiser, hps_denoiser))
denoised_audio = torch.cat(denoised_audio, dim=1)
else:
denoised_audio = denoise(audio.squeeze(0).cuda(), denoiser, hps_denoiser)
audio = torch.cat([audio.cuda(), denoised_audio[:,:audio.shape[-1]]], dim=0)
We hope to compare LLM-based models for zero-shot TTS baselines. However, there is no public-available official implementation of LLM-based TTS models. Unfortunately, unofficial models have a poor performance in zero-shot TTS so we hope they will release their model for a fair comparison and reproducibility and for our speech community. THB I could not stand the inference speed almost 1,000 times slower than e2e models It takes 5 days to synthesize the full sentences of LibriTTS-test subsets. Even, the audio quality is so bad. I hope they will release their official source code soon.
In my very personal opinion, VITS is still the best TTS model I have ever seen. But, I acknowledge that LLM-based models have much powerful potential for their creative generative performance from the large-scale dataset but not now.
# Data Filtering for limited computation resource.
wav_min = 32
wav_max = 600 # 12s
text_min = 1
text_max = 200
TTV v2 may reduce this issue significantly...!
We have attached all samples from LibriTTS test-clean and test-other.
Our repository is heavily based on VITS and BigVGAN.
Thanks for all nice works.