none commited on
Commit
93fde94
·
1 Parent(s): d309119

add some examples

Browse files
app.py CHANGED
@@ -93,7 +93,7 @@ def deepdubber(video_path: str, subtitle_text: str, audio_path: str = None) -> s
93
  )
94
 
95
  try:
96
- response = response.split("<CONCLUSION>")[1].split("</CONCLUSION>")[0].strip()
97
  except Exception as e:
98
  print(f"Error: {e}, response: {response}")
99
  response = response.strip()[0]
@@ -218,10 +218,10 @@ def create_ui():
218
 
219
  with gr.Row():
220
  video_input = gr.Video(label="Upload video")
221
- audio_input = gr.Audio(label="Upload speech prompt (Optional)", type="filepath")
222
  subtitle_input = gr.Textbox(
223
  label="Enter the subtitle", placeholder="Enter the subtitle to be dubbed...", lines=5
224
  )
 
225
 
226
  process_btn = gr.Button("Start Dubbing")
227
 
@@ -229,12 +229,33 @@ def create_ui():
229
  output_response = gr.Textbox(label="Response", placeholder="Response from MMLM", lines=5)
230
  output_video = gr.Video(label="Dubbed Video")
231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  process_btn.click(
233
  fn=process_video_dubbing,
234
  inputs=[video_input, subtitle_input, audio_input],
235
  outputs=[output_response, output_video],
236
  )
237
 
 
 
238
  return app
239
 
240
 
 
93
  )
94
 
95
  try:
96
+ response = response.split("<REASONING>")[1].split("</REASONING>")[0].strip()
97
  except Exception as e:
98
  print(f"Error: {e}, response: {response}")
99
  response = response.strip()[0]
 
218
 
219
  with gr.Row():
220
  video_input = gr.Video(label="Upload video")
 
221
  subtitle_input = gr.Textbox(
222
  label="Enter the subtitle", placeholder="Enter the subtitle to be dubbed...", lines=5
223
  )
224
+ audio_input = gr.Audio(label="Upload speech prompt (Optional)", type="filepath")
225
 
226
  process_btn = gr.Button("Start Dubbing")
227
 
 
229
  output_response = gr.Textbox(label="Response", placeholder="Response from MMLM", lines=5)
230
  output_video = gr.Video(label="Dubbed Video")
231
 
232
+ # add some examples
233
+ examples = [
234
+ [
235
+ "datasets/CoTMovieDubbing/demo/v01input.mp4",
236
+ "it isn't simply a question of creating a robot who can love",
237
+ "datasets/CoTMovieDubbing/demo/speech_prompt_01.mp3",
238
+ ],
239
+ [
240
+ "datasets/CoTMovieDubbing/demo/v02input.mp4",
241
+ "Me, I'd be happy with one who's not... fixed.",
242
+ "datasets/CoTMovieDubbing/demo/speech_prompt_02.mp3",
243
+ ],
244
+ [
245
+ "datasets/CoTMovieDubbing/demo/v03input.mp4",
246
+ "Man, Papi. What am I gonna do?",
247
+ "datasets/CoTMovieDubbing/demo/speech_prompt_03.mp3",
248
+ ],
249
+ ]
250
+
251
  process_btn.click(
252
  fn=process_video_dubbing,
253
  inputs=[video_input, subtitle_input, audio_input],
254
  outputs=[output_response, output_video],
255
  )
256
 
257
+ gr.Examples(examples=examples, inputs=[video_input, subtitle_input, audio_input])
258
+
259
  return app
260
 
261
 
datasets/CoTMovieDubbing/demo/speech_prompt_01.mp3 ADDED
Binary file (75.5 kB). View file
 
datasets/CoTMovieDubbing/demo/speech_prompt_02.mp3 ADDED
Binary file (31.3 kB). View file
 
datasets/CoTMovieDubbing/demo/speech_prompt_03.mp3 ADDED
Binary file (35.2 kB). View file
 
datasets/CoTMovieDubbing/demo/v01input.mp4 ADDED
Binary file (311 kB). View file
 
datasets/CoTMovieDubbing/demo/v02input.mp4 ADDED
Binary file (556 kB). View file
 
datasets/CoTMovieDubbing/demo/v03input.mp4 ADDED
Binary file (534 kB). View file