Gosula commited on
Commit
46c1e97
1 Parent(s): a6d636f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -42,7 +42,7 @@ def inference(input_img, input_slider_grad_or_not, transparency = 0.5, target_la
42
  target_layers = [model.layer_2[-1]]
43
  if target_layer_number == 3:
44
  target_layers = [model.layer_3[-1]]
45
- cam = GradCAM(model=model, target_layers=target_layers, use_cuda=False)
46
  grayscale_cam = cam(input_tensor=input_img, targets=None)
47
  grayscale_cam = grayscale_cam[0, :]
48
  visualization = show_cam_on_image(orginal_img/255, grayscale_cam, use_rgb=True, image_weight=transparency)
 
42
  target_layers = [model.layer_2[-1]]
43
  if target_layer_number == 3:
44
  target_layers = [model.layer_3[-1]]
45
+ cam = GradCAM(model=model, target_layers=target_layers)
46
  grayscale_cam = cam(input_tensor=input_img, targets=None)
47
  grayscale_cam = grayscale_cam[0, :]
48
  visualization = show_cam_on_image(orginal_img/255, grayscale_cam, use_rgb=True, image_weight=transparency)