Update app.py
Browse files
app.py
CHANGED
@@ -99,11 +99,15 @@ def on_mouseover(mouse_info):
|
|
99 |
highlight_segmentation(x, y)
|
100 |
|
101 |
def highlight_segmentation(x, y):
|
102 |
-
#
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
|
|
|
|
107 |
|
108 |
def sepia(input_img):
|
109 |
input_img = Image.fromarray(input_img)
|
|
|
99 |
highlight_segmentation(x, y)
|
100 |
|
101 |
def highlight_segmentation(x, y):
|
102 |
+
# ์ธ๊ทธ๋ฉํ
์ด์
์ ๋ณด๊ฐ None์ด ์๋ ๊ฒฝ์ฐ์๋ง ์ถ๋ ฅ
|
103 |
+
if seg is not None:
|
104 |
+
try:
|
105 |
+
seg_value = seg.numpy()[y, x]
|
106 |
+
print(f"Mouse over position: ({x}, {y}), Segmentation value: {seg_value}")
|
107 |
+
except IndexError:
|
108 |
+
print(f"Invalid mouse position: ({x}, {y}), Segmentation value cannot be retrieved.")
|
109 |
+
else:
|
110 |
+
print("Segmentation information is not available.")
|
111 |
|
112 |
def sepia(input_img):
|
113 |
input_img = Image.fromarray(input_img)
|