Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def classify(im):
|
|
14 |
features = extractor(im, return_tensors='pt')
|
15 |
with torch.no_grad():
|
16 |
logits = model(features["pixel_values"])[-1]
|
17 |
-
logits = torch.nn.functional.softmax(logits, dim=-1)
|
18 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
19 |
probs = probability[0].detach().numpy()
|
20 |
confidences = {label: float(probs[i]*100) for i, label in enumerate(labels)}
|
|
|
14 |
features = extractor(im, return_tensors='pt')
|
15 |
with torch.no_grad():
|
16 |
logits = model(features["pixel_values"])[-1]
|
17 |
+
#logits = torch.nn.functional.softmax(logits, dim=-1)
|
18 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
19 |
probs = probability[0].detach().numpy()
|
20 |
confidences = {label: float(probs[i]*100) for i, label in enumerate(labels)}
|