• Stars
    star
    413
  • Rank 104,188 (Top 3 %)
  • Language
    Python
  • Created almost 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Tensorflow implementation of FPN detection framework.

Feature Pyramid Networks for Object Detection

Recommend an improved version of FPN๏ผš https://github.com/DetectionTeamUCAS

A Tensorflow implementation of FPN detection framework.
You can refer to the paper Feature Pyramid Networks for Object Detection
Rotation detection method baesd on FPN reference R2CNN, RRPN and R2CNN_HEAD and R-DFPN
If useful to you, please star to support my work. Thanks.

Configuration Environment

ubuntu(Encoding problems may occur on windows) + python2 + tensorflow1.2 + cv2 + cuda8.0 + GeForce GTX 1080
You can also use docker environment, command: docker pull yangxue2docker/tensorflow3_gpu_cv2_sshd:v1.0

Installation

Clone the repository

git clone https://github.com/yangxue0827/FPN_Tensorflow.git    

Make tfrecord

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

โ”œโ”€โ”€ VOCdevkit
โ”‚ย ย  โ”œโ”€โ”€ VOCdevkit_train
โ”‚ย ย      โ”œโ”€โ”€ Annotation
โ”‚ย ย      โ”œโ”€โ”€ JPEGImages
โ”‚    โ”œโ”€โ”€ VOCdevkit_test
โ”‚ย ย      โ”œโ”€โ”€ Annotation
โ”‚ย ย      โ”œโ”€โ”€ JPEGImages
cd $FPN_ROOT/data/io/  
python convert_data_to_tfrecord.py --VOC_dir='***/VOCdevkit/VOCdevkit_train/' --save_name='train' --img_format='.jpg' --dataset='ship'

Demo

1ใ€Unzip the weight $FPN_ROOT/output/res101_trained_weights/*.rar
2ใ€put images in $FPN_ROOT/tools/inference_image
3ใ€Configure parameters in $FPN_ROOT/libs/configs/cfgs.py and modify the project's root directory 4ใ€image slice

cd $FPN_ROOT/tools
python inference.py   

5ใ€big image

cd $FPN_ROOT/tools
python demo.py --src_folder=.\demo_src --des_folder=.\demo_des      

Train

1ใ€Modify $FPN_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 $FPN_ROOT/data/pretrained_weights
3ใ€

cd $FPN_ROOT/tools
python train.py 

Test tfrecord

cd $FPN_ROOT/tools    
python $FPN_ROOT/tools/test.py  

eval(Not recommended, Please refer here)

cd $FPN_ROOT/tools   
python ship_eval.py

Summary

tensorboard --logdir=$FPN_ROOT/output/res101_summary/

01 02 03

Graph

04

Test results

airplane

11
12

sar_ship

13
14

ship

15
16

Note

This code works better when detecting single targets, but not suitable for multi-target detection tasks. Recommend improved code: https://github.com/DetectionTeamUCAS/FPN_Tensorflow.