项目作者: yangxue0827

项目描述 :
R2CNN: Rotational Region CNN Based on FPN (Tensorflow)
高级语言: Python
项目地址: git://github.com/yangxue0827/R2CNN_FPN_Tensorflow.git
创建时间: 2017-11-14T13:47:01Z
项目社区:https://github.com/yangxue0827/R2CNN_FPN_Tensorflow

开源协议:

下载


R2CNN: Rotational Region CNN for Orientation Robust Scene Detection

Recommend improved code: https://github.com/DetectionTeamUCAS

A Tensorflow implementation of FPN or R2CNN detection framework based on FPN.
You can refer to the papers R2CNN Rotational Region CNN for Orientation Robust Scene Text Detection or Feature Pyramid Networks for Object Detection
Other rotation detection method reference R-DFPN, RRPN and R2CNN_HEAD
If useful to you, please star to support my work. Thanks.

Citation

Some relevant achievements based on this code.

  1. @article{[yang2018position](https://ieeexplore.ieee.org/document/8464244),
  2. title={Position Detection and Direction Prediction for Arbitrary-Oriented Ships via Multitask Rotation Region Convolutional Neural Network},
  3. author={Yang, Xue and Sun, Hao and Sun, Xian and Yan, Menglong and Guo, Zhi and Fu, Kun},
  4. journal={IEEE Access},
  5. volume={6},
  6. pages={50839-50849},
  7. year={2018},
  8. publisher={IEEE}
  9. }
  10. @article{[yang2018r-dfpn](http://www.mdpi.com/2072-4292/10/1/132),
  11. title={Automatic ship detection in remote sensing images from google earth of complex scenes based on multiscale rotation dense feature pyramid networks},
  12. author={Yang, Xue and Sun, Hao and Fu, Kun and Yang, Jirui and Sun, Xian and Yan, Menglong and Guo, Zhi},
  13. journal={Remote Sensing},
  14. volume={10},
  15. number={1},
  16. pages={132},
  17. year={2018},
  18. publisher={Multidisciplinary Digital Publishing Institute}
  19. }

Configuration Environment

ubuntu(Encoding problems may occur on windows) + python2 + tensorflow1.2 + cv2 + cuda8.0 + GeForce GTX 1080
If you want to use cpu, you need to modify the parameters of NMS and IOU functions use_gpu = False in cfgs.py
You can also use docker environment, command: docker pull yangxue2docker/tensorflow3_gpu_cv2_sshd:v1.0

Installation

Clone the repository

  1. git clone https://github.com/yangxue0827/R2CNN_FPN_Tensorflow.git

Make tfrecord

The data is VOC format, reference here
Data path format ($R2CNN_ROOT/data/io/divide_data.py)

  1. ├── VOCdevkit
  2. ├── VOCdevkit_train
  3. ├── Annotation
  4. ├── JPEGImages
  5. ├── VOCdevkit_test
  6. ├── Annotation
  7. ├── JPEGImages

Clone the repository

  1. cd $R2CNN_ROOT/data/io/
  2. python convert_data_to_tfrecord.py --VOC_dir='***/VOCdevkit/VOCdevkit_train/' --save_name='train' --img_format='.jpg' --dataset='ship'

Compile

  1. cd $PATH_ROOT/libs/box_utils/
  2. python setup.py build_ext --inplace

Demo

1、Unzip the weight $R2CNN_ROOT/output/res101_trained_weights/*.rar
2、put images in $R2CNN_ROOT/tools/inference_image
3、Configure parameters in $R2CNN_ROOT/libs/configs/cfgs.py and modify the project’s root directory
4、

  1. cd $R2CNN_ROOT/tools

5、image slice

  1. python inference1.py

6、large image

  1. cd $FPN_ROOT/tools
  2. python demo1.py --src_folder=.\demo_src --des_folder=.\demo_des

Train

1、Modify $R2CNN_ROOT/libs/lable_name_dict/*_dict.py, corresponding to the number of categories in the configuration file
2、download pretrain weight(resnet_v1_101_2016_08_28.tar.gz or resnet_v1_50_2016_08_28.tar.gz) from here, then extract to folder $R2CNN_ROOT/data/pretrained_weights
3、

  1. cd $R2CNN_ROOT/tools

4、Choose a model(FPN or R2CNN))
If you want to train FPN :

  1. python train.py

elif you want to train R2CNN:

  1. python train1.py

Test tfrecord

  1. cd $R2CNN_ROOT/tools
  2. python test.py(test1.py)
  1. cd $R2CNN_ROOT/tools
  2. python eval.py(eval1.py)

Summary

  1. tensorboard --logdir=$R2CNN_ROOT/output/res101_summary/

01
02
03

Graph

04

icdar2015 test results

19
20

21
22

23
24

Test results

11
12

13
14

15
16

17
18