Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ def predict(inp):
|
|
8 |
inputs = data_transforms(inp)[None]
|
9 |
model.eval()
|
10 |
with torch.no_grad():
|
11 |
-
logits = model(inputs)
|
12 |
probs = torch.softmax(logits,dim=1)
|
13 |
confidences = {labels[i]: probs[0][i] for i in range(num_classes)}
|
14 |
return confidences
|
|
|
8 |
inputs = data_transforms(inp)[None]
|
9 |
model.eval()
|
10 |
with torch.no_grad():
|
11 |
+
logits = model(inputs)['logits']
|
12 |
probs = torch.softmax(logits,dim=1)
|
13 |
confidences = {labels[i]: probs[0][i] for i in range(num_classes)}
|
14 |
return confidences
|