Link Search Menu Expand Document

CAMs Visualization

Table of contents

CAMs Example

Example gif


visualize_cams()

It shows all the ground truth and the related Class Activation Maps of the model.

Parameters

categories

list, optional
List of categories to be included in the visualization. If not specified, all the categories are included.
(default is None)
cams_categories

list, optional
List of CAMs categories to be included in the visualization. If not specified, all the categories are included.
(default is None)
heatmap

bool, optional
Indicates whether to visualize the CAMs in heatmap mode or not.
(default is True)
threshold

float, optional
Threshold used for the CAMs visualization.
(default is 0.5)
show_predictions

bool, optional
Indicates whether to visualize also the predictions.
(default is False)
show_only_gt_cams

bool, optional
If cams_categories is not specified, indicates whether to show all the CAMs or only the ones related to the ground truth labels.
(default is False)
model

str, optional
Name of the model used for the visualization. If not specified, it is considered the first provided.
(default is None)

Example

Classification

from odin.classes import VisualizerClassification

my_visualizer = VisualizerClassification(models)
my_visualizer.visualize_cams()

Tasks supported

Binary Classification Single-label Classification Multi-label Classification Object Detection Instance Segmentation
yes yes yes no no