https://github.com/jacobgil/keras-cam
Keras implementation of class activation mapping
https://github.com/jacobgil/keras-cam
deep-learning deep-learning-visualization keras visualization
Last synced: about 1 month ago
JSON representation
Keras implementation of class activation mapping
- Host: GitHub
- URL: https://github.com/jacobgil/keras-cam
- Owner: jacobgil
- Created: 2016-08-19T18:52:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-05T02:53:50.000Z (almost 8 years ago)
- Last Synced: 2025-04-02T11:04:29.366Z (about 1 month ago)
- Topics: deep-learning, deep-learning-visualization, keras, visualization
- Language: Python
- Size: 448 KB
- Stars: 335
- Watchers: 10
- Forks: 104
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Keras implementation of class activation mapping
Paper / project page: http://cnnlocalization.csail.mit.edu
Paper authors' code with Caffe / matcaffe interface: https://github.com/metalbubble/CAM
Blog post on this repository: http://jacobcv.blogspot.com/2016/08/class-activation-maps-in-keras.html
Checkpoint with person/not person weights: https://drive.google.com/open?id=0B1l5JSkBbENBdk95ZW1DOUhqQUE

This project implements class activation maps with Keras.
Class activation maps are a simple technique to get the image regions relevant to a certain class.
This was fined tuned on VGG16 with images from here:
http://pascal.inrialpes.fr/data/humanThe model in model.py is a two category classifier, used to classify person / not a person.
python cam.py --model_path cam_checkpoint.hdf5 --image_path=image.jpg
usage: cam.py [-h] [--train TRAIN] [--image_path IMAGE_PATH]
[--output_path OUTPUT_PATH] [--model_path MODEL_PATH]
[--dataset_path DATASET_PATH]optional arguments:
-h, --help show this help message and exit
--train TRAIN Train the network or visualize a CAM
--image_path IMAGE_PATH
Path of an image to run the network on
--output_path OUTPUT_PATH
Path of an image to run the network on
--model_path MODEL_PATH
Path of the trained model
--dataset_path DATASET_PATH
Path to image dataset. Should have pos/neg folders,
like in the inria person dataset.
http://pascal.inrialpes.fr/data/human/