visualization
visualization
¶
Image rendering helpers for explainability files.
show_cam_on_image
¶
Overlay a heatmap on an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
ndarray
|
Base image in RGB or BGR format, stored as float values in
|
required |
mask
|
ndarray
|
CAM heatmap with values expected in |
required |
use_rgb
|
bool
|
Whether to convert the OpenCV heatmap from BGR to RGB. |
False
|
colormap
|
int
|
OpenCV colormap identifier. |
COLORMAP_JET
|
image_weight
|
float
|
Blend weight for the original image. |
0.5
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Heatmap overlay as a |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ValueError
|
If |