Home

Awesome

DAL

This project hosts the official implementation for our AAAI 2021 paper:

Dynamic Anchor Learning for Arbitrary-Oriented Object Detection [paper] [comments].

Abstract

In this paper, we propose a dynamic anchor learning (DAL) method, which utilizes the newly defined matching degree to comprehensively evaluate the localization potential of the anchors and carry out a more efficient label assignment process. In this way, the detector can dynamically select high-quality anchors to achieve accurate object detection, and the divergence between classification and regression will be alleviated.

Getting Started

The codes build Rotated RetinaNet with the proposed DAL method for rotation object detection. The supported datasets include: DOTA, HRSC2016, ICDAR2013, ICDAR2015, UCAS-AOD, NWPU VHR-10, VOC.

Installation

Insatll requirements:

pip install -r requirements.txt
pip install git+git://github.com/lehduong/torch-warmup-lr.git

Build the Cython and CUDA modules:

cd $ROOT/utils
sh make.sh
cd $ROOT/utils/overlaps_cuda
python setup.py build_ext --inplace

Installation for DOTA_devkit:

cd $ROOT/datasets/DOTA_devkit
sudo apt-get install swig
swig -c++ -python polyiou.i
python setup.py build_ext --inplace

Inference

You can use the following command to test a dataset. Note that weight, img_dir, dataset,hyp should be modified as appropriate.

python demo.py

Train

  1. Move the dataset to the $ROOT directory.
  2. Generate imageset files for daatset division via:
cd $ROOT/datasets
python generate_imageset.py
  1. Modify the configuration file hyp.py and arguments in train.py, then start training:
python train.py

Evaluation

Different datasets use different test methods. For UCAS-AOD/HRSC2016/VOC/NWPU VHR-10, you need to prepare labels in the appropriate format in advance. Take evaluation on HRSC2016 for example:

cd $ROOT/datasets/evaluate
python hrsc2gt.py

then you can conduct evaluation:

python eval.py

Note that :

Main Results

MethodDatasetBboxBackboneInput SizemAP/F1
DALDOTAOBBResNet-101800 x 80071.78
DALUCAS-AODOBBResNet-101800 x 80089.87
DALHRSC2016OBBResNet-50416 x 41688.60
DALICDAR2015OBBResNet-101800 x 80082.4
DALICDAR2013HBBResNet-101800 x 80081.3
DALNWPU VHR-10HBBResNet-101800 x 80088.3
DALVOC 2007HBBResNet-101800 x 80076.1

Detections

DOTA_results

Citation

If you find our work or code useful in your research, please consider citing:

@inproceedings{ming2021dynamic,
  title={Dynamic Anchor Learning for Arbitrary-Oriented Object Detection},
  author={Ming, Qi and Zhou, Zhiqiang and Miao, Lingjuan and Zhang, Hongwei and Li, Linhao},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={35},
  number={3},
  pages={2355--2363},
  year={2021}
}

If you have any questions, please contact me via issue or email.