Spaces:
Sleeping
Sleeping
Commit
•
2633681
1
Parent(s):
612bed2
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def inference(input_img, transparency = 0.5, target_layer_number = -1):
|
|
38 |
confidences = {classes[i]: float(o[i]) for i in range(10)}
|
39 |
_, prediction = torch.max(outputs, 1)
|
40 |
target_layers = [pytorch_model.layer2[target_layer_number]]
|
41 |
-
cam = GradCAM(model=lightning_model, target_layers=target_layers
|
42 |
grayscale_cam = cam(input_tensor=input_img, targets=None)
|
43 |
grayscale_cam = grayscale_cam[0, :]
|
44 |
img = input_img.squeeze(0)
|
|
|
38 |
confidences = {classes[i]: float(o[i]) for i in range(10)}
|
39 |
_, prediction = torch.max(outputs, 1)
|
40 |
target_layers = [pytorch_model.layer2[target_layer_number]]
|
41 |
+
cam = GradCAM(model=lightning_model, target_layers=target_layers)
|
42 |
grayscale_cam = cam(input_tensor=input_img, targets=None)
|
43 |
grayscale_cam = grayscale_cam[0, :]
|
44 |
img = input_img.squeeze(0)
|