Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -143,7 +143,7 @@ def get_gradcam(model,input_img, opacity,layer):
|
|
143 |
print(layer_to_user)
|
144 |
final_outputs,texts = [],[]
|
145 |
for i in range(len(layer_to_user)):
|
146 |
-
cam = GradCAM(model=model, target_layers=[layer_to_user[i]], use_cuda=
|
147 |
grayscale_cam = cam(input_tensor=input_img, targets=targets)
|
148 |
grayscale_cam = grayscale_cam[0, :]
|
149 |
img = input_img.squeeze(0).to('cpu')
|
|
|
143 |
print(layer_to_user)
|
144 |
final_outputs,texts = [],[]
|
145 |
for i in range(len(layer_to_user)):
|
146 |
+
cam = GradCAM(model=model, target_layers=[layer_to_user[i]], use_cuda=False)
|
147 |
grayscale_cam = cam(input_tensor=input_img, targets=targets)
|
148 |
grayscale_cam = grayscale_cam[0, :]
|
149 |
img = input_img.squeeze(0).to('cpu')
|