Giter VIP home page Giter VIP logo

Comments (3)

yl4579 avatar yl4579 commented on May 19, 2024

How many speakers do you have? If it is a single speaker dataset you are finetuning, you do not need any reference (and can even set multispeaker flag to false and do not load the pretrained diffusion model). Otherwise you do need a reference in the same way as the base model because the model needs to know the target speaker you want to synthesize. Or you can just hard code the speaker embeddings as a part of the model weights if you do not want any reference.

from styletts2.

eschmidbauer avatar eschmidbauer commented on May 19, 2024

My dataset is 1 speaker but libritts is many speakers. I used the libritts model you shared to finetune. I will try setting multispeaker flag to false

from styletts2.

yl4579 avatar yl4579 commented on May 19, 2024

It should work even if you set multispeaker flag to true. You just need a arbitrary reference audio from the training set. You can save this as a part of the parameters. For example,

text = '''Maltby and Company would issue warrants on them deliverable to the importer, and the goods were then passed to be stored in neighboring warehouses.
'''

reference_dicts = {}
reference_dicts['LJSpeech'] = "data/LJSpeech-1.1/wavs/LJ001-0001.wav"

start = time.time()
noise = torch.randn(1,1,256).to(device)
for k, path in reference_dicts.items():
    ref_s = compute_style(path)
    
    wav = inference(text, ref_s, alpha=0.9, beta=0.9, diffusion_steps=10, embedding_scale=1)
    rtf = (time.time() - start) / (len(wav) / 24000)
    print(f"RTF = {rtf:5f}")
    import IPython.display as ipd
    print(k + ' Synthesized:')
    display(ipd.Audio(wav, rate=24000, normalize=False))
    print('Reference:')
    display(ipd.Audio(path, rate=24000, normalize=False))

from styletts2.

Related Issues (20)

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.