Home

Awesome

Build Status GitHub license Code Coverage PyPI

| Installation | Documentation | Tutorials |

Cascade R-CNN

forked from gluon-cv

edited by Yuerong Chen and Ning Li

Benchmarking

  1. PASCAL VOC 2007 (Train/Test: 2007+2012trainval/2007test, shorter size: 600)
model#GPUsbslrwdepochdecayAP50AP75APAP Reference
VGG-RPN-baseline(pruned)21  1e-35e-4201475waitwait42.9
VGG-RPN-cascade(pruned)21  1e-35e-4201476.2057.7953.0551.2
RESNET50-RPN-cascade81  4e-35e-4201479.7160.00waitNone
Res50-RFCN-Cascade812e-31e-4201476.8755.8050.9551.8
Res101-RFCN-Cascade812e-31e-4201479.1259.4554.7954.2
  1. MS-COCO (Train/Test: train2017/val2017, shorter size: 800 for FPN and 600 for the others)
model#GPUsbsepochdecayAPAP Reference
Res101-RFCN-Cascade    81  241634.433.3

Developing Environment

MXNet 1.3.0

The repo is based on the 1.3.x version MXNet. You will probably need to go to the MXNet official github repo and compile it.

If your MXNet installed by using pip install(at least on August). It should be of MXNet version 1.2.x, which is too old for this repo. You might need to solve the related problems because of the version mismatch.

Installation

  1. Clone the cascade_rcnn_gluon repository, and we'll call the directory that you cloned cascade_rcnn_gluon into CASCADE_ROOT

    git clone https://github.com/zzdang/cascade_rcnn_gluon.git
    
  2. Build cascade_rcnn_gluon

    cd $CASCADE_ROOT/
    # Follow the gluon-cv installation instructions here:
    #   https://gluon-cv.mxnet.io/
    python setup.py install
    

Training Cascade-RCNN

  1. Get the training data

    # This will download the pascal_voc dataset
    python scripts/datasets/pascal_voc.py
    
  2. Download the pretrained models on ImageNet. For VGG-Net(we called vgg16_pruned), the FC layers are pruned and 2048 units per FC layer are remained. In addition, the two FC layers are copied three times for Cascade R-CNN training.

    # Download pre-trained model(You can download it use dropbox or baiduyun link)
    -[dropbox link](https://www.dropbox.com/s/tjgcwqgber2tlxh/VGG_16_fc2048_prune.params?dl=0)
    -[baiduyun link](https://pan.baidu.com/s/1RgG33zy40ssdWHdhPx0-Kg) passwd: b7ev  
    
    # copy the pre-trained models to $CASCADE_ROOT/models/
    cp /PATH/TO/DOWNLOAD/MODEL $CASCADE_ROOT/models/
    
    # convert the vgg16_pruned pretained params to vgg 16_pruned_cascade params
    python load_params.py
    
  3. training for Cascade-RCNN

    # training for pruned VGG16 
    python scripts/detection/cascade_rcnn/train_cascade_rcnn.py --network vgg16_pruned
    
  4. Testing Demo

    # testing for pruned VGG16 (VOC dataset)
    python scripts/detection/cascade_rcnn/demo_cascade_rcnn.py --network cascade_rcnn_vgg16_pruned_voc --pretrained /PATH/TO/TRAINED/MODEL
    

Training Cascade-RFCN

  1. training for Cascade-RFCN

    # training for resnet101_v1b
    python scripts/detection/cascade_rcnn/train_cascade_rfcn.py --network resnet101_v1b --lr 0.002 --wd 0.0001 --save-prefix ./models/ --gpus 0
    

Examples

To Do List