Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,10 @@ def gradcam(img_create):
|
|
| 42 |
fig,ax = plt.subplots()
|
| 43 |
x_dec.show(ctx=ax)
|
| 44 |
ax.imshow(cam_map[1].detach().cpu(), alpha=0.6, extent=(0,128,128,0), interpolation='bilinear', cmap='magma');
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
image=gr.inputs.Image(shape=(128,128))
|
|
|
|
| 42 |
fig,ax = plt.subplots()
|
| 43 |
x_dec.show(ctx=ax)
|
| 44 |
ax.imshow(cam_map[1].detach().cpu(), alpha=0.6, extent=(0,128,128,0), interpolation='bilinear', cmap='magma');
|
| 45 |
+
im="gcam.jpg"
|
| 46 |
+
fig.savefig(im)
|
| 47 |
+
|
| 48 |
+
return (dict(zip(categories, map(float, probs))), im)
|
| 49 |
|
| 50 |
|
| 51 |
image=gr.inputs.Image(shape=(128,128))
|