Spaces:
Runtime error
Runtime error
Update app.py
Browse files252 unmodified lines253254255256257258259260261262263252 unmodified linescam_alpha = (cam_norm >= vis_threshold).astype(np.float32) * alpha # Alpha maskcam_rgba = np.dstack((cam_colored, cam_alpha)) # Shape: (H, W, 4)cam_rgba = np.repeat(np.repeat(cam_rgba, 8, axis=0), 8, axis=1)# Resize CAM to match imagecam_resized = Image.fromarray((cam_rgba * 255).astype(np.uint8), mode="RGBA").resize((size, size), resample=Image.Resampling.BICUBIC)cam_image = transforms.CenterCrop((h, w))(cam_resized)252 unmodified lines253254255256257258259260261252 unmodified linescam_alpha = (cam_norm >= vis_threshold).astype(np.float32) * alpha # Alpha maskcam_rgba = np.dstack((cam_colored, cam_alpha)) # Shape: (H, W, 4)# Resize CAM to match imagecam_resized = Image.fromarray((cam_rgba * 255).astype(np.uint8), mode="RGBA").resize((216,216), resample=Image.Resampling.NEAREST).resize((size, size), resample=Image.Resampling.BICUBIC)cam_image = transforms.CenterCrop((h, w))(cam_resized)
app.py+1-3