Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,7 @@ def analyze_video(video_file):
|
|
19 |
if video_file is None:
|
20 |
return "No video uploaded"
|
21 |
|
|
|
22 |
temp_path = tempfile.NamedTemporaryFile(delete=False, suffix=".mp4").name
|
23 |
with open(temp_path, "wb") as f:
|
24 |
f.write(video_file.read())
|
@@ -44,12 +45,12 @@ def analyze_post(text, video):
|
|
44 |
interface = gr.Interface(
|
45 |
fn=analyze_post,
|
46 |
inputs=[
|
47 |
-
gr.Textbox(label="Enter
|
48 |
-
gr.File(label="Upload
|
49 |
],
|
50 |
outputs="text",
|
51 |
title="📱 Emotion & Sentiment Analyzer",
|
52 |
-
description="Analyze sentiment
|
53 |
)
|
54 |
|
55 |
interface.launch()
|
|
|
19 |
if video_file is None:
|
20 |
return "No video uploaded"
|
21 |
|
22 |
+
# Save uploaded file temporarily
|
23 |
temp_path = tempfile.NamedTemporaryFile(delete=False, suffix=".mp4").name
|
24 |
with open(temp_path, "wb") as f:
|
25 |
f.write(video_file.read())
|
|
|
45 |
interface = gr.Interface(
|
46 |
fn=analyze_post,
|
47 |
inputs=[
|
48 |
+
gr.Textbox(label="Post Text", placeholder="Enter your message here"),
|
49 |
+
gr.File(label="Upload video (.mp4)", file_types=[".mp4"])
|
50 |
],
|
51 |
outputs="text",
|
52 |
title="📱 Emotion & Sentiment Analyzer",
|
53 |
+
description="Analyze text sentiment and facial emotion from video. No re-running needed. Permanent on Hugging Face."
|
54 |
)
|
55 |
|
56 |
interface.launch()
|