matjarm commited on
Commit
a590910
·
1 Parent(s): 8bc9a6b
Files changed (1) hide show
  1. app.py +11 -16
app.py CHANGED
@@ -69,27 +69,22 @@ def process_video(video_path):
69
  # Gradio Interface
70
  def generate_captions(video):
71
  # Save uploaded video
72
- video_path = f"temp_{uuid.uuid4()}.mp4"
73
  print(video)
74
- print("LOG")
75
- # with open(video_path, "wb") as f:
76
- # f.write(video.read())
77
 
78
- # # Process video and get captions
79
- # captions = process_video(video_path)
80
 
81
- # # Clean up temporary file
82
- # os.remove(video_path)
83
 
84
- # # Format output for display
85
- # result = ""
86
- # for model_name, model_captions in captions.items():
87
- # result += f"### {model_name}\n"
88
- # result += "\n".join(f"- {caption}" for caption in model_captions)
89
- # result += "\n\n"
90
 
91
- # return result
92
- return ""
93
 
94
 
95
  # Gradio UI
 
69
  # Gradio Interface
70
  def generate_captions(video):
71
  # Save uploaded video
 
72
  print(video)
 
 
 
73
 
74
+ # Process video and get captions
75
+ captions = process_video(video)
76
 
77
+ # Clean up temporary file
78
+ os.remove(video)
79
 
80
+ # Format output for display
81
+ result = ""
82
+ for model_name, model_captions in captions.items():
83
+ result += f"### {model_name}\n"
84
+ result += "\n".join(f"- {caption}" for caption in model_captions)
85
+ result += "\n\n"
86
 
87
+ return result
 
88
 
89
 
90
  # Gradio UI