Skip to content
No description, website, or topics provided.
Python Cuda C++ C Shell Makefile
Branch: master
Clone or download
Latest commit 36178b7 Jun 25, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
dota_kit first commit Jun 14, 2019
experiments fix some bugs Jun 25, 2019
faster_rcnn update Jun 14, 2019
fpn fix a typoe Jun 15, 2019
lib add maskApi.c Jun 14, 2019
prepare_data first commit Jun 14, 2019
.gitignore add maskApi.c Jun 14, 2019
LICENSE first commit Jun 14, 2019 fix some bugs Jun 25, 2019
ThirdPartyNotices.txt first commit Jun 14, 2019
init.bat first commit Jun 14, 2019 first commit Jun 14, 2019
requirements.txt fix some bugs Jun 25, 2019 update Jun 14, 2019 first commit Jun 14, 2019 first commit Jun 14, 2019 update Jun 14, 2019 first commit Jun 14, 2019 first commit Jun 14, 2019


This is the official repo of paper Learning RoI Transformer for Detecting Oriented Objects in Aerial Images

This code is based on deformable convolution network

We refactored the code and retrained the model. There are slight differences in the final accuracy.

mmdetection version is on the way

Requirements: Software

  1. MXNet from the offical repository.

  2. Python 2.7. We recommend using Anaconda2 as it already includes many common packages. We do not support Python 3 yet, if you want to use Python 3 you need to modify the code to make it work.

  3. Python packages might missing: cython, opencv-python >= 3.2.0, easydict. If pip is set up on your system, those packages should be able to be fetched and installed by running

    pip install -r requirements.txt
  4. For Windows users, Visual Studio 2015 is needed to compile cython module.


  1. Clone the RoI Transformer repository, and we'll call the directory that you cloned RoI Transformer as ${RoI_ROOT}
git clone
  1. For Windows users, run cmd .\init.bat. For Linux user, run sh ./ The scripts will build cython module automatically and create some folders.

  2. Install MXNet:

    Note: The MXNet's Custom Op cannot execute parallelly using multi-gpus after this PR. We strongly suggest the user rollback to version MXNet@(commit 998378a) for training (following Section 3.2 - 3.5).

    Build from source (Since there are custom c++ operators, We need to complie the MXNet from source.)

    3.1 Clone MXNet and checkout to MXNet@(commit 998378a) by

    git clone --recursive
    git checkout 998378a
    git submodule update
    # if it's the first time to checkout, just use: git submodule update --init --recursive

    3.2 Copy the c++ operators to MXNet source

    cp ${RoI_ROOT}/fpn/operator_cxx/* ${MXNET_ROOT}/src/operator/contrib

    3.3 Compile MXNet

    cd ${MXNET_ROOT}
    make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1

    3.4 Install the MXNet Python binding by

    Note: If you will actively switch between different versions of MXNet, please follow 3.5 instead of 3.4

    cd python
    sudo python install

    3.5 For advanced users, you may put your Python packge into ./external/mxnet/$(YOUR_MXNET_PACKAGE), and modify MXNET_VERSION in ./experiments/rfcn/cfgs/*.yaml to $(YOUR_MXNET_PACKAGE). Thus you can switch among different versions of MXNet quickly.

  3. Compile dota_kit

    sudo apt-get install swig
    cd ${RoI_ROOT}/dota_kit
    swig -c++ -python polyiou.i
    python build_ext --inplace
    cd ${RoI_ROOT}/dota_kit/poly_nms_gpu
    make -j16

Prepare DOTA Data:

  1. Prepare script put your original dota data (before split) in path_to_data make sure it looks like

    cd ${RoI_ROOT}/prepare_data
    python --data_path path_to_data --num_process 32
  2. Create soft link

    cd ${RoI_ROOT}
    mkdir -p data
    cd data
    ln -s path_to_data dota_1024

Pretrained Models

We provide trained convnet models.

  1. To use the demo with our pre-trained RoI Transformer models for DOTA, please download manually from Google Drive, or BaiduYun (Extraction code: fucc) and put it under the following folder. Make sure it look like this:

Training & Testing

cd ${RoI_ROOT}
  1. training Please download ImageNet-pretrained ResNet-v1-101 model manually from OneDrive, or BaiduYun, or Google drive, and put it under folder ./model. Make sure it look like this:


    Start training (we use the Light-head R-CNN + RoI Transformer (without FPN) for example, you may choose other models)

  2. testing

    Start testing


© Microsoft, 2017. Licensed under an MIT license.

If you find RoI Transformer and DOTA data useful in your research, please consider citing:

  title={Learning RoI Transformer for Oriented Object Detection in Aerial Images},
  author={Ding, Jian and Xue, Nan and Long, Yang and Xia, Gui-Song and Lu, Qikai},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  title={DOTA: A large-scale dataset for object detection in aerial images},
  author={Xia, Gui-Song and Bai, Xiang and Ding, Jian and Zhu, Zhen and Belongie, Serge and Luo, Jiebo and Datcu, Mihai and Pelillo, Marcello and Zhang, Liangpei},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
You can’t perform that action at this time.