Need help with RoITransformer_DOTA?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

138 Stars 31 Forks MIT License 21 Commits 18 Opened issues

Services available


Need anything else?

Contributors list

# 134,362
21 commits


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 finished, it is more faster and accurate, we recommend you to use the new version.

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

    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 [email protected](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 [email protected](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 ${RoIROOT}/fpn/operatorcxx/* ${MXNETROOT}/src/operator/contrib

    3.3 Compile MXNet
    cd ${MXNETROOT} make -j $(nproc) USEOPENCV=1 USEBLAS=openblas USECUDA=1 USECUDAPATH=/usr/local/cuda USECUDNN=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
    , and modify
    . 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 pathtodata make sure it looks like ``` pathtodata/train/images, pathtodata/train/labelTxt, pathtodata/val/images, pathtodata/val/labelTxt, pathtodata/test/images

cd ${RoIROOT}/preparedata python --datapath pathtodata --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

    . 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},

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.