Update app.py
Browse files
app.py
CHANGED
|
@@ -136,7 +136,7 @@ def display_gradcam(img_path, heatmap, alpha=0.4):
|
|
| 136 |
img = img.resize((224, 224)) # Resize the image to match model input size
|
| 137 |
|
| 138 |
heatmap = np.uint8(255 * heatmap) # Convert heatmap to 0-255 scale
|
| 139 |
-
heatmap = Image.fromarray(heatmap).resize((img.size), Image.
|
| 140 |
heatmap = np.array(heatmap)
|
| 141 |
|
| 142 |
# Create figure to plot the image and heatmap
|
|
|
|
| 136 |
img = img.resize((224, 224)) # Resize the image to match model input size
|
| 137 |
|
| 138 |
heatmap = np.uint8(255 * heatmap) # Convert heatmap to 0-255 scale
|
| 139 |
+
heatmap = Image.fromarray(heatmap).resize((img.size), Image.LANCZOS)
|
| 140 |
heatmap = np.array(heatmap)
|
| 141 |
|
| 142 |
# Create figure to plot the image and heatmap
|