Skip to main content

Class activation maps for your PyTorch CNN models

Project description

Torchcam: class activation explorer

License Codacy Badge Build Status codecov Docs Pypi

Simple way to leverage the class-specific activation of convolutional layers in PyTorch.


Table of Contents

Getting started


  • Python 3.6 (or more recent)
  • pip


You can install the package using pypi as follows:

pip install torchcam

or using conda:

conda install -c frgfm torchcam


You can find a detailed example below to retrieve the CAM of a specific class on a resnet architecture.

python scripts/ --model resnet50 --class-idx 232



The full package documentation is available here for detailed specifications. The documentation was built with Sphinx using a theme provided by Read the Docs.


Please refer to CONTRIBUTING if you wish to contribute to this project.


This project is developed and maintained by the repo owner, but the implementation was based on the following precious papers:


Distributed under the MIT License. See LICENSE for more information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for torchcam, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size torchcam-0.1.2-py3-none-any.whl (12.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size torchcam-0.1.2.tar.gz (13.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page