{"id":13645221,"url":"https://github.com/frgfm/torch-cam","last_synced_at":"2025-10-08T17:23:53.615Z","repository":{"id":37475676,"uuid":"249513553","full_name":"frgfm/torch-cam","owner":"frgfm","description":"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)","archived":false,"fork":false,"pushed_at":"2025-08-29T08:03:04.000Z","size":10835,"stargazers_count":2254,"open_issues_count":12,"forks_count":220,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-09-05T07:44:28.083Z","etag":null,"topics":["activation-maps","class-activation-map","cnn","deep-learning","grad-cam","gradcam","gradcam-plus-plus","interpretability","interpretable-deep-learning","python","pytorch","saliency-map","score-cam","smoothgrad"],"latest_commit_sha":null,"homepage":"https://frgfm.github.io/torch-cam/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frgfm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"frgfm","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-03-23T18:34:51.000Z","updated_at":"2025-09-02T10:47:09.000Z","dependencies_parsed_at":"2024-03-06T20:50:58.370Z","dependency_job_id":"f3efb1f1-28a7-444f-839b-3da9a7216f95","html_url":"https://github.com/frgfm/torch-cam","commit_stats":{"total_commits":150,"total_committers":4,"mean_commits":37.5,"dds":"0.026666666666666616","last_synced_commit":"3f1c8e4d21f8936f13457d656c9a93b8be100de1"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/frgfm/torch-cam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Ftorch-cam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Ftorch-cam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Ftorch-cam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Ftorch-cam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frgfm","download_url":"https://codeload.github.com/frgfm/torch-cam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Ftorch-cam/sbom","scorecard":{"id":411400,"data":{"date":"2025-08-11","repo":{"name":"github.com/frgfm/torch-cam","commit":"ef34feae1a677c2fdbb5995723bf763cefb961da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/page-build.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/page-build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/page-build.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/page-build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-edited.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/pr-edited.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-merged.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/pr-merged.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-merged.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/pr-merged.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-merged.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/pr-merged.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-merged.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/pr-merged.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/push.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/push.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/push.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/push.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/push.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/push.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/push.yaml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/push.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/style.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/style.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/style.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/style.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/style.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/style.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/style.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/style.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/style.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/style.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:87: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:110: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/triage.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/frgfm/torch-cam/triage.yml/main?enable=pin","Warn: pipCommand not pinned by hash: docs/build.sh:8","Info:   0 out of  39 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  24 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel permissions set to 'read-all': .github/workflows/pr-edited.yml:12","Info: jobLevel 'contents' permission set to 'read': .github/workflows/triage.yml:10","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/page-build.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-edited.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-merged.yml:1","Warn: no topLevel permission defined: .github/workflows/push.yaml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/style.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Warn: no topLevel permission defined: .github/workflows/triage.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.3.1 not signed: https://api.github.com/repos/frgfm/torch-cam/releases/52404987","Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/frgfm/torch-cam/releases/41212205","Warn: release artifact v0.3.1 does not have provenance: https://api.github.com/repos/frgfm/torch-cam/releases/52404987","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/frgfm/torch-cam/releases/41212205"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2014-14 / GHSA-652x-xj99-gmcc","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2014-13 / GHSA-cfj3-7x9c-4p3h","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg","Warn: Project is vulnerable to: PYSEC-2015-17","Warn: Project is vulnerable to: PYSEC-2023-74"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T22:47:48.669Z","repository_id":37475676,"created_at":"2025-08-18T22:47:48.669Z","updated_at":"2025-08-18T22:47:48.669Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278981740,"owners_count":26079688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activation-maps","class-activation-map","cnn","deep-learning","grad-cam","gradcam","gradcam-plus-plus","interpretability","interpretable-deep-learning","python","pytorch","saliency-map","score-cam","smoothgrad"],"created_at":"2024-08-02T01:02:31.408Z","updated_at":"2025-10-08T17:23:53.565Z","avatar_url":"https://github.com/frgfm.png","language":"Python","funding_links":["https://github.com/sponsors/frgfm"],"categories":["XAI Libraries for Vision/Vision-Language","Python","Object Detection Applications","其他_机器视觉","🧰 Tool","Python Libraries(sort in alphabeta order)"],"sub_categories":["资源传输下载","2023","Evaluation methods"],"readme":"\u003ch1 align=\"center\"\u003e\n  TorchCAM: class activation explorer\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/frgfm/torch-cam/actions/workflows/build.yml\"\u003e\n    \u003cimg alt=\"CI Status\" src=\"https://img.shields.io/github/actions/workflow/status/frgfm/torch-cam/build.yml?branch=main\u0026label=CI\u0026logo=github\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/astral-sh/ruff\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Linter-Ruff-FCC21B?style=flat-square\u0026logo=ruff\u0026logoColor=white\" alt=\"ruff\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/astral-sh/ruff\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Formatter-Ruff-FCC21B?style=flat-square\u0026logo=Python\u0026logoColor=white\" alt=\"ruff\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.codacy.com/gh/frgfm/torch-cam/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=frgfm/torch-cam\u0026amp;utm_campaign=Badge_Grade\"\u003e\u003cimg src=\"https://app.codacy.com/project/badge/Grade/87eaeec3e15442188f96c36bace5faf4\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/frgfm/torch-cam\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/frgfm/torch-cam.svg?logo=codecov\u0026style=flat-square\u0026label=Coverage\" alt=\"Test coverage percentage\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/torchcam/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/torchcam.svg?logo=PyPI\u0026logoColor=fff\u0026style=flat-square\u0026label=PyPI\" alt=\"PyPi Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://anaconda.org/frgfm/torchcam\"\u003e\n    \u003cimg src=\"https://img.shields.io/conda/v/frgfm/torchcam.svg?logo=anaconda\u0026label=Conda\u0026logoColor=fff\u0026style=flat-square\" alt=\"Conda Version\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/pyversions/torchcam.svg?logo=Python\u0026label=Python\u0026logoColor=fff\u0026style=flat-square\" alt=\"pyversions\"\u003e\n  \u003ca href=\"https://github.com/frgfm/torch-cam/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/frgfm/torch-cam.svg?label=License\u0026logoColor=fff\u0026style=flat-square\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://huggingface.co/spaces/frgfm/torch-cam\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue\" alt=\"Huggingface Spaces\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://colab.research.google.com/github/frgfm/notebooks/blob/main/torch-cam/quicktour.ipynb\"\u003e\n    \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://frgfm.github.io/torch-cam\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/frgfm/torch-cam/page-build.yml?branch=main\u0026label=Documentation\u0026logo=read-the-docs\u0026logoColor=white\u0026style=flat-square\" alt=\"Documentation Status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nSimple way to leverage the class-specific activation of convolutional layers in PyTorch.\n\n\u003cp align=\"center\"\u003e\n    \u003ca alt=\"cam_examples\"\u003e\n        \u003cimg src=\"https://github.com/frgfm/torch-cam/releases/download/v0.3.1/example.png\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eSource: image from \u003ca href=\"https://www.woopets.fr/assets/races/000/066/big-portrait/border-collie.jpg\"\u003ewoopets\u003c/a\u003e (activation maps created with a pretrained \u003ca href=\"https://pytorch.org/vision/stable/models.html#torchvision.models.resnet18\"\u003eResnet-18\u003c/a\u003e)\u003c/em\u003e\n\u003c/p\u003e\n\n\n## Quick Tour\n\n### Setting your CAM\n\nTorchCAM leverages [PyTorch hooking mechanisms](https://pytorch.org/tutorials/beginner/former_torchies/nnft_tutorial.html#forward-and-backward-function-hooks) to seamlessly retrieve all required information to produce the class activation without additional efforts from the user. Each CAM object acts as a wrapper around your model.\n\nYou can find the exhaustive list of supported CAM methods in the [documentation](https://frgfm.github.io/torch-cam/methods.html), then use it as follows:\n\n```python\n# Define your model\nfrom torchvision.models import resnet18\nmodel = resnet18(pretrained=True).eval()\n\n# Set your CAM extractor\nfrom torchcam.methods import SmoothGradCAMpp\ncam_extractor = SmoothGradCAMpp(model)\n```\n\n*Please note that by default, the layer at which the CAM is retrieved is set to the last non-reduced convolutional layer. If you wish to investigate a specific layer, use the `target_layer` argument in the constructor.*\n\n\n\n### Retrieving the class activation map\n\nOnce your CAM extractor is set, you only need to use your model to infer on your data as usual. If any additional information is required, the extractor will get it for you automatically.\n\n```python\nfrom torchvision.io.image import read_image\nfrom torchvision.transforms.functional import normalize, resize, to_pil_image\nfrom torchvision.models import resnet18\nfrom torchcam.methods import SmoothGradCAMpp\n\nmodel = resnet18(pretrained=True).eval()\n# Get your input\nimg = read_image(\"path/to/your/image.png\")\n# Preprocess it for your chosen model\ninput_tensor = normalize(resize(img, (224, 224)) / 255., [0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n\nwith SmoothGradCAMpp(model) as cam_extractor:\n  # Preprocess your data and feed it to the model\n  out = model(input_tensor.unsqueeze(0))\n  # Retrieve the CAM by passing the class index and the model output\n  activation_map = cam_extractor(out.squeeze(0).argmax().item(), out)\n```\n\nIf you want to visualize your heatmap, you only need to cast the CAM to a numpy ndarray:\n\n```python\nimport matplotlib.pyplot as plt\n# Visualize the raw CAM\nplt.imshow(activation_map[0].squeeze(0).numpy()); plt.axis('off'); plt.tight_layout(); plt.show()\n```\n\n![raw_heatmap](https://github.com/frgfm/torch-cam/releases/download/v0.1.2/raw_heatmap.png)\n\nOr if you wish to overlay it on your input image:\n\n```python\nimport matplotlib.pyplot as plt\nfrom torchcam.utils import overlay_mask\n\n# Resize the CAM and overlay it\nresult = overlay_mask(to_pil_image(img), to_pil_image(activation_map[0].squeeze(0), mode='F'), alpha=0.5)\n# Display it\nplt.imshow(result); plt.axis('off'); plt.tight_layout(); plt.show()\n```\n\n![overlayed_heatmap](https://github.com/frgfm/torch-cam/releases/download/v0.1.2/overlayed_heatmap.png)\n\n## Setup\n\nPython 3.9 (or higher) and [uv](https://docs.astral.sh/uv/)/[conda](https://docs.conda.io/en/latest/miniconda.html) are required to install TorchCAM.\n\n### Stable release\n\nYou can install the last stable release of the package using [pypi](https://pypi.org/project/torchcam/) as follows:\n\n```shell\npip install torchcam\n```\n\nor using [conda](https://anaconda.org/frgfm/torchcam):\n\n```shell\nconda install -c frgfm torchcam\n```\n\n### Developer installation\n\nAlternatively, if you wish to use the latest features of the project that haven't made their way to a release yet, you can install the package from source:\n\n```shell\ngit clone https://github.com/frgfm/torch-cam.git\npip install -e torch-cam/.\n```\n\n\n\n## CAM Zoo\n\nThis project is developed and maintained by the repo owner, but the implementation was based on the following research papers:\n\n- [Learning Deep Features for Discriminative Localization](https://arxiv.org/abs/1512.04150): the original CAM paper\n- [Grad-CAM](https://arxiv.org/abs/1610.02391): GradCAM paper, generalizing CAM to models without global average pooling.\n- [Grad-CAM++](https://arxiv.org/abs/1710.11063): improvement of GradCAM++ for more accurate pixel-level contribution to the activation.\n- [Smooth Grad-CAM++](https://arxiv.org/abs/1908.01224): SmoothGrad mechanism coupled with GradCAM.\n- [Score-CAM](https://arxiv.org/abs/1910.01279): score-weighting of class activation for better interpretability.\n- [SS-CAM](https://arxiv.org/abs/2006.14255): SmoothGrad mechanism coupled with Score-CAM.\n- [IS-CAM](https://arxiv.org/abs/2010.03023): integration-based variant of Score-CAM.\n- [XGrad-CAM](https://arxiv.org/abs/2008.02312): improved version of Grad-CAM in terms of sensitivity and conservation.\n- [Layer-CAM](http://mftp.mmcheng.net/Papers/21TIP_LayerCAM.pdf): Grad-CAM alternative leveraging pixel-wise contribution of the gradient to the activation.\n\n\u003cp align=\"center\"\u003e\n    \u003ca alt=\"wallaby_video_cam\"\u003e\n        \u003cimg src=\"https://github.com/frgfm/torch-cam/releases/download/v0.2.0/video_example_wallaby.gif\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eSource: \u003ca href=\"https://www.youtube.com/watch?v=hZJN5BzKfxk\"\u003eYouTube video\u003c/a\u003e (activation maps created by \u003ca href=\"https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.LayerCAM\"\u003eLayer-CAM\u003c/a\u003e with a pretrained \u003ca href=\"https://pytorch.org/vision/stable/models.html#torchvision.models.resnet18\"\u003eResNet-18\u003c/a\u003e)\u003c/em\u003e\n\u003c/p\u003e\n\n\n\n## What else\n\n### Documentation\n\nThe full package documentation is available [here](https://frgfm.github.io/torch-cam/) for detailed specifications.\n\n### Demo app\n\nA minimal demo app is provided for you to play with the supported CAM methods! Feel free to check out the live demo on [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/frgfm/torch-cam)\n\nIf you prefer running the demo by yourself, you will need an extra dependency ([Streamlit](https://streamlit.io/)) for the app to run:\n\n```\npip install -e \".[demo]\"\n```\n\nYou can then easily run your app in your default browser by running:\n\n```\nstreamlit run demo/app.py\n```\n\n![torchcam_demo](https://github.com/frgfm/torch-cam/releases/download/v0.2.0/torchcam_demo.png)\n\n### Example script\n\nAn example script is provided for you to benchmark the heatmaps produced by multiple CAM approaches on the same image:\n\n```shell\npython scripts/cam_example.py --arch resnet18 --class-idx 232 --rows 2\n```\n\n![gradcam_sample](https://github.com/frgfm/torch-cam/releases/download/v0.3.1/example.png)\n\n*All script arguments can be checked using `python scripts/cam_example.py --help`*\n\n\n\n### Latency benchmark\n\nYou crave for beautiful activation maps, but you don't know whether it fits your needs in terms of latency?\n\nIn the table below, you will find a latency benchmark (forward pass not included) for all CAM methods:\n\n| CAM method                                                   | Arch               | GPU mean (std)     | CPU mean (std)       |\n| ------------------------------------------------------------ | ------------------ | ------------------ | -------------------- |\n| [CAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.CAM) | resnet18           | 0.11ms (0.02ms)    | 0.14ms (0.03ms)      |\n| [GradCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.GradCAM) | resnet18           | 3.71ms (1.11ms)    | 40.66ms (1.82ms)     |\n| [GradCAMpp](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.GradCAMpp) | resnet18           | 5.21ms (1.22ms)    | 41.61ms (3.24ms)     |\n| [SmoothGradCAMpp](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.SmoothGradCAMpp) | resnet18           | 33.67ms (2.51ms)   | 239.27ms (7.85ms)    |\n| [ScoreCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.ScoreCAM) | resnet18           | 304.74ms (11.54ms) | 6796.89ms (415.14ms) |\n| [SSCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.SSCAM) | resnet18           |                    |                      |\n| [ISCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.ISCAM) | resnet18           |                    |                      |\n| [XGradCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.XGradCAM) | resnet18           | 3.78ms (0.96ms)    | 40.63ms (2.03ms)     |\n| [LayerCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.LayerCAM) | resnet18           | 3.65ms (1.04ms)    | 40.91ms (1.79ms)     |\n| [CAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.CAM) | mobilenet_v3_large | N/A*               | N/A*                 |\n| [GradCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.GradCAM) | mobilenet_v3_large | 8.61ms (1.04ms)    | 26.64ms (3.46ms)     |\n| [GradCAMpp](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.GradCAMpp) | mobilenet_v3_large | 8.83ms (1.29ms)    | 25.50ms (3.10ms)     |\n| [SmoothGradCAMpp](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.SmoothGradCAMpp) | mobilenet_v3_large | 77.38ms (3.83ms)   | 156.25ms (4.89ms)    |\n| [ScoreCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.ScoreCAM) | mobilenet_v3_large | 35.19ms (2.11ms)   | 679.16ms (55.04ms)   |\n| [SSCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.SSCAM) | mobilenet_v3_large |                    |                      |\n| [ISCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.ISCAM) | mobilenet_v3_large |                    |                      |\n| [XGradCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.XGradCAM) | mobilenet_v3_large | 8.41ms (0.98ms)    | 24.21ms (2.94ms)     |\n| [LayerCAM](https://frgfm.github.io/torch-cam/latest/methods.html#torchcam.methods.LayerCAM) | mobilenet_v3_large | 8.02ms (0.95ms)    | 25.14ms (3.17ms)     |\n\n**The base CAM method cannot work with architectures that have multiple fully-connected layers*\n\nThis benchmark was performed over 100 iterations on (224, 224) inputs, on a laptop to better reflect performances that can be expected by common users. The hardware setup includes an [Intel(R) Core(TM) i7-10750H](https://ark.intel.com/content/www/us/en/ark/products/201837/intel-core-i710750h-processor-12m-cache-up-to-5-00-ghz.html) for the CPU, and a [NVIDIA GeForce RTX 2070 with Max-Q Design](https://www.nvidia.com/fr-fr/geforce/graphics-cards/rtx-2070/) for the GPU.\n\nYou can run this latency benchmark for any CAM method  on your hardware as follows:\n\n```bash\npython scripts/eval_latency.py SmoothGradCAMpp\n```\n\n*All script arguments can be checked using `python scripts/eval_latency.py --help`*\n\n### Example notebooks\n\nLooking for more illustrations of TorchCAM features?\nYou might want to check the [Jupyter notebooks](notebooks) designed to give you a broader overview.\n\n\n\n## Citation\n\nIf you wish to cite this project, feel free to use this [BibTeX](http://www.bibtex.org/) reference:\n\n```bibtex\n@misc{torcham2020,\n    title={TorchCAM: class activation explorer},\n    author={François-Guillaume Fernandez},\n    year={2020},\n    month={March},\n    publisher = {GitHub},\n    howpublished = {\\url{https://github.com/frgfm/torch-cam}}\n}\n```\n\n\n\n## Contributing\n\nFeeling like extending the range of possibilities of CAM? Or perhaps submitting a paper implementation? Any sort of contribution is greatly appreciated!\n\nYou can find a short guide in [`CONTRIBUTING`](CONTRIBUTING.md) to help grow this project!\n\n\n\n## License\n\nDistributed under the Apache 2.0 License. See [`LICENSE`](LICENSE) for more information.\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ffrgfm%2Ftorch-cam.svg?type=large\u0026issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Ffrgfm%2Ftorch-cam?ref=badge_large\u0026issueType=license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrgfm%2Ftorch-cam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrgfm%2Ftorch-cam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrgfm%2Ftorch-cam/lists"}