KHUjongseo commited on
Commit
5e0926b
ยท
1 Parent(s): 9516507
Files changed (1) hide show
  1. app.py +30 -4
app.py CHANGED
@@ -1,7 +1,33 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ def submit_response(choice, feedback):
4
+ return f"โœ… ์„ค๋ฌธ ์™„๋ฃŒ!\n์„ ํƒ: {choice}\n์˜๊ฒฌ: {feedback}"
5
 
6
+ with gr.Blocks() as demo:
7
+ gr.Markdown("## ๐ŸŽฅ Explainable Action Recognition: ์‚ฌ์šฉ์ž ํ‰๊ฐ€")
8
+ gr.Markdown("๋น„๋””์˜ค์™€ ๋‘ ๊ฐœ์˜ ์„ค๋ช…์„ ํ™•์ธํ•˜๊ณ , ์–ด๋–ค ์„ค๋ช…์ด ๋” ์ง๊ด€์ ์ธ์ง€ ์„ ํƒํ•ด ์ฃผ์„ธ์š”.")
9
+
10
+ with gr.Row():
11
+ gr.Video("video_sample.mp4", label="๐ŸŽฌ ์ž…๋ ฅ ๋น„๋””์˜ค")
12
+
13
+ with gr.Row():
14
+ with gr.Column():
15
+ gr.Image("ucf_attribute_explanation.png", label="๐Ÿ…ฐ๏ธ ์„ค๋ช… A: UCF101 ์†์„ฑ ๊ธฐ๋ฐ˜")
16
+ with gr.Column():
17
+ gr.Image("pose_concept_explanation.png", label="๐Ÿ…ฑ๏ธ ์„ค๋ช… B: Pose ๊ฐœ๋… ๊ธฐ๋ฐ˜")
18
+
19
+ gr.Markdown("### โ“ Q1. ์–ด๋–ค ์„ค๋ช…์ด ๋” ์ง๊ด€์ ์ด์—ˆ๋‚˜์š”?")
20
+ choice = gr.Radio(
21
+ ["์„ค๋ช… A (UCF ์†์„ฑ ๊ธฐ๋ฐ˜)", "์„ค๋ช… B (Pose ๊ฐœ๋… ๊ธฐ๋ฐ˜)"],
22
+ label="๋‹น์‹ ์˜ ์„ ํƒ"
23
+ )
24
+
25
+ gr.Markdown("### ๐Ÿ’ฌ Q2. ์ถ”๊ฐ€ ์˜๊ฒฌ์ด ์žˆ๋‹ค๋ฉด ์ž์œ ๋กญ๊ฒŒ ์ž‘์„ฑํ•ด ์ฃผ์„ธ์š”.")
26
+ feedback = gr.Textbox(placeholder="ex. ์„ค๋ช… A๋Š” ๋” ๊ตฌ์ฒด์ ์ด์—ˆ์–ด์š”", lines=2, label="์˜๊ฒฌ (์„ ํƒ์‚ฌํ•ญ)")
27
+
28
+ submit_btn = gr.Button("์ œ์ถœ")
29
+ output = gr.Textbox(label="๊ฒฐ๊ณผ ํ™•์ธ")
30
+
31
+ submit_btn.click(fn=submit_response, inputs=[choice, feedback], outputs=output)
32
+
33
+ demo.launch()