Spaces:
Runtime error
Runtime error
JinHyeong99 commited on
Commit ·
e11720a
1
Parent(s): 1d38445
app.py
CHANGED
|
@@ -14,13 +14,12 @@ def segment_image(image):
|
|
| 14 |
outputs = model(**inputs)
|
| 15 |
logits = outputs.logits
|
| 16 |
|
| 17 |
-
# 결과 처리 및
|
| 18 |
result = logits.argmax(dim=1)[0]
|
| 19 |
result = result.cpu().detach().numpy()
|
| 20 |
-
result_image = Image.fromarray(result.astype(np.uint8), mode="P")
|
| 21 |
|
| 22 |
-
# 결과
|
| 23 |
-
return
|
| 24 |
|
| 25 |
# Gradio 인터페이스 정의
|
| 26 |
iface = gr.Interface(
|
|
|
|
| 14 |
outputs = model(**inputs)
|
| 15 |
logits = outputs.logits
|
| 16 |
|
| 17 |
+
# 결과 처리 및 NumPy 배열로 변환
|
| 18 |
result = logits.argmax(dim=1)[0]
|
| 19 |
result = result.cpu().detach().numpy()
|
|
|
|
| 20 |
|
| 21 |
+
# 결과 배열 반환
|
| 22 |
+
return result
|
| 23 |
|
| 24 |
# Gradio 인터페이스 정의
|
| 25 |
iface = gr.Interface(
|