Update app.py
Browse files
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()
|