Home

Awesome

R<sup>3</sup>Det: Refined Single-Stage Detector with Feature Refinement for Rotating Object

License arXiv

News

2022.02.18 MMRotate: OpenMMLab Rotated Object Detection Benchmark was released!

Installation

# install mmdetection first if you haven't installed it yet. (Refer to mmdetection for details.)
pip install mmdet==2.19.0

# install r3det (Compiling rotated ops is a little time-consuming.)
pip install -r requirements.txt
pip install -v -e .

Quick Start

Please change path in configs to your data path.

# train
CUDA_VISIBLE_DEVICES=0 PORT=29500 \
./tools/dist_train.sh configs/rretinanet/rretinanet_obb_r50_fpn_1x_dota_v3.py 1

# submission
CUDA_VISIBLE_DEVICES=0 PORT=29500 \
./tools/dist_test.sh configs/rretinanet/rretinanet_obb_r50_fpn_1x_dota_v3.py \
        work_dirs/rretinanet_obb_r50_fpn_1x_dota_v3/epoch_12.pth 1 --format-only\
        --eval-options submission_dir=work_dirs/rretinanet_obb_r50_fpn_1x_dota_v3/Task1_results

For DOTA dataset, please crop the original images into 1024×1024 patches with an overlap of 200 by run

python tools/split/img_split.py --base_json \
       tools/split/split_configs/dota1_0/ss_trainval.json

python tools/split/img_split.py --base_json \
       tools/split/split_configs/dota1_0/ss_test.json

Please change path in ss_trainval.json, ss_test.json to your path. (Forked from BboxToolkit, which is faster then DOTA_Devkit.)

Angle Representations

Three angle representations are built-in, which can freely switch in the config.

The differences of the three angle representations are reflected in poly2obb, obb2poly, obb2xyxy, obb2hbb, hbb2obb, etc. [More], And according to the above three papers, the coders of them are different.

We believe that different coders are the key reason for the different baselines in different papers. The good news is that all the above coders can be freely switched in R3Det. In addition, R3Det also provide 4 NMS ops and 3 IoU_Calculators for rotation detection as follows:

<!-- **Note: After switching the `angle_version` on the first line of the configuration file, please confirm whether the above mentioned `nms.type` and `iou_calculator` are consistent with the angle representation.** -->

Performance

<summary>DOTA1.0 (Task1)</summary>
ModelBackboneLr schdMSRRAnglebox APOfficialDownload
RRetinaNet HBBR50-FPN1x--v165.1965.73Baidu:0518/Google
RRetinaNet OBBR50-FPN1x--v368.2069.40Baidu:0518/Google
RRetinaNet OBBR50-FPN1x--v268.6468.40Baidu:0518/Google
R<sup>3</sup>DetR50-FPN1x--v170.4170.66Baidu:0518/Google
R<sup>3</sup>Det*R50-FPN1x--v170.86-Baidu:0518/Google

Citation

@inproceedings{yang2021r3det,
    title={R3Det: Refined Single-Stage Detector with Feature Refinement for Rotating Object},
    author={Yang, Xue and Yan, Junchi and Feng, Ziming and He, Tao},
    booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
    volume={35},
    number={4},
    pages={3163--3171},
    year={2021}
}