dd
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def predict(inp):
|
|
| 45 |
img = img.unsqueeze(0)
|
| 46 |
with torch.no_grad():
|
| 47 |
prediction = model(img).softmax(1).numpy()
|
| 48 |
-
confidences = {labels[i]: float(
|
| 49 |
return confidences
|
| 50 |
|
| 51 |
import gradio as gr
|
|
|
|
| 45 |
img = img.unsqueeze(0)
|
| 46 |
with torch.no_grad():
|
| 47 |
prediction = model(img).softmax(1).numpy()
|
| 48 |
+
confidences = {labels[i]: float(prediction[0][i]) for i in range(2)}
|
| 49 |
return confidences
|
| 50 |
|
| 51 |
import gradio as gr
|