# tf-faster-rcnn
A Tensorflow implementation of faster RCNN detection framework by Xinlei Chen ([email protected]). This repository is based on the python Caffe implementation of faster RCNN available [here](https://github.com/rbgirshick/py-faster-rcnn).
**Note**: Several minor modifications are made when reimplementing the framework, which give potential improvements. For details about the modifications and ablative analysis, please refer to the technical report [An Implementation of Faster RCNN with Study for Region Sampling](https://arxiv.org/pdf/1702.02138.pdf). If you are seeking to reproduce the results in the original paper, please use the [official code](https://github.com/ShaoqingRen/faster_rcnn) or maybe the [semi-official code](https://github.com/rbgirshick/py-faster-rcnn). For details about the faster RCNN architecture please refer to the paper [Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks](http://arxiv.org/pdf/1506.01497.pdf).
### Detection Performance
The current code supports **VGG16**, **Resnet V1** and **Mobilenet V1** models. We mainly tested it on plain VGG16 and Resnet101 (thank you @philokey!) architecture. As the baseline, we report numbers using a single model on a single convolution layer, so no multi-scale, no multi-stage bounding box regression, no skip-connection, no extra input is used. The only data augmentation technique is left-right flipping during training following the original Faster RCNN. All models are released.
With VGG16 (``conv5_3``):
- Train on VOC 2007 trainval and test on VOC 2007 test, **70.8**.
- Train on VOC 2007+2012 trainval and test on VOC 2007 test ([R-FCN](https://github.com/daijifeng001/R-FCN) schedule), **75.7**.
- Train on COCO 2014 [trainval35k](https://github.com/rbgirshick/py-faster-rcnn/tree/master/models) and test on [minival](https://github.com/rbgirshick/py-faster-rcnn/tree/master/models) (*Iterations*: 900k/1190k), **30.2**.
With Resnet101 (last ``conv4``):
- Train on VOC 2007 trainval and test on VOC 2007 test, **75.7**.
- Train on VOC 2007+2012 trainval and test on VOC 2007 test (R-FCN schedule), **79.8**.
- Train on COCO 2014 trainval35k and test on minival (900k/1190k), **35.4**.
More Results:
- Train Mobilenet (1.0, 224) on COCO 2014 trainval35k and test on minival (900k/1190k), **21.8**.
- Train Resnet50 on COCO 2014 trainval35k and test on minival (900k/1190k), **32.4**.
- Train Resnet152 on COCO 2014 trainval35k and test on minival (900k/1190k), **36.1**.
Approximate *baseline* [setup](https://github.com/endernewton/tf-faster-rcnn/blob/master/experiments/cfgs/res101-lg.yml) from [FPN](https://arxiv.org/abs/1612.03144) (this repository does not contain training code for FPN yet):
- Train Resnet50 on COCO 2014 trainval35k and test on minival (900k/1190k), **34.2**.
- Train Resnet101 on COCO 2014 trainval35k and test on minival (900k/1190k), **37.4**.
- Train Resnet152 on COCO 2014 trainval35k and test on minival (900k/1190k), **38.2**.
**Note**:
- Due to the randomness in GPU training with Tensorflow especially for VOC, the best numbers are reported (with 2-3 attempts) here. According to my experience, for COCO you can almost always get a very close number (within ~0.2%) despite the randomness.
- The numbers are obtained with the **default** testing scheme which selects region proposals using non-maximal suppression (TEST.MODE nms), the alternative testing scheme (TEST.MODE top) will likely result in slightly better performance (see [report](https://arxiv.org/pdf/1702.02138.pdf), for COCO it boosts 0.X AP).
- Since we keep the small proposals (\< 16 pixels width/height), our performance is especially good for small objects.
- We do not set a threshold (instead of 0.05) for a detection to be included in the final result, which increases recall.
- Weight decay is set to 1e-4.
- For other minor modifications, please check the [report](https://arxiv.org/pdf/1702.02138.pdf). Notable ones include using ``crop_and_resize``, and excluding ground truth boxes in RoIs during training.
- For COCO, we find the performance improving with more iterations, and potentially better performance can be achieved with even more iterations.
- For Resnets, we fix the first block (total 4) when fine-tuning the network, and only use ``crop_and_resize`` to resize the RoIs (7x7) without max-pool (which I find useless especially for COCO). The final feature maps are average-pooled for classification and regression. All batch normalization parameters are fixed. Learning rate for biases is not doubled.
- For Mobilenets, we fix the first five layers when fine-tuning the network. All batch normalization parameters are fixed. Weight decay for Mobilenet layers is set to 4e-5.
- For approximate [FPN](https://arxiv.org/abs/1612.03144) baseline setup we simply resize the image with 800 pixels, add 32^2 anchors, and take 1000 proposals during testing.
- Check out [here](http://ladoga.graphics.cs.cmu.edu/xinleic/tf-faster-rcnn/)/[here](http://xinlei.sp.cs.cmu.edu/xinleic/tf-faster-rcnn/)/[here](https://drive.google.com/open?id=0B1_fAEgxdnvJSmF3YUlZcHFqWTQ) for the latest models, including longer COCO VGG16 models and Resnet ones.
 | 
:-------------------------:|:-------------------------:
Displayed Ground Truth on Tensorboard | Displayed Predictions on Tensorboard
### Additional features
Additional features not mentioned in the [report](https://arxiv.org/pdf/1702.02138.pdf) are added to make research life easier:
- **Support for train-and-validation**. During training, the validation data will also be tested from time to time to monitor the process and check potential overfitting. Ideally training and validation should be separate, where the model is loaded every time to test on validation. However I have implemented it in a joint way to save time and GPU memory. Though in the default setup the testing data is used for validation, no special attempts is made to overfit on testing set.
- **Support for resuming training**. I tried to store as much information as possible when snapshoting, with the purpose to resume training from the latest snapshot properly. The meta information includes current image index, permutation of images, and random state of numpy. However, when you resume training the random seed for tensorflow will be reset (not sure how to save the random state of tensorflow now), so it will result in a difference. **Note** that, the current implementation still cannot force the model to behave deterministically even with the random seeds set. Suggestion/solution is welcome and much appreciated.
- **Support for visualization**. The current implementation will summarize ground truth boxes, statistics of losses, activations and variables during training, and dump it to a separate folder for tensorboard visualization. The computing graph is also saved for debugging.
### Prerequisites
- A basic Tensorflow installation. The code follows **r1.2** format. If you are using r1.0, please check out the r1.0 branch to fix the slim Resnet block issue. If you are using an older version (r0.1-r0.12), please check out the r0.12 branch. While it is not required, for experimenting the original RoI pooling (which requires modification of the C++ code in tensorflow), you can check out my tensorflow [fork](https://github.com/endernewton/tensorflow) and look for ``tf.image.roi_pooling``.
- Python packages you might not have: `cython`, `opencv-python`, `easydict` (similar to [py-faster-rcnn](https://github.com/rbgirshick/py-faster-rcnn)). For `easydict` make sure you have the right version. I use 1.6.
- Docker users: Since the recent upgrade, the docker image on docker hub (https://hub.docker.com/r/mbuckler/tf-faster-rcnn-deps/) is no longer valid. However, you can still build your own image by using dockerfile located at `docker` folder (cuda 8 version, as it is required by Tensorf
没有合适的资源?快使用搜索试试~ 我知道了~
tf-faster-rcnn图像检测

共79个文件
py:43个
yml:5个
gitignore:5个

需积分: 50 22 下载量 3 浏览量
2017-10-26
11:03:56
上传
评论 1
收藏 1.35MB ZIP 举报
温馨提示
(github上找到的源码,如有侵权请联系删除,原作者Xinlei Chen ([email protected]). )A Tensorflow implementation of faster RCNN detection framework. This is based on the python Caffe implementation of faster RCNN available here.
资源推荐
资源详情
资源评论





格式:zip 资源大小:445.8KB













格式:zip 资源大小:3.5MB











收起资源包目录





































































































共 79 条
- 1
资源评论


harlay0728
- 粉丝: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 【精华】小学作文300字9篇.doc
- 医院形象设计方案.doc
- 基本设计建筑文字说明(英文).doc
- 一般路基填筑施工工艺流程图.doc
- 恩施州某医院外科大楼施工组织设计(创鲁班奖).doc
- 固安某项目营销策划及独家销售代理合同.doc
- utm-1-initial.ppt
- 回旋钻钻孔灌注桩施工方案(主厂房).doc
- 样板区横向围堰施工方案(附围堰断面图).doc
- 预结算编审方案.docx
- [江苏]高层住宅楼监理大纲(16万平米-流程图-190页).doc
- 维修工程量清单.docx
- 中华人民共和国公司法.doc
- 在妈妈的肚子里(社会).doc
- 地推公司介绍:小林做水果地推案例.docx
- 工程建设监理合同标准条件-.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
