Skip to content

a little bug in detection/demo.py/gen_cam() #30

Open
@liaorongfan

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions