Annonymous commited on
Commit
d54c0f8
1 Parent(s): 6a21d52

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +1 -1
utils.py CHANGED
@@ -49,7 +49,7 @@ def overlay_heatmap(img, heatmap, denormalize = False):
49
 
50
  def viz_map(img_path, heatmap):
51
  "For pixel invariance"
52
- img = np.array(Image.open(img_path).resize((224,224)))
53
  width, height, _ = img.shape
54
  cam = heatmap.detach().cpu().numpy()
55
  cam = cam / cam.max()
 
49
 
50
  def viz_map(img_path, heatmap):
51
  "For pixel invariance"
52
+ img = np.array(Image.open(img_path).resize((224,224))) if isinstance(img_path, str) else np.array(img_path.resize((224,224)))
53
  width, height, _ = img.shape
54
  cam = heatmap.detach().cpu().numpy()
55
  cam = cam / cam.max()