Faster R-CNN in MXNet

Parallel Faster R-CNN implementation with MXNet.

Set up environment

  • Require latest MXNet. Set environment variable by export MXNET_CUDNN_AUTOTUNE_DEFAULT=0.
  • Install Python package mxnet (cpu inference only) or mxnet-cu90 (gpu training), cython then opencv-python matplotlib pycocotools tqdm.

Out-of-box inference models

Download any of the following models to the current directory and run python3 --dataset $Dataset$ --network $Network$ --params $MODEL_FILE$ --image $YOUR_IMAGE$ to get single image inference.
For example python3 --dataset voc --network vgg16 --params vgg16_voc0712.params --image myimage.jpg, add --gpu 0 to use GPU optionally.
Different network has different configuration. Different dataset has different object class names. You must pass them explicitly as command line arguments.

Network Dataset Imageset Reference Result Link
vgg16 voc 07/07 69.9 70.23 Dropbox
vgg16 voc 07++12/07 73.2 75.97 Dropbox
resnet101 voc 07++12/07 76.4 79.35 Dropbox
vgg16 coco train2017/val2017 21.2 22.8 Dropbox
resnet101 coco train2017/val2017 27.2 26.1 Dropbox

Download data and label

Make a directory data and follow py-faster-rcnn for data preparation instructions.

  • Pascal VOC should be in data/VOCdevkit containing VOC2007, VOC2012 and annotations.
  • MSCOCO should be in data/coco containing train2017, val2017 and annotations/instances_train2017.json, annotations/instances_val2017.json.

Download pretrained ImageNet models

Training and evaluation

Use python3 --dataset $Dataset$ --network $Network$ --pretrained $IMAGENET_MODEL_FILE$ --gpus $GPUS$ to train,
for example, python3 --dataset voc --network vgg16 --pretrained model/vgg16-0000.params --gpus 0,1.
Use python3 --dataset $Dataset$ --network $Network$ --params $MODEL_FILE$ --gpu $GPU$ to evaluate,
for example, python3 --dataset voc --network vgg16 --params model/vgg16-0010.params --gpu 0.