Code Monkey home page Code Monkey logo

diff-hiervc's Introduction

Diff-HierVC: Diffusion-based Hierarchical Voice Conversion with Robust Pitch Generation and Masked Prior for Zero-shot Speaker Adaptation

The official Pytorch implementation of Diff-HierVC (Interspeeh 2023, Oral)

Ha-Yeong Choi, Sang-Hoon Lee, Seong-Whan Lee

image

Overall architecture

Although voice conversion (VC) systems have shown a remarkable ability to transfer voice style, existing methods still have an inaccurate pitch and low speaker adaptation quality. To address these challenges, we introduce Diff-HierVC, a hierarchical VC system based on two diffusion models. We first introduce DiffPitch, which can effectively generate $F_0$ with the target voice style. Subsequently, the generated $F_0$ is fed to DiffVoice to convert the speech with a target voice style. Furthermore, using the source-filter encoder, we disentangle the speech and use the converted Mel-spectrogram as a data-driven prior in DiffVoice to improve the voice style transfer capacity. Finally, by using the masked prior in diffusion models, our model can improve the speaker adaptation quality. Experimental results verify the superiority of our model in pitch generation and voice style transfer performance, and our model also achieves a CER of 0.83% and EER of 3.29% in zero-shot VC scenarios.

๐ŸŽง Audio Demo

https://diff-hiervc.github.io/audio_demo/

๐Ÿ“‘ Pre-trained Model

Our model checkpoints can be downloaded here.

  • model_diffhier.pth
  • voc_hifigan.pth
  • voc_bigvgan.pth

๐Ÿ”จ Usage

  1. Clone this rep && Install python requirement
git clone https://github.com/hayeong0/Diff-HierVC.git
pip install -r req*
  1. Download the pre-trained model checkpoint from drive and place it in the following path.
.
โ”œโ”€โ”€ ckpt
โ”‚   โ”œโ”€โ”€ config.json
โ”‚   โ””โ”€โ”€ model_diffhier.pth โœ…
โ”œโ”€โ”€ inference.py
โ”œโ”€โ”€ infer.sh
โ”œโ”€โ”€ model
โ”œโ”€โ”€ module
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ utils
โ””โ”€โ”€ vocoder
    โ”œโ”€โ”€ hifigan.py
    โ”œโ”€โ”€ modules.py
    โ””โ”€โ”€ voc_hifigan.pth โœ…
    โ””โ”€โ”€ voc_bigvgan.pth โœ…
  1. Run infer.sh

diffpitch_ts refers to the time step of the pitch generator and diffvoice_ts refers to the time step of the Mel generator.

Empirically, it has been observed that if the time step of diffpitch is too small, noise remains, and if it is too large, excessive diversity occurs.

Please use it appropriately for your dataset!

bash infer.sh

python3 inference.py \
    --src_path './sample/src_p241_004.wav' \
    --trg_path './sample/tar_p239_022.wav' \
    --ckpt_model './ckpt/model_diffhier.pth' \
    --ckpt_voc './vocoder/voc_bigvgan.pth' \
    --output_dir './converted' \
    --diffpitch_ts 30 \
    --diffvoice_ts 6

๐ŸŽง Test it on your own dataset and share your interesting results! :)

๐ŸŽ“ Citation

@inproceedings{choi23d_interspeech,
  author={Ha-Yeong Choi and Sang-Hoon Lee and Seong-Whan Lee},
  title={{Diff-HierVC: Diffusion-based Hierarchical Voice Conversion with Robust Pitch Generation and Masked Prior for Zero-shot Speaker Adaptation}},
  year=2023,
  booktitle={Proc. INTERSPEECH 2023},
  pages={2283--2287},
  doi={10.21437/Interspeech.2023-817}
}

๐Ÿ’Ž Acknowledgements

License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

diff-hiervc's People

Contributors

hayeong0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diff-hiervc's Issues

About model and code

Dear author, thank you for your outstanding work. I am also very interested in this paper and the diffusion model for pitch generator. I wonder when the source code and the specific training model can be made public. Thank you!

Getting 'Hparams' has no attribute 'hidden_size' when running infer.sh

Hi,
I am getting the following error when I ran infer.sh with the biggan Vocoder. I am not pasting the full traceback as it contains some sensitive paths. My python version is 3.10 and I didn't follow the same versions as given in the requirements.txt file as there were issues in installing natten with the version of pytorch given in that file. So I used 2.0.0 pytorch along with natten 0.17.1 . It will be great if you guys can add what python version you are using to run the model and a full package list with requisite dependencies.

  File "<pathto>/Diff-HierVC/model/diffhiervc.py", line 133, in __init__
    self.encoder = SynthesizerTrn(hps.model.hidden_size)
AttributeError: 'HParams' object has no attribute 'hidden_size' 

bigvgan

The config may not be correct, please update it.

data_loader.py" is missing

Thanks for publishing the train code.
I saw the code,
"from data_loader import AudioDataset, MelSpectrogramFixed"
but it looks like I can't import it because I don't have data_loader.py.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.