/pytorch_RFCN

pytorch version of rfcn

Primary LanguagePythonMIT LicenseMIT

RFCN with PyTorch

Note: This project is pytorch implementation of RFCN, Resnet101_without_dilation. This project is mainly based on faster_rcnn_pytorch, while psroi_pooling modules is copied from another pytorch version of RFCN, pytorch_RFCN

Difference Since dilation isn't used in resnet, so the space_scale is 1/32.0 in psroi_pooling, not 1/16.0 in original paper. As result, I set SCALES=800 and MAX_SIZE=1200.

Installation and demo

  1. Install the requirements (you can use pip or Anaconda):

    conda install pip pyyaml sympy h5py cython numpy scipy
    conda install -c menpo opencv3
    pip install easydict
    
  2. Clone the Faster RFCN repository

    git clone https://github.com/xingmimfl/pytorch_RFCN.git
  3. Build the Cython modules for nms and the roi_pooling layer

    cd pytorch_RFCN/faster_rcnn
    ./make.sh

Training on Pascal VOC 2007

This project use ResNet-101 model converted from Caffe, and you can get it following RuotianLuo-pytorch-ResNet.

Since the program loading the data in pytorch_RFCN/data by default, you can set the data path as following.

cd pytorch_RFCN
mkdir data
cd data
ln -s $VOCdevkit VOCdevkit2007

Then you can set some hyper-parameters in train.py and training parameters in the .yml file.

Evaluation

Set the path of the trained model in test.py.

cd pytorch_RFCN
python demo.py

image

License: MIT license (MIT)