danu9327 commited on
Commit
91602d8
ยท
1 Parent(s): ac26439

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -91,7 +91,11 @@ def draw_plot(pred_img, seg):
91
  plt.xticks([], [])
92
  ax.tick_params(width=0.0, labelsize=25)
93
  return fig
94
-
 
 
 
 
95
  def sepia(input_img):
96
  input_img = Image.fromarray(input_img)
97
 
@@ -125,7 +129,8 @@ demo = gr.Interface(fn=sepia,
125
  title="Gradio ๊ธฐ๋ฐ˜์˜ Hugging Face ์˜์ƒ ๋ถ„ํ•  ๋ชจ๋ธ ๋ฐ๋ชจ ๊ตฌํ˜„ ๊ณผ์ œ 3",
126
  description="์ฐจ๋„, ์ธ๋„, ์ž์ „๊ฑฐ๋„๋กœ ๋“ฑ์˜ ์‚ฌ์ง„๋งŒ ๋„ฃ์–ด์ฃผ์„ธ์š”",
127
  examples=["example1.jpg", "example2.jpg", "example3.jpeg", "example4.jpg"],
128
- allow_flagging='never')
 
129
 
130
 
131
  demo.launch()
 
91
  plt.xticks([], [])
92
  ax.tick_params(width=0.0, labelsize=25)
93
  return fig
94
+
95
+ def on_mouseover(mouse_info):
96
+ x, y = mouse_info["position"]
97
+ print(f"Mouse over position: ({x}, {y})")
98
+
99
  def sepia(input_img):
100
  input_img = Image.fromarray(input_img)
101
 
 
129
  title="Gradio ๊ธฐ๋ฐ˜์˜ Hugging Face ์˜์ƒ ๋ถ„ํ•  ๋ชจ๋ธ ๋ฐ๋ชจ ๊ตฌํ˜„ ๊ณผ์ œ 3",
130
  description="์ฐจ๋„, ์ธ๋„, ์ž์ „๊ฑฐ๋„๋กœ ๋“ฑ์˜ ์‚ฌ์ง„๋งŒ ๋„ฃ์–ด์ฃผ์„ธ์š”",
131
  examples=["example1.jpg", "example2.jpg", "example3.jpeg", "example4.jpg"],
132
+ allow_flagging='never',
133
+ events=[gr.Mouse(on_mouseover)])
134
 
135
 
136
  demo.launch()