Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,11 @@ def predict(image):
|
|
40 |
_, predicted = torch.max(outputs, 1)
|
41 |
label = class_names[predicted.item()]
|
42 |
print("Predicted label:", label)
|
43 |
-
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
iface = gr.Interface(fn=predict, inputs=gr.Image(type='pil'), outputs='label', live=True)
|
48 |
iface.launch()
|
|
|
|
40 |
_, predicted = torch.max(outputs, 1)
|
41 |
label = class_names[predicted.item()]
|
42 |
print("Predicted label:", label)
|
43 |
+
|
44 |
+
# ์์ธก ๊ฒฐ๊ณผ์ ์๋ณธ ์ถ๋ ฅ๊ฐ์ ๋ชจ๋ ๋ฐํ
|
45 |
+
return label, outputs.numpy() # ์๋ณธ ์ถ๋ ฅ๊ฐ์ NumPy ๋ฐฐ์ด๋ก ๋ณํํ์ฌ ๋ฐํ
|
46 |
|
47 |
+
# Gradio ์ธํฐํ์ด์ค ์ค์ (๋ ๊ฐ์ ์ถ๋ ฅ)
|
48 |
+
iface = gr.Interface(fn=predict, inputs=gr.Image(type='pil'), outputs=['label', 'numpy'], live=True)
|
|
|
49 |
iface.launch()
|
50 |
+
|