dd
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def predict(inp):
|
|
16 |
img = transforms.ToTensor()(inp)
|
17 |
img = torchvision.transforms.Resize((800, 800))(img)
|
18 |
img = torchvision.transforms.CenterCrop(CROP)(img)
|
19 |
-
img = img
|
20 |
with torch.no_grad():
|
21 |
prediction = torch.nn.functional.softmax(model(img)[0], dim=0)
|
22 |
confidences = {labels[i]: float(prediction[i]) for i in range(2)}
|
|
|
16 |
img = transforms.ToTensor()(inp)
|
17 |
img = torchvision.transforms.Resize((800, 800))(img)
|
18 |
img = torchvision.transforms.CenterCrop(CROP)(img)
|
19 |
+
img = img.unsqueeze(0)
|
20 |
with torch.no_grad():
|
21 |
prediction = torch.nn.functional.softmax(model(img)[0], dim=0)
|
22 |
confidences = {labels[i]: float(prediction[i]) for i in range(2)}
|