Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ def inference(input_img, transparancy = 0.5, target_layer_number = -1):
|
|
| 43 |
outputs = model(input_img)
|
| 44 |
print(outputs)
|
| 45 |
softmax = torch.nn.Softmax(dim=0)
|
| 46 |
-
o = softmax(outputs.
|
| 47 |
confidences = {classes[i]:float(o[i] for i in range(10))}
|
| 48 |
prediction= torch.max(outputs, 1)
|
| 49 |
target_layers = [model.layer2[target_layer_number]]
|
|
|
|
| 43 |
outputs = model(input_img)
|
| 44 |
print(outputs)
|
| 45 |
softmax = torch.nn.Softmax(dim=0)
|
| 46 |
+
o = softmax(outputs.flatten())
|
| 47 |
confidences = {classes[i]:float(o[i] for i in range(10))}
|
| 48 |
prediction= torch.max(outputs, 1)
|
| 49 |
target_layers = [model.layer2[target_layer_number]]
|