Awesome
Listwise-View-Ranking-Image-Cropping
Material
Paper, Model(Google), Model(Baidu)
Citation
@article{lu2019listwise,
title={Listwise View Ranking for Image Cropping},
author={Lu, Weirui and Xing, Xiaofen and Cai, Bolun and Xu, Xiangmin},
journal={arXiv preprint arXiv:1905.05352},
year={2019}
}
Abstract
Rank-based Learning with deep neural network has been widely used for image cropping. However, the performance of ranking-based methods is often poor and this is mainly due to two reasons: 1) image cropping is a listwise ranking task rather than pairwise comparison; 2) the rescaling caused by pooling layer and the deformation in view generation damage the performance of composition learning. In this paper, we develop a novel model to overcome these problems. To address the first problem, we formulate the image cropping as a listwise ranking problem to find the best view composition. For the second problem, a refined view sampling (called RoIRefine) is proposed to extract refined feature maps for candidate view generation. Given a series of candidate views, the proposed model learns the Top-1 probability distribution of views and picks up the best one. By integrating refined sampling and listwise ranking, the proposed network called LVRN achieves the state-of-the-art performance both in accuracy and speed.
Prerequisites
Pytorch 0.4.1
Run demo
- Put your test images into
images
folder. - Download the pre-trained model into
model
folder. cd lib
and runmake.sh
to build roi_crop, roi_align and roi_pooling modules.- run
python demo.py --GPU x
Train
- Download the train dataset(CPC),
cd lib/utils
and modifyconfig.py
- run
python generatePdefinedAnchors.py
to generate pre-defined anchors for training and evaluation. - run
python createImdbDataset.py
to create lmdb-type datasets for training. cd ..
and runmake.sh
to build roi_crop, roi_align and roi_pooling modules.- run
python train.py --GPU x --bs x --lr x
Evaluation
- Download the cropping dataset(FCDB and FLMS),
cd lib/utils
and modifyconfig.py
. - Download the pre-trained model into
model
folder. cd lib
and runmake.sh
to build roi_crop, roi_align and roi_pooling modules.- modify the path of
create_gt_crops.py
and runpython create_gt_crops.py
to create the ground-truth. - run
python demo.py --GPU x
Qualitative visualization on FCDB dataset
<img src="https://github.com/luwr1022/listwise-view-ranking/blob/master/examples/lvrn.jpg" alt="gt" align=center />.
In this work, the RoI operation (RoIPool, RoIAlign and RoIRefine) are based on https://github.com/jwyang/faster-rcnn.pytorch.