How to use the torchcam.saliency.get_image_saliency_plot function in torchcam

To help you get started, we’ve selected a few torchcam examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tramac / pytorch-cam / torchcam / cam.py View on Github external
def getCAM(model, raw_image, input, label, layer_path=None, display=True, save_path=False):
    saliency_maps = get_image_saliency_result(model, raw_image, input, label,
                                              methods=['gradcam'], layer_path=layer_path)
    figure = get_image_saliency_plot(saliency_maps, display=display, save_path=save_path)

    return figure

torchcam

Class activation maps for your PyTorch CNN models

Apache-2.0
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Similar packages