Open
Description
def gen_cam(image, mask):
heatmap = cv2.applyColorMap(np.uint8(255 * mask), cv2.COLORMAP_JET)
# heatmap = np.float32(heatmap) / 255 # little bug here
heatmap = np.float32(heatmap)
heatmap = heatmap[..., ::-1] # gbr to rgb
cam = heatmap + np.float32(image)
return norm_image(cam), heatmap
For variable "heatmap" there is no need to divide by 255.
Metadata
Assignees
Labels
No labels