jschwab21 commited on
Commit
4a7c9de
·
verified ·
1 Parent(s): 358aaf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from video_processing import process_video, download_video, save_uploaded_file, 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,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)