Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,14 @@ class CustomTheme(Base):
|
|
47 |
|
48 |
custom_theme = CustomTheme()
|
49 |
|
50 |
-
def display_results(video_url, description):
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
if final_clip_path:
|
53 |
return final_clip_path, final_clip_path
|
54 |
return "No matching scene found", None
|
@@ -109,10 +115,11 @@ with gr.Blocks(theme=custom_theme, css=css) as demo:
|
|
109 |
gr.Markdown("### Upload your videos. Find sick clips. Tell your truth.", elem_classes="centered-markdown")
|
110 |
gr.Markdown("**Welcome to Sickstadium AI. Our goal is to empower content creators with the ability to tell their stories without the friction of traditional video editing software. Skip the timeline, and don't worry about your video editing skills. Upload your video, describe the clip you want, and let our AI video editor do the work for you. Get more info about the Sickstadium project at [Strongholdlabs.io](https://strongholdlabs.io/)**", elem_classes="centered-markdown")
|
111 |
video_url = gr.Textbox(label="Video URL:", elem_id="video_url")
|
|
|
112 |
description = gr.Textbox(label="Describe your clip:", elem_id="description")
|
113 |
submit_button = gr.Button("Process Video", elem_id="submit_button")
|
114 |
video_output = gr.Video(label="Processed Video", elem_id="video_output")
|
115 |
download_output = gr.File(label="Download Processed Video", elem_id="download_output")
|
116 |
-
submit_button.click(fn=display_results, inputs=[video_url, description], outputs=[video_output, download_output])
|
117 |
|
118 |
demo.launch()
|
|
|
47 |
|
48 |
custom_theme = CustomTheme()
|
49 |
|
50 |
+
def display_results(video_url, video_file, description):
|
51 |
+
if video_url:
|
52 |
+
final_clip_path = process_video(video_url, description, is_url=True)
|
53 |
+
elif video_file:
|
54 |
+
final_clip_path = process_video(video_file.name, description, is_url=False)
|
55 |
+
else:
|
56 |
+
return "No video provided", None
|
57 |
+
|
58 |
if final_clip_path:
|
59 |
return final_clip_path, final_clip_path
|
60 |
return "No matching scene found", None
|
|
|
115 |
gr.Markdown("### Upload your videos. Find sick clips. Tell your truth.", elem_classes="centered-markdown")
|
116 |
gr.Markdown("**Welcome to Sickstadium AI. Our goal is to empower content creators with the ability to tell their stories without the friction of traditional video editing software. Skip the timeline, and don't worry about your video editing skills. Upload your video, describe the clip you want, and let our AI video editor do the work for you. Get more info about the Sickstadium project at [Strongholdlabs.io](https://strongholdlabs.io/)**", elem_classes="centered-markdown")
|
117 |
video_url = gr.Textbox(label="Video URL:", elem_id="video_url")
|
118 |
+
video_file = gr.File(label="Upload Video File:", elem_id="video_file")
|
119 |
description = gr.Textbox(label="Describe your clip:", elem_id="description")
|
120 |
submit_button = gr.Button("Process Video", elem_id="submit_button")
|
121 |
video_output = gr.Video(label="Processed Video", elem_id="video_output")
|
122 |
download_output = gr.File(label="Download Processed Video", elem_id="download_output")
|
123 |
+
submit_button.click(fn=display_results, inputs=[video_url, video_file, description], outputs=[video_output, download_output])
|
124 |
|
125 |
demo.launch()
|