Spaces:
Runtime error
Runtime error
Commit ·
d1ff39a
1
Parent(s): 3751a7e
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,11 +52,11 @@ def image_classifier(input_image, top_classes=3, show_cam=True, target_layers=[2
|
|
| 52 |
o = softmax(output.flatten())
|
| 53 |
|
| 54 |
confidences = {classes[i]: float(o[i]) for i in range(10)}
|
| 55 |
-
|
| 56 |
|
| 57 |
#confidences.sort(key=lambda x: x[1], reverse=True)
|
| 58 |
#confidences = OrderedDict(confidences[:top_classes])
|
| 59 |
-
label = torch.argmax(output).item()
|
| 60 |
|
| 61 |
outputs = list()
|
| 62 |
if show_cam:
|
|
|
|
| 52 |
o = softmax(output.flatten())
|
| 53 |
|
| 54 |
confidences = {classes[i]: float(o[i]) for i in range(10)}
|
| 55 |
+
_, label = torch.max(output, 1)
|
| 56 |
|
| 57 |
#confidences.sort(key=lambda x: x[1], reverse=True)
|
| 58 |
#confidences = OrderedDict(confidences[:top_classes])
|
| 59 |
+
#label = torch.argmax(output).item()
|
| 60 |
|
| 61 |
outputs = list()
|
| 62 |
if show_cam:
|