Update app.py
Browse files
app.py
CHANGED
@@ -86,21 +86,23 @@ def displayResults():
|
|
86 |
|
87 |
return plt
|
88 |
|
89 |
-
#
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
fn=emotionAnalysis,
|
97 |
-
inputs=["text"],
|
98 |
-
outputs=[
|
99 |
-
gr.Text(label="Emotion Results"), # Shows current emotion analysis
|
100 |
-
gr.Plot(label="Emotion Timeline") # Shows emotion trends over time
|
101 |
-
],
|
102 |
-
title="Emotion Analysis from Text and Face",
|
103 |
-
description="Enter text into the textbox. Then, press 'Submit' or 'Enter' to activate the webcam. Wait and see the results."
|
104 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
interface
|
|
|
|
|
|
86 |
|
87 |
return plt
|
88 |
|
89 |
+
# Create Gradio interface with consent notice in the description
|
90 |
+
interface = gr.Interface(
|
91 |
+
fn=emotionAnalysis,
|
92 |
+
inputs=[
|
93 |
+
gr.Textbox(
|
94 |
+
label="Enter your text",
|
95 |
+
placeholder="Type your message here. Type 'quit' to see final results."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
)
|
97 |
+
],
|
98 |
+
outputs=[
|
99 |
+
gr.Text(label="Emotion Results"),
|
100 |
+
gr.Plot(label="Emotion Timeline")
|
101 |
+
],
|
102 |
+
title="Emotion Analysis from Text and Face",
|
103 |
+
description="⚠️ This application will use your webcam to detect facial emotions. By using this app, you consent to webcam access. Type text and press Enter to analyze both text and facial emotions."
|
104 |
+
)
|
105 |
|
106 |
+
# Launch the interface
|
107 |
+
if __name__ == "__main__":
|
108 |
+
interface.launch()
|