Skip to content

Commit

Permalink
add max score config
Browse files Browse the repository at this point in the history
  • Loading branch information
triple-Mu committed Apr 17, 2024
1 parent eee0ec4 commit ca01d66
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configs/triplemu/_base_/default_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
param_scheduler=dict(type='ParamSchedulerHook'),
checkpoint=dict(
type='CheckpointHook',
interval=1,
interval=12,
max_keep_ckpts=30,
save_best='dota/mAP',
rule='greater'),
Expand Down
6 changes: 1 addition & 5 deletions configs/triplemu/_base_/dota_rr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
(138, 43, 226), (255, 128, 0)]
}


backend_args = None

train_pipeline = [
Expand Down Expand Up @@ -85,10 +84,7 @@
pipeline=val_pipeline))
test_dataloader = val_dataloader

val_evaluator = dict(
type='DOTAMetric',
iou_thrs=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95],
metric='mAP')
val_evaluator = dict(type='DOTAMetric', metric='mAP')
test_evaluator = val_evaluator

# inference on test dataset and format the output results
Expand Down
107 changes: 107 additions & 0 deletions configs/triplemu/rotated_rtmdet_l_max.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
_base_ = [
'./_base_/default_runtime.py', './_base_/schedule_3x.py',
'./_base_/dota_rr.py'
]

load_from = 'rotated_rtmdet_l-coco_pretrain-3x-dota_ms-06d248a2.pth'
resume = False

num_classes = 6
angle_version = 'le90'

base_lr = 0.00025
epochs = 300
model = dict(
type='mmdet.RTMDet',
data_preprocessor=dict(
type='mmdet.DetDataPreprocessor',
mean=[103.53, 116.28, 123.675],
std=[57.375, 57.12, 58.395],
bgr_to_rgb=False,
boxtype2tensor=False,
batch_augments=None),
backbone=dict(
type='mmdet.CSPNeXt',
arch='P5',
expand_ratio=0.5,
deepen_factor=1,
widen_factor=1,
channel_attention=True,
norm_cfg=dict(type='SyncBN'),
act_cfg=dict(type='SiLU')),
neck=dict(
type='mmdet.CSPNeXtPAFPN',
in_channels=[256, 512, 1024],
out_channels=256,
num_csp_blocks=3,
expand_ratio=0.5,
norm_cfg=dict(type='SyncBN'),
act_cfg=dict(type='SiLU')),
bbox_head=dict(
type='RotatedRTMDetSepBNHead',
num_classes=num_classes,
in_channels=256,
stacked_convs=2,
feat_channels=256,
angle_version=angle_version,
anchor_generator=dict(
type='mmdet.MlvlPointGenerator', offset=0, strides=[8, 16, 32]),
bbox_coder=dict(
type='DistanceAnglePointCoder', angle_version=angle_version),
loss_cls=dict(
type='mmdet.QualityFocalLoss',
use_sigmoid=True,
beta=2.0,
loss_weight=1.0),
loss_bbox=dict(type='RotatedIoULoss', mode='linear', loss_weight=2.0),
with_objectness=False,
exp_on_reg=True,
share_conv=True,
pred_kernel_size=1,
use_hbbox_loss=False,
scale_angle=False,
loss_angle=None,
norm_cfg=dict(type='SyncBN'),
act_cfg=dict(type='SiLU')),
train_cfg=dict(
assigner=dict(
type='mmdet.DynamicSoftLabelAssigner',
iou_calculator=dict(type='RBboxOverlaps2D'),
topk=13),
allowed_border=-1,
pos_weight=-1,
debug=False),
test_cfg=dict(
nms_pre=2000,
min_bbox_size=0,
score_thr=0.05,
nms=dict(type='nms_rotated', iou_threshold=0.1),
max_per_img=2000),
)

optim_wrapper = dict(
optimizer=dict(lr=base_lr, type='AdamW', weight_decay=0.05),
paramwise_cfg=dict(
bias_decay_mult=0, bypass_duplicate=True, norm_decay_mult=0),
type='OptimWrapper')

param_scheduler = [
dict(
begin=0, by_epoch=False, end=1000, start_factor=1e-05,
type='LinearLR'),
dict(
T_max=epochs // 2,
begin=epochs // 2,
by_epoch=True,
convert_to_iter_based=True,
end=300,
eta_min=0.05 * base_lr,
type='CosineAnnealingLR'),
]
train_cfg = dict(
max_epochs=epochs, type='EpochBasedTrainLoop', val_interval=12)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')

# batch_size = (2 GPUs) x (4 samples per GPU) = 8
train_dataloader = dict(batch_size=4, num_workers=4)

0 comments on commit ca01d66

Please sign in to comment.