haoheliu radames commited on
Commit
84a0384
1 Parent(s): 91dd1a0

set video dimension via bg image (#18)

Browse files

- set video dimension via bg image (68bf70aa2857d18689ca9f827a60f22a8ea2244c)


Co-authored-by: Radamés Ajna <[email protected]>

Files changed (2) hide show
  1. app.py +1 -1
  2. bg.png +0 -0
app.py CHANGED
@@ -26,7 +26,7 @@ audioldm = build_model()
26
  def text2audio(text, duration, guidance_scale, random_seed, n_candidates):
27
  # print(text, length, guidance_scale)
28
  waveform = text_to_audio(audioldm, text, random_seed, duration=duration, guidance_scale=guidance_scale, n_candidate_gen_per_text=int(n_candidates)) # [bs, 1, samples]
29
- waveform = [gr.make_waveform((16000, wave[0])) for wave in waveform]
30
  # waveform = [(16000, np.random.randn(16000)), (16000, np.random.randn(16000))]
31
  if(len(waveform) == 1):
32
  waveform = waveform[0]
 
26
  def text2audio(text, duration, guidance_scale, random_seed, n_candidates):
27
  # print(text, length, guidance_scale)
28
  waveform = text_to_audio(audioldm, text, random_seed, duration=duration, guidance_scale=guidance_scale, n_candidate_gen_per_text=int(n_candidates)) # [bs, 1, samples]
29
+ waveform = [gr.make_waveform((16000, wave[0]), bg_image="bg.png") for wave in waveform]
30
  # waveform = [(16000, np.random.randn(16000)), (16000, np.random.randn(16000))]
31
  if(len(waveform) == 1):
32
  waveform = waveform[0]
bg.png ADDED