Region Proposal Network solves object detection as a regression problem from the objectness perspective. Bounding boxes are predicted by applying learned bounding box deltas to base boxes, namely anchor boxes across different positions in feature maps. Training process directly learns a mapping from raw image intensities to bounding box transformation targets.
Fast R-CNN treats general object detection as a classification problem and bounding box prediction as a regression problem. Classifying cropped region feature maps and predicting bounding box displacements together yields detection results. Cropping feature maps instead of image input accelerates computation utilizing shared convolution maps. Bounding box displacements are simultaneously learned in the training process.
Faster R-CNN utilize an alternate optimization training process between RPN and Fast R-CNN. Fast R-CNN weights are used to initiate RPN for training.
easydict, cv2, matplotlib. MXNet require numpy.python demo.py --prefix final --epoch 0 --image myimage.jpg --gpu 0. Suppose you have downloaded pretrained network and place the extracted file final-0000.params in this folder and there is an image named myimage.jpg.scipy.data folder according to Data Folder Structure. You might want to create a symbolic link to VOCdevkit folder by ln -s /path/to/your/VOCdevkit data/VOCdevkit.mxnet/tools/caffe_converter to convert it, rename to vgg16-symbol.json and vgg16-0001.params and place it in model folder. model folder will be used to place model checkpoints along the training process.python train_alternate.py after VOCdevkit is ready. A typical command would be python train_alternate.py --gpus 0. This will train the network on the VOC07 trainval. More control of training process can be found in the argparse help accessed by python train_alternate.py -h.python test.py after completing the training process. A typical command would be python test.py --has_rpn --prefix model/final --epoch 8. This will test the network on the VOC07 test. Adding a --vis will turn on visualization and -h will show help as in the training process.data folder according to Data Folder Structure. You might want to create a symbolic link to VOCdevkit folder by ln -s /path/to/your/VOCdevkit data/VOCdevkit.data folder according to Data Folder Structure.mxnet/tools/caffe_converter to convert it, rename to vgg16-symbol.json and vgg16-0001.params and place it in model folder. model folder will be used to place model checkpoints along the training process.python -m tools.train_rcnn --proposal ss to use the selective search proposal.python -m tools.test_rcnn --proposal ss.python -u train_end2end.py, please using python train_end2end.py --help to query how to setting the training paramters, such as you can setting the step of dropping lr by --factor-step.Download link to trained model Baidu Yun: http://pan.baidu.com/s/1boRhGvH (ixiw) or Dropbox: https://www.dropbox.com/s/jrr83q0ai2ckltq/final-0000.params.tar.gz?dl=0
Download link to Pascal VOC and precomputed selective search proposals
Pascal VOCdevkit http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar selective_search_data (by Ross Girshick) Download link accessible at https://github.com/rbgirshick/fast-rcnn/blob/master/data/scripts/fetch_selective_search_data.sh
Data Folder Structure (create a data folder if there is none)
VOCdevkit -- VOC + year (JPEG images and annotations) -- results (will be created by evaluation) ---- VOC + year ------ main -------- comp4_det_val_aeroplane.txt selective_search_data rpn_data (will be created by rpn) cache (will be created by imdb)
This repository used code from MXNet, Fast R-CNN, Faster R-CNN, caffe. Training data are from Pascal VOC, ImageNet. Model comes from VGG16.