logu29 commited on
Commit
33592cb
·
verified ·
1 Parent(s): 4450a9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -9
app.py CHANGED
@@ -1,12 +1,24 @@
1
-
2
  import gradio as gr
3
 
4
- def greet(name):
5
- return "Hello " + name + "!"
6
-
7
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
8
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- # Save it as app.py
11
- with open("app.py", "w") as f:
12
- f.write(code)
 
 
1
  import gradio as gr
2
 
3
+ with gr.Blocks() as app:
4
+ gr.Markdown("# Emotion Decoder - Social Media Posts")
5
+
6
+ with gr.Tab("Analyze Text"):
7
+ text_in = gr.Textbox(label="Paste Social Media Post Text")
8
+ text_out = gr.Textbox(label="Result")
9
+ text_button = gr.Button("Analyze Text")
10
+ text_button.click(fn=analyze_text, inputs=text_in, outputs=text_out)
11
+
12
+ with gr.Tab("Analyze Face Image"):
13
+ face_in = gr.Image(type="filepath", label="Upload Face Image")
14
+ face_out = gr.Textbox(label="Result")
15
+ face_button = gr.Button("Analyze Face")
16
+ face_button.click(fn=analyze_face, inputs=face_in, outputs=face_out)
17
+
18
+ with gr.Tab("Analyze Video File"):
19
+ video_in = gr.Video(label="Upload Social Media Video")
20
+ video_out = gr.Textbox(label="Result")
21
+ video_button = gr.Button("Analyze Video")
22
+ video_button.click(fn=analyze_video, inputs=video_in, outputs=video_out)
23
 
24
+ app.launch(share=True)