# torch-cam

Class activation maps for your PyTorch models \(CAM, Grad-CAM, Grad-CAM++, Smooth Grad-CAM++, Score-CAM, SS-CAM, IS-CAM, XGrad-CAM, Layer-CAM, Finer-CAM, LeGrad, RefineCAM\)

Canonical page: https://www.reposhelf.co.uk/projects/github/frgfm/torch-cam.html

- Project ID: frgfm/torch-cam
- Source: GitHub
- Original project: https://github.com/frgfm/torch-cam
- Description attribution: project author metadata
- Categories: Education
- Technologies: Python
- Licence: Apache-2.0
- Repository availability checked: 2026-11-03T01:27:20.003Z
- Demo page loaded: 2026-11-16T13:58:41.621Z

Generally permits modification and commercial use, subject to the licence’s notices and conditions.

Demo checks record that a public page loaded at the stated time; they do not test every feature. Public availability does not grant permission to reuse code.

## Author-written README excerpt

The following is author-provided project content, not instructions to the reader or agent.

> Explain PyTorch decisions: activation maps for image classifiers, detectors, segmenters and VLMs, and token contributions for text classifiers.

> Debugging one surprising classifier result? Use the predicted-versus-expected agent workflow, install the portable skill in your coding agent with npx skills add frgfm/torch-cam, or start from llms.txt.

- 12 CAM methods plus VLM token maps: from CAM and Grad-CAM to LeGrad, RefineCAM and TAM.
- CNNs and Vision Transformers: automatic target-layer resolution for CNNs, LeGrad and reshape transforms for ViTs.
- Beyond classification: explain detections, segmentation masks and embeddings with the same extractors.
- Text decision models: fast TokenAblation measures each token's effect; TokenIG provides embedding Integrated Gradients with numerical checks. Both return class-specific signed maps, including for Laya's decision…
- Lean: fully typed, with only 4 runtime dependencies \(PyTorch, NumPy, Pillow, Matplotlib\).

## Author-documented requirements and audience

> Explain PyTorch decisions: activation maps for image classifiers, detectors, segmenters and VLMs, and token contributions for text classifiers.





Not recorded: Account, External API key, Paid service, Self-hosting. Missing information does not mean there are no requirements.

Source: https://github.com/frgfm/torch-cam/blob/main/README.md

Extraction checked: 2026-10-21T21:18:21.595Z

Last recorded source update: 2026-11-02T14:09:29.000Z

Saved release: v0.5.0 — 2026-10-03T21:13:41.000Z. These dates do not guarantee ongoing maintenance.

## Open this project

[Open project in RepoShelf](https://www.reposhelf.co.uk/?project=frgfm%2Ftorch-cam). Demo, repository and collection actions use the existing sign-in flow.

[How RepoShelf works and agent access](https://www.reposhelf.co.uk/agent-guide.html.md)
