Emilyl613 commited on
Commit
4aaeb56
Β·
verified Β·
1 Parent(s): 6602793

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -82,7 +82,8 @@ def get_gradcam_overlay(image_pil, image_tensor):
82
  heatmap = cv2.applyColorMap((cam_resized * 255).astype(np.uint8), cv2.COLORMAP_JET)
83
  heatmap = cv2.cvtColor(heatmap, cv2.COLOR_BGR2RGB)
84
  overlaid = (0.5 * img + 0.5 * heatmap).astype(np.uint8)
85
- return Image.fromarray(overlaid)
 
86
 
87
  # ── Detection Function ───────────────────────────────────────
88
  def detect_image(image):
 
82
  heatmap = cv2.applyColorMap((cam_resized * 255).astype(np.uint8), cv2.COLORMAP_JET)
83
  heatmap = cv2.cvtColor(heatmap, cv2.COLOR_BGR2RGB)
84
  overlaid = (0.5 * img + 0.5 * heatmap).astype(np.uint8)
85
+ overlaid_large = Image.fromarray(overlaid).resize((224, 224), Image.NEAREST)
86
+ return overlaid_large
87
 
88
  # ── Detection Function ───────────────────────────────────────
89
  def detect_image(image):