GithubHelp home page GithubHelp logo

keonlee9420 / diffsinger Goto Github PK

View Code? Open in Web Editor NEW
228.0 228.0 30.0 136.23 MB

PyTorch implementation of DiffSinger: Singing Voice Synthesis via Shallow Diffusion Mechanism (focused on DiffSpeech)

License: MIT License

Python 100.00%
ddpm diffsinger diffusion diffusion-models english fastspeech neural-tts non-autoregressive pytorch singing-voice speech-synthesis text-to-speech tts

diffsinger's People

Contributors

keonlee9420 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

diffsinger's Issues

diffusion_projection in ResidualBlock

Your implementation has diffusion_projection for every residual block similar to DiffWave, but this is inconsistent with the paper as the original architecture directly adds E_t (output of the step embedding module) to the input before the first convolution layer. Is there a reason behind this change?

about preprocess data

hi, thanks for your work. but i met a problem in diffsinger and diffgan both
Traceback (most recent call last):
File "F:\DiffSinger-main\preprocess.py", line 19, in
preprocessor.build_from_path()
File "F:\DiffSinger-main\preprocessor\preprocessor.py", line 113, in build_from_path
if len(f0) > 0:
UnboundLocalError: local variable 'f0' referenced before assignment
it bothers me a lot, thanks for your help

Why use target enegy to generate enegy embeddings during training?

Hi Guys.

thank you very much for your great work!

I have one question regarding the function of get_energy_embedding in modules.py.

I see during training if the target enegy values is not none, the model uses the target ones to generate enegy embeddings instead of the predicted ones? Why?

def get_energy_embedding(self, x, target, mask, control):
        x.detach() + self.predictor_grad * (x - x.detach())
        prediction = self.energy_predictor(x, squeeze=True)
        if target is not None:
            embedding = self.energy_embedding(torch.bucketize(target, self.energy_bins))
        else:
            prediction = prediction * control
            embedding = self.energy_embedding(
                torch.bucketize(prediction, self.energy_bins)
            )
        return prediction, embedding

Conversely, the model uses the predicted pitch to generate pitch embeddings.

def get_pitch_embedding(self, decoder_inp, f0, uv, mel2ph, control, encoder_out=None):
        pitch_pred = f0_denorm = cwt = f0_mean = f0_std = None
        if self.pitch_type == "ph":
            pitch_pred_inp = encoder_out.detach() + self.predictor_grad * (encoder_out - encoder_out.detach())
            pitch_padding = encoder_out.sum().abs() == 0
            pitch_pred = self.pitch_predictor(pitch_pred_inp) * control
            if f0 is None:
                f0 = pitch_pred[:, :, 0]
            f0_denorm = denorm_f0(f0, None, self.preprocess_config["preprocessing"]["pitch"], pitch_padding=pitch_padding)
            pitch = f0_to_coarse(f0_denorm)  # start from 0 [B, T_txt]
            pitch = F.pad(pitch, [1, 0])
            pitch = torch.gather(pitch, 1, mel2ph)  # [B, T_mel]
            pitch_embed = self.pitch_embed(pitch) 

Could you please help to answer it?

Thank you!

Multi-Speaker setting

Hi, thanks for your excellent implementation. I would like to know how to apply this code to a multi-speaker setup, such as LibriTTS? More specifically, how can I add speaker embedding into the pipeline? Your response would help me a lot. Thanks in advance!!

Training Error

In this case, , i ran the scripts python3 train.py -p config/vietnam/preprocess.yaml -m config/vietnam/model.yaml -t config/vietnam/train.yaml
File "train.py", line 199, in
main(args, configs)
File "train.py", line 85, in main
losses = Loss(batch, output)
File "/home/thanhdo/envs/diffsinger_env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/thanhdo/Documents/DiffSinger/model/loss.py", line 69, in forward
log_duration_targets = log_duration_targets.masked_select(src_masks)
RuntimeError: The size of tensor a (39) must match the size of tensor b (136) at non-singleton dimension 1

Screen Shot 2021-06-23 at 3 56 10 PM

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.