Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from video_processing import process_video, download_video,
|
3 |
from gradio.themes.base import Base
|
4 |
from gradio.themes.utils import colors, fonts, sizes
|
5 |
from typing import Iterable
|
@@ -49,6 +49,14 @@ class CustomTheme(Base):
|
|
49 |
|
50 |
custom_theme = CustomTheme()
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
def display_results(video_url, video_file, description):
|
53 |
if video_url:
|
54 |
video_path = download_video(video_url)
|
|
|
1 |
import gradio as gr
|
2 |
+
from video_processing import process_video, download_video, find_scenes, analyze_scenes, extract_best_scene, cleanup_temp_files
|
3 |
from gradio.themes.base import Base
|
4 |
from gradio.themes.utils import colors, fonts, sizes
|
5 |
from typing import Iterable
|
|
|
49 |
|
50 |
custom_theme = CustomTheme()
|
51 |
|
52 |
+
def save_uploaded_file(uploaded_file):
|
53 |
+
upload_dir = "uploaded_videos"
|
54 |
+
os.makedirs(upload_dir, exist_ok=True)
|
55 |
+
file_path = os.path.join(upload_dir, f"{uuid.uuid4()}.mp4")
|
56 |
+
with open(file_path, "wb") as f:
|
57 |
+
f.write(uploaded_file)
|
58 |
+
return file_path
|
59 |
+
|
60 |
def display_results(video_url, video_file, description):
|
61 |
if video_url:
|
62 |
video_path = download_video(video_url)
|