Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,14 +57,6 @@ def save_uploaded_file(uploaded_file):
|
|
57 |
with open(file_path, "wb") as f:
|
58 |
f.write(uploaded_file)
|
59 |
return file_path
|
60 |
-
|
61 |
-
import gradio as gr
|
62 |
-
from video_processing import process_video, download_video, find_scenes, analyze_scenes, extract_best_scene, cleanup_temp_files
|
63 |
-
import plotly.graph_objects as go
|
64 |
-
import os
|
65 |
-
import uuid
|
66 |
-
|
67 |
-
# Assuming CustomTheme and other setups are defined above this snippet
|
68 |
|
69 |
def display_results(video_url, video_file, description):
|
70 |
if video_url:
|
@@ -119,9 +111,6 @@ def display_results(video_url, video_file, description):
|
|
119 |
return final_clip_path, final_clip_path, fig
|
120 |
else:
|
121 |
return "No matching scene found", None, None
|
122 |
-
|
123 |
-
# Assuming Gradio Blocks setup is defined below this snippet
|
124 |
-
|
125 |
|
126 |
|
127 |
# Custom CSS for additional styling
|
@@ -174,15 +163,6 @@ h3 {
|
|
174 |
}
|
175 |
"""
|
176 |
|
177 |
-
|
178 |
-
def save_uploaded_file(uploaded_file):
|
179 |
-
upload_dir = "uploaded_videos"
|
180 |
-
os.makedirs(upload_dir, exist_ok=True)
|
181 |
-
file_path = os.path.join(upload_dir, f"{uuid.uuid4()}.mp4")
|
182 |
-
with open(file_path, "wb") as f:
|
183 |
-
f.write(uploaded_file)
|
184 |
-
return file_path
|
185 |
-
|
186 |
with gr.Blocks(theme=custom_theme, css=css) as demo:
|
187 |
with gr.Column():
|
188 |
gr.Markdown("# **Sickstadium AI**", elem_classes="centered-markdown", elem_id="sickstadium-title")
|
|
|
57 |
with open(file_path, "wb") as f:
|
58 |
f.write(uploaded_file)
|
59 |
return file_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
def display_results(video_url, video_file, description):
|
62 |
if video_url:
|
|
|
111 |
return final_clip_path, final_clip_path, fig
|
112 |
else:
|
113 |
return "No matching scene found", None, None
|
|
|
|
|
|
|
114 |
|
115 |
|
116 |
# Custom CSS for additional styling
|
|
|
163 |
}
|
164 |
"""
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
with gr.Blocks(theme=custom_theme, css=css) as demo:
|
167 |
with gr.Column():
|
168 |
gr.Markdown("# **Sickstadium AI**", elem_classes="centered-markdown", elem_id="sickstadium-title")
|