yolov5-gradcam  by pooya-mohammadi

YOLOv5 layer visualization using GradCAM

created 3 years ago
297 stars

Top 90.4% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Grad-CAM visualization tool for YOLOv5 object detection models, enabling users to understand which parts of an image the model focuses on when detecting objects. It is targeted at researchers and developers working with YOLOv5 who need to interpret model behavior.

How It Works

The implementation integrates Grad-CAM, a technique for visualizing the decision-making process of convolutional neural networks, with the YOLOv5 architecture. It leverages the YOLOv5 codebase for model loading and the gradcam_plus_plus-pytorch repository for Grad-CAM computation, allowing for heatmaps to be overlaid on input images, highlighting areas of interest for object detection.

Quick Start & Requirements

  • Install: pip install -r requirements.txt
  • Prerequisites: YOLOv5 weights (auto-downloaded if not present), Python.
  • Usage: python main.py --model-path yolov5s.pt --img-path images/cat-dog.jpg --output-dir outputs
  • More info: python main.py -h

Highlighted Details

  • Visualizes attention areas of YOLOv5 models.
  • Compatible with YOLOv5-v6.1.
  • Supports custom model weights and class names.

Maintenance & Community

  • The project is maintained by pooya-mohammadi.
  • References include gradcam_plus_plus-pytorch and ultralytics/yolov5.
  • A citation is provided for research use.

Licensing & Compatibility

  • The repository does not explicitly state a license in the provided README.

Limitations & Caveats

  • The README notes an issue where truck heatmaps sometimes show nothing, which was reportedly solved in version 6.1.
  • Future enhancements like GradCam++ and ScoreCam are listed as "To Do."
Health Check
Last commit

1 year ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 90 days

Explore Similar Projects

Starred by Sebastian Raschka Sebastian Raschka(Author of Build a Large Language Model From Scratch), Jiayi Pan Jiayi Pan(Author of SWE-Gym; AI Researcher at UC Berkeley), and
2 more.

pytorch-grad-cam by jacobgil

0.3%
12k
PyTorch SDK for explainable AI in computer vision
created 8 years ago
updated 3 months ago
Feedback? Help us improve.