Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
| 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='')
|