Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liaorongfan opened this issue Dec 3, 2020 · 1 comment
Open

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

liaorongfan opened this issue Dec 3, 2020 · 1 comment

Comments

@liaorongfan
Copy link

liaorongfan commented Dec 3, 2020

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.

@yizt
Copy link
Owner

yizt commented Dec 9, 2020

@liaorongfan 感谢您的反馈,image的值范围是01,heatmap也缩放到01之间,两者相加时在同一数值范围

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants