Closed ghazalee70 closed 4 years ago
Thanks for your PR! Indeed there's an issue at the moment, because the attribution maps is merged with the input image and does not let the user decide what to do with it. However, setting image_weight
to 0 automatically prevent the visualization from building. We probably want to add image_weight
as argument of the grad cam method also (with a default value to 0.7 as it is today), so user can choose either to apply on input or not.
@ghazalee70 Can you update the docstring of grad cam accordingly (new argument image_weight
)? Sorry for the trouble, last step so I can merge it!
@ghazalee70 Thanks for the PR!
Current implementation of gradcam returns the image overlayed by gradient mask and not following the same structure as the other methods (e.g. smooth_grad or intergrated_grad) in which the actual gradient masks are created as the output. As such, to keep it all following the same standard and usable in the same manner, I have adapted the grad_cam function so that the output is the gradient mask if the weight is set to 0. If one desires to have it as the current implementation, the weight value can be set to 0.7 as before.