khan994 commited on
Commit
8614737
·
1 Parent(s): 5f8bd83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -50,7 +50,9 @@ def gradcam(img_create):
50
  fig,ax = plt.subplots()
51
  x_dec.show(ctx=ax)
52
  ax.imshow(cam_map[1].detach().cpu(), alpha=0.6, extent=(0,128,128,0), interpolation='bilinear', cmap='magma');
53
- fig.savefig("gcam.jpg", dpi=250)
 
 
54
  im=cv2.imread("gcam.jpg",1)
55
  im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
56
  #im=np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
 
50
  fig,ax = plt.subplots()
51
  x_dec.show(ctx=ax)
52
  ax.imshow(cam_map[1].detach().cpu(), alpha=0.6, extent=(0,128,128,0), interpolation='bilinear', cmap='magma');
53
+ plt.tight_layout()
54
+ ax.tight_layout()
55
+ fig.savefig("gcam.jpg", dpi=199)
56
  im=cv2.imread("gcam.jpg",1)
57
  im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
58
  #im=np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')