fffiloni commited on
Commit
241ee7b
1 Parent(s): 6c718bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -134,19 +134,20 @@ def infer(video_in):
134
  wave_files = get_wav_files('./outputs/tmp')
135
  print(wave_files)
136
  plot_spectrogram(wave_files[0], 'spectrogram.png')
137
-
138
- return wave_files[0], 'spectrogram.png'
139
 
140
  with gr.Blocks() as demo:
141
  with gr.Column(elem_id="col-container"):
142
  gr.Markdown("# Video-To-Audio")
143
  with gr.Row():
144
- video_in = gr.Video(label='Video IN')
145
- submit_btn = gr.Button("Submit")
146
- with gr.Row():
147
- output_sound = gr.Audio(label="Audio OUT")
148
- output_spectrogram = gr.Image(label='Spectrogram')
149
- merged_out = gr.Video(label="Merged video + generated audio")
 
150
 
151
  submit_btn.click(
152
  fn = infer,
 
134
  wave_files = get_wav_files('./outputs/tmp')
135
  print(wave_files)
136
  plot_spectrogram(wave_files[0], 'spectrogram.png')
137
+ final_merged_out = merge_audio_to_video(video_in, wave_files[0])
138
+ return wave_files[0], 'spectrogram.png', final_merged_out
139
 
140
  with gr.Blocks() as demo:
141
  with gr.Column(elem_id="col-container"):
142
  gr.Markdown("# Video-To-Audio")
143
  with gr.Row():
144
+ with gr.Column():
145
+ video_in = gr.Video(label='Video IN')
146
+ submit_btn = gr.Button("Submit")
147
+ with gr.Column():
148
+ output_sound = gr.Audio(label="Audio OUT")
149
+ output_spectrogram = gr.Image(label='Spectrogram')
150
+ merged_out = gr.Video(label="Merged video + generated audio")
151
 
152
  submit_btn.click(
153
  fn = infer,