Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
with gr.Blocks() as app:
|
2 |
+
gr.Markdown("# 🧠 Emotion Decoder: Text | Face | Video")
|
3 |
+
gr.Markdown("Upload Text, Face Image, or Video to Analyze Emotional Tone!")
|
4 |
+
|
5 |
+
with gr.Tab("Text Post Analysis"):
|
6 |
+
text_input = gr.Textbox(label="Paste Social Media Text Here")
|
7 |
+
text_output = gr.Textbox(label="Analysis Result")
|
8 |
+
text_btn = gr.Button("Analyze Text")
|
9 |
+
text_btn.click(analyze_text, inputs=text_input, outputs=text_output)
|
10 |
+
|
11 |
+
with gr.Tab("Face Emotion Analysis"):
|
12 |
+
face_input = gr.Image(type="filepath", label="Upload Face Image")
|
13 |
+
face_output = gr.Textbox(label="Face Emotion Result")
|
14 |
+
face_btn = gr.Button("Analyze Face")
|
15 |
+
face_btn.click(analyze_face, inputs=face_input, outputs=face_output)
|
16 |
+
|
17 |
+
with gr.Tab("Video Analysis"):
|
18 |
+
video_input = gr.Video(label="Upload Social Media Video")
|
19 |
+
video_output = gr.Textbox(label="Video Sentiment & Emotion Result")
|
20 |
+
video_btn = gr.Button("Analyze Video")
|
21 |
+
video_btn.click(analyze_video, inputs=video_input, outputs=video_output)
|
22 |
+
|
23 |
+
app.launch(share=True)
|