# *Faster* R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
By Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun at Microsoft Research
### Introduction
**Faster** R-CNN is an object detection framework based on deep convolutional networks, which includes a Region Proposal Network (RPN) and an Object Detection Network. Both networks are trained for sharing convolutional layers for fast testing.
Faster R-CNN was initially described in an [arXiv tech report](http://arxiv.org/abs/1506.01497).
This repo contains a MATLAB re-implementation of Fast R-CNN. Details about Fast R-CNN are in: [rbgirshick/fast-rcnn](https://github.com/rbgirshick/fast-rcnn).
This code has been tested on Windows 7/8 64-bit, Windows Server 2012 R2, and Linux, and on MATLAB 2014a.
Python version is available at [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn).
### License
Faster R-CNN is released under the MIT License (refer to the LICENSE file for details).
### Citing Faster R-CNN
If you find Faster R-CNN useful in your research, please consider citing:
@article{ren15fasterrcnn,
Author = {Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun},
Title = {{Faster R-CNN}: Towards Real-Time Object Detection with Region Proposal Networks},
Journal = {arXiv preprint arXiv:1506.01497},
Year = {2015}
}
### Main resutls
| training data | test data | mAP | time/img
------------------------- |:--------------------------------------:|:--------------------:|:-----:|:-----:
Faster RCNN, VGG-16 | VOC 2007 trainval | VOC 2007 test | 69.9% | 198ms
Faster RCNN, VGG-16 | VOC 2007 trainval + 2012 trainval | VOC 2007 test | 73.2% | 198ms
Faster RCNN, VGG-16 | VOC 2012 trainval | VOC 2012 test | 67.0% | 198ms
Faster RCNN, VGG-16 | VOC 2007 trainval&test + 2012 trainval | VOC 2012 test | 70.4% | 198ms
**Note**: The mAP results are subject to random variations. We have run 5 times independently for ZF net, and the mAPs are 59.9 (as in the paper), 60.4, 59.5, 60.1, and 59.5, with a mean of 59.88 and std 0.39.
### Contents
0. [Requirements: software](#requirements-software)
0. [Requirements: hardware](#requirements-hardware)
0. [Preparation for Testing](#preparation-for-testing)
0. [Testing Demo](#testing-demo)
0. [Preparation for Training](#preparation-for-training)
0. [Training](#training)
0. [Resources](#resources)
### Requirements: software
0. `Caffe` build for Faster R-CNN (included in this repository, see `external/caffe`)
- If you are using Windows, you may download a compiled mex file by running `fetch_data/fetch_caffe_mex_windows_vs2013_cuda65.m`
- If you are using Linux or you want to compile for Windows, please follow the [instructions](https://github.com/ShaoqingRen/caffe/tree/faster-R-CNN) on our Caffe branch.
0. MATLAB
### Requirements: hardware
GPU: Titan, Titan Black, Titan X, K20, K40, K80.
0. Region Proposal Network (RPN)
- 2GB GPU memory for ZF net
- 5GB GPU memory for VGG-16 net
0. Ojbect Detection Network (Fast R-CNN)
- 3GB GPU memory for ZF net
- 8GB GPU memory for VGG-16 net
### Preparation for Testing:
0. Run `fetch_data/fetch_caffe_mex_windows_vs2013_cuda65.m` to download a compiled Caffe mex (for Windows only).
0. Run `faster_rcnn_build.m`
0. Run `startup.m`
### Testing Demo:
0. Run `fetch_data/fetch_faster_rcnn_final_model.m` to download our trained models.
0. Run `experiments/script_faster_rcnn_demo.m` to test a single demo image.
- You will see the timing information as below. We get the following running time on K40 @ 875 MHz and Intel Xeon CPU E5-2650 v2 @ 2.60GHz for the demo images with VGG-16:
```Shell
001763.jpg (500x375): time 0.201s (resize+conv+proposal: 0.150s, nms+regionwise: 0.052s)
004545.jpg (500x375): time 0.201s (resize+conv+proposal: 0.151s, nms+regionwise: 0.050s)
000542.jpg (500x375): time 0.192s (resize+conv+proposal: 0.151s, nms+regionwise: 0.041s)
000456.jpg (500x375): time 0.202s (resize+conv+proposal: 0.152s, nms+regionwise: 0.050s)
001150.jpg (500x375): time 0.194s (resize+conv+proposal: 0.151s, nms+regionwise: 0.043s)
mean time: 0.198s
```
and with ZF net:
```Shell
001763.jpg (500x375): time 0.061s (resize+conv+proposal: 0.032s, nms+regionwise: 0.029s)
004545.jpg (500x375): time 0.063s (resize+conv+proposal: 0.034s, nms+regionwise: 0.029s)
000542.jpg (500x375): time 0.052s (resize+conv+proposal: 0.034s, nms+regionwise: 0.018s)
000456.jpg (500x375): time 0.062s (resize+conv+proposal: 0.034s, nms+regionwise: 0.028s)
001150.jpg (500x375): time 0.058s (resize+conv+proposal: 0.034s, nms+regionwise: 0.023s)
mean time: 0.059s
```
- The visual results might be different from those in the paper due to numerical variations.
- Running time on other GPUs
GPU / mean time | VGG-16 | ZF
:------------------------:|:--------------------:|:--------------------:
K40 | 198ms | 59ms
Titan Black | 174ms | 56ms
Titan X | 151ms | 59ms
### Preparation for Training:
0. Run `fetch_data/fetch_model_ZF.m` to download an ImageNet-pre-trained ZF net.
0. Run `fetch_data/fetch_model_VGG16.m` to download an ImageNet-pre-trained VGG-16 net.
0. Download VOC 2007 and 2012 data to ./datasets
### Training:
0. Run `experiments/script_faster_rcnn_VOC2007_ZF.m` to train a model with ZF net. It runs four steps as follows:
- Train RPN with conv layers tuned; compute RPN results on the train/test sets.
- Train Fast R-CNN with conv layers tuned using step-1 RPN proposals; evaluate detection mAP.
- Train RPN with conv layers fixed; compute RPN results on the train/test sets.
- Train Fast R-CNN with conv layers fixed using step-3 RPN proposals; evaluate detection mAP.
- **Note**: the entire training time is ~12 hours on K40.
0. Run `experiments/script_faster_rcnn_VOC2007_VGG16.m` to train a model with VGG net.
- **Note**: the entire training time is ~2 days on K40.
0. Check other scripts in `./experiments` for more settings.
### Resources
**Note**: This documentation may contain links to third party websites, which are provided for your convenience only. Such third party websites are not under Microsoft’s control. Microsoft does not endorse or make any representation, guarantee or assurance regarding any third party website, content, service or product. Third party websites may be subject to the third party’s terms, conditions, and privacy statements.
0. Experiment logs: [OneDrive](https://onedrive.live.com/download?resid=36FEC490FBC32F1A!110&authkey=!ACpgYZR2MmfklwI&ithint=file%2czip), [DropBox](https://www.dropbox.com/s/wu841r7zmebjp6r/faster_rcnn_logs.zip?dl=0), [BaiduYun](http://pan.baidu.com/s/1ntJ3dLv)
0. Regions proposals of our trained RPN:
- ZF net trained on VOC 07 trainval [OneDrive](https://onedrive.live.com/download?resid=36FEC490FBC32F1A!115&authkey=!AJJMrFJHKLXIg5c&ithint=file%2czip), [BaiduYun](http://pan.baidu.com/s/1dDFGerf)
- ZF net trained on VOC 07/12 trainval [OneDrive](https://onedrive.live.com/download?resid=36FEC490FBC32F1A!117&authkey=!AJiy5F6Cum1iosI&ithint=file%2czip), [BaiduYun](http://pan.baidu.com/s/1jGAgkZW)
- VGG net trained on VOC 07 trainval [OneDrive](https://onedrive.live.com/download?resid=36FEC490FBC32F1A!116&authkey=!AH4Zi_KAaun7MhQ&ithint=file%2czip), [BaiduYun](http://pan.baidu.com/s/1qWHv4JU)
- VGG net trained on VOC 07/12 trainval [OneDrive](https://onedrive.live.com/download?resid=36FEC490FBC32F1A!118&authkey=!AB_lKk3dbGyr1-I&ithint=file%2czip), [BaiduYun](http://pan.baidu.com/s/1c0fQpqg)
- **Note**: the proposals are in the format of [left, top, right, bottom, confidence]
If the automatic "fetch_data" fails, you
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
faster-rcnn源码 (104个子文件)
nms_multiclass_mex.cpp 4KB
nms_mex.cpp 3KB
nms_gpu_mex.cu 5KB
.gitattributes 378B
.gitignore 683B
.gitmodules 123B
LICENSE 4KB
proposal_train.m 14KB
fast_rcnn_train.m 11KB
proposal_prepare_image_roidb.m 9KB
fast_rcnn_test.m 8KB
roidb_from_voc.m 7KB
fast_rcnn_get_minibatch.m 6KB
script_faster_rcnn_demo.m 6KB
fast_rcnn_prepare_image_roidb.m 6KB
proposal_generate_minibatch.m 5KB
gather_rpn_fast_rcnn_models.m 5KB
proposal_im_detect.m 5KB
fast_rcnn_im_detect.m 5KB
script_faster_rcnn_VOC0712plus_VGG16.m 5KB
script_faster_rcnn_VOC2012_VGG16.m 5KB
script_faster_rcnn_VOC2007_VGG16.m 5KB
script_faster_rcnn_VOC0712_VGG16.m 5KB
script_faster_rcnn_VOC0712_ZF.m 5KB
script_faster_rcnn_VOC2007_ZF.m 5KB
fast_rcnn_conv_feat_detect.m 4KB
proposal_config.m 4KB
proposal_test.m 3KB
imdb_from_voc.m 3KB
proposal_visual_debug.m 3KB
imdb_eval_voc.m 3KB
fast_rcnn_config.m 3KB
showboxes.m 3KB
proposal_generate_anchors.m 2KB
VGG16_for_Faster_RCNN_VOC0712plus.m 2KB
VGG16_for_Faster_RCNN_VOC0712.m 2KB
VGG16_for_Faster_RCNN_VOC2012.m 2KB
VGG16_for_Faster_RCNN_VOC2007.m 2KB
script_fast_rcnn_VOC2007_VGG16.m 2KB
script_fast_rcnn_VOC0712_VGG16.m 2KB
script_fast_rcnn_VOC2007_ZF.m 2KB
script_fast_rcnn_VOC0712_ZF.m 2KB
ZF_for_Faster_RCNN_VOC0712.m 2KB
ZF_for_Faster_RCNN_VOC2007.m 2KB
proposal_locate_anchors.m 2KB
subsample_images_per_class.m 2KB
roidb_from_proposal.m 2KB
do_proposal_test.m 2KB
nvmex.m 2KB
nms.m 2KB
fast_rcnn_generate_sliding_windows.m 2KB
nms_multiclass.m 2KB
set_cache_folder.m 1KB
subsample_images.m 1KB
fast_rcnn_bbox_transform_inv.m 1KB
proposal_calc_output_size.m 1KB
prep_im_for_blob.m 1KB
boxoverlap.m 1KB
fast_rcnn_bbox_transform.m 1KB
startup.m 1KB
voc0712plus_trainval_ss.m 953B
active_caffe_mex.m 951B
voc0712plus_trainval.m 898B
voc0712_trainval_ss.m 854B
voc2007_trainval_ss.m 836B
voc2007_test_ss.m 820B
seed_rand.m 806B
voc0712_trainval.m 799B
auto_select_gpu.m 791B
do_fast_rcnn_train.m 769B
do_proposal_train.m 768B
fast_rcnn_map_im_rois_to_feat_rois.m 749B
voc2012_trainval.m 749B
voc2007_trainval.m 749B
voc2012_test.m 733B
voc2007_test.m 733B
faster_rcnn_build.m 722B
tic_toc_print.m 712B
do_fast_rcnn_test.m 579B
procid.m 578B
VGG16_for_Fast_RCNN_VOC2007.m 574B
VGG16_for_Fast_RCNN_VOC0712.m 574B
fetch_faster_rcnn_final_model.m 572B
parse_rst.m 570B
fetch_model_VGG16.m 516B
fetch_caffe_mex_windows_vs2013_cuda65.m 509B
fetch_model_ZF.m 505B
ZF_for_Fast_RCNN_VOC0712.m 467B
ZF_for_Fast_RCNN_VOC2007.m 467B
symbolic_link.m 446B
im_list_to_blob.m 419B
prep_im_for_blob_size.m 383B
vis_label.m 347B
xVOChash_init.m 295B
xVOCap.m 248B
get_voc_opts.m 231B
RectLTRB2LTWH.m 209B
RectLTWH2LTRB.m 207B
xVOChash_lookup.m 188B
mkdir_if_missing.m 114B
共 104 条
- 1
- 2
资源评论
- gdwvip2016-11-11正是需要的,学习中
u010125209
- 粉丝: 0
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功