Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ python run_net.py --config-file=configs/base.py --task=test
| RSDet-R50-FPN | DOTA1.0|1024/200|Flip|-| SGD | 1x | 68.41 | [arxiv](https://arxiv.org/abs/1911.08299) | [config](configs/rotated_retinanet/rsdet_obb_r50_fpn_1x_dota_lmr5p.py) | [model](https://cloud.tsinghua.edu.cn/f/642e200f5a8a420eb726/?dl=1) |
| ATSS-R50-FPN|DOTA1.0|1024/200| flip|-| SGD | 1x | 72.44 | [arxiv](https://arxiv.org/abs/1912.02424) | [config](configs/rotated_retinanet/rotated_retinanet_obb_r50_fpn_1x_dota_atss.py) | [model](https://cloud.tsinghua.edu.cn/f/5168189dcd364eaebce5/?dl=1) |
| Reppoints-R50-FPN|DOTA1.0|1024/200| flip|-| SGD | 1x | 56.34 | [arxiv](https://arxiv.org/abs/1904.11490) | [config](configs/rotated_retinanet/rotated_retinanet_obb_r50_fpn_1x_dota_atss.py) | [model](https://cloud.tsinghua.edu.cn/f/be359ac932c84f9c839e/?dl=1) |
| CFA-R50-FPN|DOTA1.0|1024/200| flip|-| SGD | 1x | | [arxiv]() | [config]() | [model]() |
| Oriented-Reppoints-R50-FPN|DOTA1.0|1024/200| flip|-| SGD | 1x | | [arxiv]() | [config]() | [model]() |
| SASM-R50-FPN|DOTA1.0|1024/200| flip|-| SGD | 1x | | [arxiv]() | [config]() | [model]() |


**Notice**:
Expand Down Expand Up @@ -153,9 +156,11 @@ python run_net.py --config-file=configs/base.py --task=test
- :heavy_check_mark: Reppoints
- :heavy_check_mark: RSDet
- :heavy_check_mark: ATSS
- :heavy_check_mark: CFA
- :heavy_check_mark: Oriented Reppoints
- :heavy_check_mark: SASM
- :clock3: R3Det
- :clock3: Cascade R-CNN
- :clock3: Oriented Reppoints
- :heavy_plus_sign: DCL
- :heavy_plus_sign: Double Head OBB
- :heavy_plus_sign: Guided Anchoring
Expand Down
161 changes: 161 additions & 0 deletions configs/cfa_r50_fpn_1x_dota.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# model settings
model = dict(
type='RotatedRetinaNet',
backbone=dict(
type='Resnet50',
frozen_stages=1,
return_stages=["layer1","layer2","layer3","layer4"],
pretrained= True),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
start_level=1,
add_extra_convs="on_input",
norm_cfg = dict(type='GN', num_groups=32),
num_outs=5),
bbox_head=dict(
type='RotatedRepPointsHead',
num_classes=15,
in_channels=256,
feat_channels=256,
point_feat_channels=256,
stacked_convs=3,
num_points=9,
gradient_mul=0.3,
point_strides=[8, 16, 32, 64, 128],
point_base_scale=2,
norm_cfg = dict(type='GN', num_groups=32),
loss_cls=dict(
type='FocalLoss',
use_sigmoid=True,
gamma=2.0,
alpha=0.25,
loss_weight=1.0),
loss_bbox_init=dict(type='ConvexGIoULoss', loss_weight=0.375),
loss_bbox_refine=dict(type='ConvexGIoULoss', loss_weight=1.0),
transform_method='rotrect',
use_reassign=True,
topk=6,
anti_factor=0.75,
train_cfg=dict(
init=dict(
assigner=dict(type='ConvexAssigner', scale=4, pos_num=1, assigned_labels_filled=-1),
allowed_border=-1,
pos_weight=-1,
debug=False),
refine=dict(
assigner=dict(
type='MaxConvexIoUAssigner',
pos_iou_thr=0.1,
neg_iou_thr=0.1,
min_pos_iou=0,
ignore_iof_thr=-1,
assigned_labels_filled=-1,
iou_calculator=dict(type='ConvexOverlaps')),
allowed_border=-1,
pos_weight=-1,
debug=False)),
test_cfg=dict(
nms_pre=2000,
min_bbox_size=0,
score_thr=0.05,
nms=dict(iou_thr=0.4),
max_per_img=2000))
)
dataset = dict(
train=dict(
type="DOTADataset",
dataset_dir='/home/zytx121/mmrotate/data/processed_DOTA/trainval_1024_200_1.0',
transforms=[
dict(
type="RotatedResize",
min_size=1024,
max_size=1024
),
dict(type='RotatedRandomFlip', prob=0.5, direction="horizontal"),
dict(type='RotatedRandomFlip', prob=0.5, direction="vertical"),
dict(
type = "Pad",
size_divisor=32),
dict(
type = "Normalize",
mean = [123.675, 116.28, 103.53],
std = [58.395, 57.12, 57.375],
to_bgr=False,)

],
batch_size=1,
num_workers=4,
shuffle=True,
filter_empty_gt=False
),
val=dict(
type="DOTADataset",
dataset_dir='/home/zytx121/mmrotate/data/processed_DOTA/trainval_1024_200_1.0',
transforms=[
dict(
type="RotatedResize",
min_size=1024,
max_size=1024
),
dict(
type = "Pad",
size_divisor=32),
dict(
type = "Normalize",
mean = [123.675, 116.28, 103.53],
std = [58.395, 57.12, 57.375],
to_bgr=False),
],
batch_size=2,
num_workers=4,
shuffle=False
),
test=dict(
type="ImageDataset",
images_dir='/home/zytx121/mmrotate/data/processed_DOTA/test_1024_200_1.0/images',
transforms=[
dict(
type="RotatedResize",
min_size=1024,
max_size=1024
),
dict(
type = "Pad",
size_divisor=32),
dict(
type = "Normalize",
mean = [123.675, 116.28, 103.53],
std = [58.395, 57.12, 57.375],
to_bgr=False,),
],
num_workers=4,
batch_size=1,
)
)

optimizer = dict(
type='SGD',
lr=0.008,
momentum=0.9,
weight_decay=0.0001,
grad_clip=dict(
max_norm=35,
norm_type=2))

scheduler = dict(
type='StepLR',
warmup='linear',
warmup_iters=500,
warmup_ratio=1.0 / 3,
milestones=[7, 10])


logger = dict(
type="RunLogger")

max_epoch = 12
eval_interval = 1
checkpoint_interval = 1
log_interval = 50
155 changes: 155 additions & 0 deletions configs/sasm_obb_r50_fpn_1x_dota.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# model settings
model = dict(
type='RotatedRetinaNet',
backbone=dict(
type='Resnet50',
frozen_stages=1,
return_stages=["layer1","layer2","layer3","layer4"],
pretrained= True),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
start_level=1,
add_extra_convs="on_input",
norm_cfg = dict(type='GN', num_groups=32),
num_outs=5),
bbox_head=dict(
type='SAMRepPointsHead',
num_classes=15,
in_channels=256,
feat_channels=256,
point_feat_channels=256,
stacked_convs=3,
num_points=9,
gradient_mul=0.3,
point_strides=[8, 16, 32, 64, 128],
point_base_scale=2,
norm_cfg = dict(type='GN', num_groups=32),
loss_cls=dict(
type='FocalLoss',
use_sigmoid=True,
gamma=2.0,
alpha=0.25,
loss_weight=1.0),
loss_bbox_init=dict(type='ConvexGIoULoss', loss_weight=0.375),
loss_bbox_refine=dict(type='BCConvexGIoULoss', loss_weight=1.0),
transform_method='rotrect',
use_reassign=False,
topk=6,
anti_factor=0.75,
train_cfg=dict(
init=dict(
assigner=dict(type='ConvexAssigner', scale=4, pos_num=1, assigned_labels_filled=-1),
allowed_border=-1,
pos_weight=-1,
debug=False),
refine=dict(
assigner=dict(type='SASAssigner', topk=9),
allowed_border=-1,
pos_weight=-1,
debug=False)),
test_cfg=dict(
nms_pre=2000,
min_bbox_size=0,
score_thr=0.05,
nms=dict(iou_thr=0.4),
max_per_img=2000))
)
dataset = dict(
train=dict(
type="DOTADataset",
dataset_dir='/home/zytx121/mmrotate/data/processed_DOTA/trainval_1024_200_1.0',
transforms=[
dict(
type="RotatedResize",
min_size=1024,
max_size=1024
),
dict(type='RotatedRandomFlip', prob=0.5, direction="horizontal"),
dict(type='RotatedRandomFlip', prob=0.5, direction="vertical"),
dict(
type = "Pad",
size_divisor=32),
dict(
type = "Normalize",
mean = [123.675, 116.28, 103.53],
std = [58.395, 57.12, 57.375],
to_bgr=False,)

],
batch_size=2,
num_workers=4,
shuffle=True,
filter_empty_gt=False
),
val=dict(
type="DOTADataset",
dataset_dir='/home/zytx121/mmrotate/data/processed_DOTA/trainval_1024_200_1.0',
transforms=[
dict(
type="RotatedResize",
min_size=1024,
max_size=1024
),
dict(
type = "Pad",
size_divisor=32),
dict(
type = "Normalize",
mean = [123.675, 116.28, 103.53],
std = [58.395, 57.12, 57.375],
to_bgr=False),
],
batch_size=2,
num_workers=4,
shuffle=False
),
test=dict(
type="ImageDataset",
images_dir='/home/zytx121/mmrotate/data/processed_DOTA/test_1024_200_1.0/images',
transforms=[
dict(
type="RotatedResize",
min_size=1024,
max_size=1024
),
dict(
type = "Pad",
size_divisor=32),
dict(
type = "Normalize",
mean = [123.675, 116.28, 103.53],
std = [58.395, 57.12, 57.375],
to_bgr=False,),
],
num_workers=4,
batch_size=1,
)
)

optimizer = dict(
type='SGD',
# lr=0.01/4., #0.0,#0.01*(1/8.),
lr=0.008,
momentum=0.9,
weight_decay=0.0001,
grad_clip=dict(
max_norm=35,
norm_type=2))

scheduler = dict(
type='StepLR',
warmup='linear',
warmup_iters=500,
warmup_ratio=1.0 / 3,
milestones=[7, 10])


logger = dict(
type="RunLogger")

max_epoch = 12
eval_interval = 1
checkpoint_interval = 1
log_interval = 50
45 changes: 45 additions & 0 deletions projects/oriented_reppoints/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Oriented RepPoints
> [Oriented RepPoints for Aerial Object Detection](https://openaccess.thecvf.com/content/CVPR2022/papers/Li_Oriented_RepPoints_for_Aerial_Object_Detection_CVPR_2022_paper.pdf)

<!-- [ALGORITHM] -->
### Abstract

<div align=center>
<img src="https://raw.githubusercontent.com/zytx121/image-host/main/imgs/oriented_reppoints.png" width="800"/>
</div>

In contrast to the generic object, aerial targets are often non-axis aligned with arbitrary orientations having
the cluttered surroundings. Unlike the mainstreamed approaches regressing the bounding box orientations, this paper
proposes an effective adaptive points learning approach to aerial object detection by taking advantage of the adaptive
points representation, which is able to capture the geometric information of the arbitrary-oriented instances.
To this end, three oriented conversion functions are presented to facilitate the classification and localization
with accurate orientation. Moreover, we propose an effective quality assessment and sample assignment scheme for
adaptive points learning toward choosing the representative oriented reppoints samples during training, which is
able to capture the non-axis aligned features from adjacent objects or background noises. A spatial constraint is
introduced to penalize the outlier points for roust adaptive learning. Experimental results on four challenging
aerial datasets including DOTA, HRSC2016, UCAS-AOD and DIOR-R, demonstrate the efficacy of our proposed approach.

### Training
```sh
python run_net.py --config-file=configs/oriented_reppoints_r50_fpn_1x_dota.py --task=train
```

### Testing
```sh
python run_net.py --config-file=configs/oriented_reppoints_r50_fpn_1x_dota.py --task=test
```

### Performance
| Models | Dataset| Sub_Image_Size/Overlap |Train Aug | Test Aug | Optim | Lr schd | mAP | Paper | Config | Download |
|:-----------:| :-----: |:-----:|:-----:| :-----: | :-----:| :-----:| :----: |:--------:|:--------------------------------------------------------------:| :--------: |
| Oriented-Reppoints-R50-FPN | DOTA1.0|1024/200| flip|-| SGD | 1x | 66.99 | [paper](https://openaccess.thecvf.com/content/CVPR2022/papers/Li_Oriented_RepPoints_for_Aerial_Object_Detection_CVPR_2022_paper.pdf)| [config](configs/oriented_reppoints_r50_fpn_1x_dota.py) | [model]() |

### Citation
```
@inproceedings{li2022ori,
title={Oriented RepPoints for Aerial Object Detection},
author={Wentong Li, Yijie Chen, Kaixuan Hu, Jianke Zhu},
booktitle={Proceedings of IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2022}
}
```
Loading