Giter VIP home page Giter VIP logo

fpn_faster_rcnn's Introduction

Feature Pyramid Network

This tensorflow implementation code is based on Feature Pyramid Networks for Object Detection. **Some code learn from https://github.com/matterport/Mask_RCNN.

Update

  1. Streamlining structure and removing redundant parts
  2. Making the code more clear
  3. Replacing some API by new one
  4. Adding the compute time graph by set the COMPUTE_TIME in config with True

compute_time

FEATURES:

  • Training >=2 image in a GPU
  • Training uses Multi-gpu for data parallelism and no significant decrease in performance
  • Add ResNet-v2 pretrained model
  • The code has been tested and compared to this implementation, it has better performance
  • Great debug tools and visualization to see result of intermediate process in the tensorboard
  • Using tf.Dataset and tf.estimator which has better computational efficiency and more concise code

Environment

  • tensorflow-1.8
  • CUDA-9.0
  • cuDNN-7.0
    The above environment has been tested.

Making dataset

for computational efficiency and coding convenient,we first convert the data into tfrecord format. We only support the transformation of COCO style data. If your data is the style of VOC, you must convert the VOC style to COCO style. One more thing you must notice is that you need to manually add the dictionary of category name and label in your data to /libs/label_dict.py. Then:

cd $FPN_Faster_RCNN/data/
python convert_data_to_tfrecord.py --DATA_dir=/cocodataset/ --annotation_dir=annotations/train.json --image_dir=images/train --save_dir=/tfrecord/ --dataset_name=coco --dataset_class=train

Generate:

save_dir

dataset_name

train.tfreocrd
test.tfrecord
val.tfrecord

Configuration and Training

this implementation has anthor feature is converted to change any params for users. I collect all params in config.py including: training params, network frame, and sample selection etc. So please change all params need to change for your training, such as: dataset dir, num_class, dataset_name, learning rate. To distinguish resnet50_v2 from resnet_v1, we named it as resnet_model. You can download the pre-trained model in there.

If you want train with multi-gpu, you just only change the GPU_GROUPS in config.py. Then:

cd tools/
python train.py

Debug and visualization

In the list, each file has a Debug signal to decide whether the corresponding summary are made in the tensorboard.

file function
tools/train.py Whether draw the rpn proposal of region which is the first 50 in the tensorboard and the final detection results.
libs/build_fast_rcnn.py Whether print out the scores and categories of proposals in fast_rcnn; summary the image of ground-true object and training proposals

Of course, you can imitate our code to print out or visualate everything for debug.

Display images recorded in tensorboard:
ground true objects: avatar proposals for training head: avatar the first 50 proposal: avatar the finial detection: avatar

Other tools

For convenience, our data analysis and the performance of the network are presented ipynb format.

  • inspect_data.ipynb:Simple analysis and understanding of datasets and data.
  • Predict.ipynb: predict the single image.
  • evaluate_network.ipynb: compute mAP and the recall of rpn and error analysis.Error analysis including three types: classifier error, missing objects, false positive. And we also show some error objects to analysis.avatar

fpn_faster_rcnn's People

Contributors

kuku-sichuan avatar adialovetrance avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.