Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
10 |
submit_button = gr.Button("Process Video")
|
11 |
-
submit_button.click(fn=
|
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 |
+
|