Aarón Espasandín commited on
Commit
0dd7a38
1 Parent(s): 15eb5f5

Removing use_cuda from GradCam (Removed in newer versions)

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -65,8 +65,7 @@ def predict(input_image:Image.Image, true_label:str):
65
  face_image_to_plot = face.squeeze(0).permute(1, 2, 0).cpu().detach().int().numpy()
66
 
67
  target_layers=[model.block8.branch1[-1]]
68
- use_cuda = True if torch.cuda.is_available() else False
69
- cam = GradCAM(model=model, target_layers=target_layers, use_cuda=use_cuda)
70
  targets = [ClassifierOutputTarget(0)]
71
 
72
  grayscale_cam = cam(input_tensor=face, targets=targets, eigen_smooth=True)
 
65
  face_image_to_plot = face.squeeze(0).permute(1, 2, 0).cpu().detach().int().numpy()
66
 
67
  target_layers=[model.block8.branch1[-1]]
68
+ cam = GradCAM(model=model, target_layers=target_layers)
 
69
  targets = [ClassifierOutputTarget(0)]
70
 
71
  grayscale_cam = cam(input_tensor=face, targets=targets, eigen_smooth=True)