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