Skip to main content

A Simple pytorch implementation of GradCAM[1], and GradCAM++[2]


Installation

pip install pytorch-gradcam

Supported torchvision models

  • alexnet
  • vgg
  • resnet
  • densenet
  • squeezenet

Usage

please refer to example.ipynb for general usage and refer to documentations of each layer-finding functions in utils.py if you want to know how to set target_layer_name properly.

Use your own model and layer:

model = MyModel()
target_layer = model.my_submodule
gradcam = GradCAM(model, target_layer)

References:

[1] Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization, Selvaraju et al, ICCV, 2017
[2] Grad-CAM++: Generalized Gradient-based Visual Explanations for Deep Convolutional Networks, Chattopadhyay et al, WACV, 2018

Metadata

Release files for pytorch-gradcam 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytorch-gradcam 0.2.1
File Size Uploaded Provenance
pytorch-gradcam-0.2.1.tar.gz 6.0 MB Without provenance Details

Release files / pytorch-gradcam-0.2.1.tar.gz

Download URL pytorch-gradcam-0.2.1.tar.gz
Size 6.0 MB
Tags Source
SHA-256 checksum
How to use checksums
891d2dcedf695cd18233f94258315131a56056171a92412e691f75f0816bdc97
BLAKE2b-256 checksum
How to use checksums
e60a55251f7cbea464581c6fb831813d38a41fdeb78f3dd8193522248cb98744
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

Security for pytorch-gradcam 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page