# tf-faster-rcnn is deprecated:
For a good and more up-to-date implementation for faster/mask RCNN with multi-gpu support, please see the example in TensorPack [here](https://github.com/tensorpack/tensorpack/tree/master/examples/FasterRCNN).
# tf-faster-rcnn
A Tensorflow implementation of faster RCNN detection framework by Xinlei Chen (xinleic@cs.cmu.edu). 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.
![](data/imgs/gt.png) | ![](data/imgs/pred.png)
:-------------------------:|:-------------------------:
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, t
没有合适的资源?快使用搜索试试~ 我知道了~
tf-faster-rcnn-master.rar_Faster-_blankd6y_faster RCNN_faster RC
共87个文件
py:44个
xml:6个
yml:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 157 浏览量
2022-07-15
21:35:58
上传
评论
收藏 1.33MB RAR 举报
温馨提示
faster rcnn框架实现目标检测,tensorflow版本
资源详情
资源评论
资源推荐
收起资源包目录
tf-faster-rcnn-master.rar (87个子文件)
tf-faster-rcnn-master
tools
trainval_net.py 4KB
_init_paths.py 324B
demo.py 6KB
test_net.py 4KB
convert_from_depre.py 7KB
reval.py 2KB
data
imgs
gt.png 352KB
pred.png 358KB
.gitignore 64B
demo
000456.jpg 103KB
001150.jpg 87KB
000542.jpg 113KB
004545.jpg 120KB
001763.jpg 72KB
scripts
fetch_faster_rcnn_models.sh 956B
LICENSE 1KB
.idea
misc.xml 364B
webServers.xml 603B
deployment.xml 1KB
modules.xml 301B
workspace.xml 11KB
tf-faster-rcnn-master.iml 511B
inspectionProfiles
profiles_settings.xml 174B
tttt.py 586B
experiments
cfgs
res50.yml 322B
vgg16.yml 301B
res101-lg.yml 449B
res101.yml 324B
mobile.yml 324B
logs
.gitignore 8B
scripts
test_faster_rcnn.sh 2KB
train_faster_rcnn.sh 2KB
convert_vgg16.sh 2KB
docker
Dockerfile.cuda-7.5 1KB
Dockerfile.cuda-8.0 1KB
.gitignore 111B
lib
nms
gpu_nms.cpp 263KB
py_cpu_nms.py 1KB
gpu_nms.pyx 1KB
__init__.py 0B
.gitignore 0B
gpu_nms.hpp 146B
cpu_nms.pyx 2KB
nms_kernel.cu 5KB
cpu_nms.c 285KB
model
test.py 6KB
bbox_transform.py 4KB
nms_wrapper.py 719B
train_val.py 14KB
__init__.py 21B
config.py 11KB
nets
resnet_v1.py 8KB
mobilenet_v1.py 11KB
vgg16.py 4KB
__init__.py 0B
network.py 23KB
setup.py 5KB
roi_data_layer
layer.py 3KB
roidb.py 2KB
minibatch.py 3KB
__init__.py 248B
layer_utils
snippets.py 2KB
generate_anchors.py 3KB
anchor_target_layer.py 6KB
proposal_target_layer.py 6KB
__init__.py 0B
proposal_layer.py 3KB
proposal_top_layer.py 3KB
Makefile 94B
utils
timer.py 948B
__init__.py 248B
bbox.pyx 2KB
.gitignore 20B
visualization.py 4KB
blob.py 1KB
datasets
pascal_voc.py 11KB
coco.py 12KB
tools
mcg_munge.py 1KB
__init__.py 248B
factory.py 2KB
voc_eval.py 7KB
ds_utils.py 1KB
imdb.py 9KB
VOCdevkit-matlab-wrapper
voc_eval.m 1KB
get_voc_opts.m 231B
xVOCap.m 258B
README.md 16KB
共 87 条
- 1
APei
- 粉丝: 63
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0