Spaces:
Runtime error
Runtime error
JinHyeong99 commited on
Commit ·
87d6ca1
1
Parent(s): 27c1f72
app.py
CHANGED
|
@@ -18,8 +18,9 @@ def segment_image(image):
|
|
| 18 |
result = logits.argmax(dim=1)[0]
|
| 19 |
result = result.cpu().detach().numpy()
|
| 20 |
|
|
|
|
| 21 |
# 결과 배열 반환
|
| 22 |
-
return
|
| 23 |
|
| 24 |
# Gradio 인터페이스 정의
|
| 25 |
iface = gr.Interface(
|
|
|
|
| 18 |
result = logits.argmax(dim=1)[0]
|
| 19 |
result = result.cpu().detach().numpy()
|
| 20 |
|
| 21 |
+
result_image = Image.fromarray(result.astype(np.uint8), mode="P")
|
| 22 |
# 결과 배열 반환
|
| 23 |
+
return result_image
|
| 24 |
|
| 25 |
# Gradio 인터페이스 정의
|
| 26 |
iface = gr.Interface(
|