show_exp_on_image#

txv.utils.show_exp_on_image(image: ndarray, mask: ndarray, colormap: int = 2, image_weight: float | None = None) ndarray#

This function overlays the explanation map on the image as a heatmap.

Parameters:
  • img (The base image in RGB or BGR format.) –

  • mask (The cam mask.) –

  • use_rgb (Whether to use an RGB or BGR heatmap, this should be set to True if 'img' is in RGB format.) –

  • colormap (The OpenCV colormap to be used.) –

  • image_weight (The final result is image_weight * img + (1-image_weight) * mask.) –

Return type:

The default image with the cam overlay.