Awesome
Learning Modulated Loss for Rotated Object Detection
Abstract
Code for AAAI 2021 paper (RSDet): Learning Modulated Loss for Rotated Object Detection. RSDet is completed by Qianwen.
Thanks for yangxue who helps me a lot. We also provide a modified version in a rotation detection benchmark, which achieve better perfirmance.
Performance
DOTA1.0
Model | Neck | Backbone | Training/test dataset | mAP | Model Link | Anchor | Angle Pred. | Reg. Loss | Angle Range | Data Augmentation | Configs |
---|---|---|---|---|---|---|---|---|---|---|---|
RetinaNet-H | FPN | ResNet50_v1d 600->800 | DOTA1.0 trainval/test | 64.17 | Baidu Drive (j5l0) | H | Reg. | smooth L1 | 180 | × | - |
RetinaNet-H | FPN | ResNet50_v1d 600->800 | DOTA1.0 trainval/test | 65.73 | Baidu Drive (jum2) | H | Reg. | smooth L1 | 90 | × | - |
RSDet | FPN | ResNet50_v1d 600->800 | DOTA1.0 trainval/test | 66.87 | Baidu Drive (6nt5) | H | Reg. | modulated loss | - | × | cfgs_res50_dota_rsdet_v2.py |
My Development Environment
docker images: docker pull yangxue2docker/yx-tf-det:tensorflow1.13.1-cuda10-gpu-py3
- python3.5 (anaconda recommend)
- cuda 10.0
- opencv(cv2)
- tfplot 0.2.0 (optional)
- tensorflow-gpu 1.13
- tqdm 4.54.0
Download Model
Pretrain weights
- Please download resnet50_v1, resnet101_v1, resnet152_v1, efficientnet, mobilenet_v2, darknet53 (Baidu Drive (1jg2), Google Drive) pre-trained models on Imagenet, put them to $PATH_ROOT/dataloader/pretrained_weights.
- (Recommend in this repo) Or you can choose to use better backbones (resnet_v1d), refer to gluon2TF.
Compile
cd $PATH_ROOT/libs/box_utils/cython_utils
python setup.py build_ext --inplace (or make)
cd $PATH_ROOT/libs/box_utils/
python setup.py build_ext --inplace
Train
1、If you want to train your own data, please note:
(1) Modify parameters (such as CLASS_NUM, DATASET_NAME, VERSION, etc.) in $PATH_ROOT/libs/configs/cfgs.py
(2) Add category information in $PATH_ROOT/libs/label_name_dict/label_dict.py
(3) Add data_name to $PATH_ROOT/data/io/read_tfrecord_multi_gpu.py
2、make tfrecord
For DOTA dataset:
cd $PATH_ROOT\data\io\DOTA
python data_crop.py
cd $PATH_ROOT/data/io/
python convert_data_to_tfrecord.py --VOC_dir='/PATH/TO/DOTA/'
--xml_dir='labeltxt'
--image_dir='images'
--save_name='train'
--img_format='.png'
--dataset='DOTA'
3、Multi-gpu train
cd $PATH_ROOT/tools
python multi_gpu_train.py
Test
cd $PATH_ROOT/tools
python test_dota.py --test_dir='/PATH/TO/IMAGES/'
--gpus=0,1,2,3,4,5,6,7
Citation
If you find our code useful for your research, please consider cite.
@article{qian2019learning,
title={Learning modulated loss for rotated object detection},
author={Qian, Wen and Yang, Xue and Peng, Silong and Guo, Yue and Yan, Chijun},
journal={arXiv preprint arXiv:1911.08299},
year={2019}
}