PiCANet
PiCANet copied to clipboard
PiCANet
source code for our CVPR 2018 paper PiCANet: Learning Pixel-wise Contextual Attention for Saliency Detection by Nian Liu, Junwei Han, and Ming-Hsuan Yang.
Created by Nian Liu, Email: [email protected]
Usage:
- Cd to ./caffe, install our modified caffe (given in the source code) and its MATLAB wrapper. Plese refer to http://caffe.berkeleyvision.org/installation.html for caffe installation.
- Download our trained models from Google drive. Unzip them to ./models/models.
- Put your images into ./matlab/images.
- Cd to ./matlab, run 'predict_SOs.m' and the saliency maps will be generated in ./matlab/results. You can also select whether to use the VGG based model or the ResNet50 based model in line 16 or 17.
- You can also consider to use CRF post-processing to improve the detection results like we did in our paper. Please refer to Qibin Hou's code.
- We also provide our saliency maps here.
Training:
- Download the pretrained VGG model (vgg16_20M.caffemodel from deeplab) or the ResNet50 model. Modify the model directories in ./models/train_SO.sh.
- Prepare your images, ground truth saliency maps, and the list file (please refer to ./matlab/list/train_list.txt). Modify corresponding contents in prototxt files.
- Cd to ./models, run
sh train_SO.sh
to start training.
Acknowledgement:
Our code uses some opensource code from deeplab, hybridnet, and a caffe pull request to reduce GPU memory usage. Thank the authors.
Citing our work
Please cite our work if it helps your research:
@inproceedings{liu2018picanet,
title={PiCANet: Learning Pixel-wise Contextual Attention for Saliency Detection},
author={Liu, Nian and Han, Junwei and Yang, Ming-Hsuan},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={3089--3098},
year={2018}
}