Spaces:
Sleeping
Sleeping
Commit ·
f521e1f
1
Parent(s): bc6b5e4
fix bugs
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def cat_dog_predict(model: torch.nn.Module, img: Image) -> str:
|
|
| 16 |
])
|
| 17 |
img = transform(img)
|
| 18 |
img = img.to(device)
|
| 19 |
-
class_names = ["
|
| 20 |
pred = model(img.unsqueeze(0))
|
| 21 |
pred_prob = torch.softmax(pred, 1)
|
| 22 |
pred_label = torch.max(pred_prob, 1)
|
|
|
|
| 16 |
])
|
| 17 |
img = transform(img)
|
| 18 |
img = img.to(device)
|
| 19 |
+
class_names = ["dog", "cat"]
|
| 20 |
pred = model(img.unsqueeze(0))
|
| 21 |
pred_prob = torch.softmax(pred, 1)
|
| 22 |
pred_label = torch.max(pred_prob, 1)
|