jschwab21 commited on
Commit
f774200
·
verified ·
1 Parent(s): 1115063

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,14 +1,20 @@
1
  import gradio as gr
2
  from video_processing import process_video
3
 
 
 
 
 
4
  # Define the Gradio interface
5
  with gr.Blocks() as demo:
6
  gr.Markdown("# My AI Video Processing App")
7
  video_url = gr.Textbox(label="Video URL or Filepath")
8
  description = gr.Textbox(label="Description of desired clip")
9
- output = gr.Textbox(label="Output", interactive=False)
 
10
  submit_button = gr.Button("Process Video")
11
- submit_button.click(fn=process_video, inputs=[video_url, description], outputs=output)
12
 
13
  # Launch the app
14
  demo.launch()
 
 
1
  import gradio as gr
2
  from video_processing import process_video
3
 
4
+ def display_results(video_url, description):
5
+ final_clip_path = process_video(video_url, description)
6
+ return final_clip_path, final_clip_path
7
+
8
  # Define the Gradio interface
9
  with gr.Blocks() as demo:
10
  gr.Markdown("# My AI Video Processing App")
11
  video_url = gr.Textbox(label="Video URL or Filepath")
12
  description = gr.Textbox(label="Description of desired clip")
13
+ video_output = gr.Video(label="Processed Video")
14
+ download_output = gr.File(label="Download Processed Video")
15
  submit_button = gr.Button("Process Video")
16
+ submit_button.click(fn=display_results, inputs=[video_url, description], outputs=[video_output, download_output])
17
 
18
  # Launch the app
19
  demo.launch()
20
+