|
_base_ = [ |
|
'./_base_/datasets/hsi_detection.py', './_base_/default_runtime.py' |
|
] |
|
|
|
|
|
norm = 'LN' |
|
num_levels = 2 |
|
in_channels = 30 |
|
embed_dims = 256 |
|
query_initial = 'one' |
|
model = dict( |
|
type='SpecDetr', |
|
num_queries = 900, |
|
num_query_per_cat= 5, |
|
num_fix_query = 0, |
|
with_box_refine=True, |
|
as_two_stage=True, |
|
num_feature_levels=num_levels, |
|
candidate_bboxes_size = 0.01, |
|
scale_gt_bboxes_size = 0, |
|
training_dn = True, |
|
|
|
dn_type = 'CDN', |
|
query_initial = query_initial, |
|
remove_last_candidate = True, |
|
data_preprocessor=dict( |
|
type='HSIDetDataPreprocessor'), |
|
backbone=dict( |
|
type='No_backbone_ST', |
|
in_channels=in_channels, |
|
embed_dims=embed_dims, |
|
|
|
|
|
num_levels=num_levels, |
|
norm_cfg=dict(type=norm), |
|
), |
|
encoder=dict( |
|
num_layers=6, |
|
layer_cfg=dict( |
|
self_attn_cfg=dict(embed_dims=embed_dims, num_levels=num_levels, num_points=4, |
|
dropout=0.0), |
|
ffn_cfg=dict( |
|
embed_dims=embed_dims, |
|
feedforward_channels=embed_dims*8, |
|
ffn_drop=0.0), |
|
norm_cfg=dict(type=norm),)), |
|
decoder=dict( |
|
num_layers=6, |
|
return_intermediate=True, |
|
layer_cfg=dict( |
|
self_attn_cfg=dict(embed_dims=embed_dims, num_heads=8, |
|
dropout=0.0), |
|
cross_attn_cfg=dict(embed_dims=embed_dims, num_levels=num_levels, num_points=4, |
|
dropout=0.0), |
|
ffn_cfg=dict( |
|
embed_dims=embed_dims, |
|
feedforward_channels=embed_dims*8, |
|
ffn_drop=0.0), |
|
norm_cfg=dict(type=norm),), |
|
post_norm_cfg=None), |
|
positional_encoding=dict( |
|
num_feats=embed_dims//2, |
|
normalize=True, |
|
offset=0.0, |
|
temperature=20), |
|
bbox_head=dict( |
|
type='SpecDetrHead', |
|
num_classes=8, |
|
sync_cls_avg_factor=True, |
|
pre_bboxes_round = False, |
|
use_nms = True, |
|
iou_threshold = 0.01, |
|
embed_dims = embed_dims, |
|
|
|
loss_cls=dict( |
|
type='FocalLoss', |
|
use_sigmoid=True, |
|
gamma=2.0, |
|
alpha=0.25, |
|
loss_weight=1.0), |
|
loss_bbox=dict(type='L1Loss', loss_weight=5.0), |
|
loss_iou=dict(type='GIoULoss', loss_weight=2.0)), |
|
dn_cfg=dict( |
|
label_noise_scale=0.5, |
|
box_noise_scale =1.5, |
|
|
|
|
|
group_cfg=dict(dynamic=True, num_groups=None, |
|
num_dn_queries=200), |
|
|
|
|
|
), |
|
|
|
train_cfg=dict( |
|
assigner=dict( |
|
type='DynamicIOUHungarianAssigner', |
|
match_costs=[ |
|
dict(type='FocalLossCost', weight=2.0), |
|
dict(type='BBoxL1Cost', weight=5.0, box_format='xywh'), |
|
dict(type='IoUCost', iou_mode='giou', weight=2.0), |
|
dict(type='IoULossCost', iou_mode='iou', weight=1.0) |
|
], |
|
match_num=10, |
|
base_match_num=1, |
|
iou_loss_th=0.05, |
|
dynamic_match=True)), |
|
|
|
test_cfg=dict(max_per_img=300)) |
|
|
|
|
|
|
|
optim_wrapper = dict( |
|
type='OptimWrapper', |
|
optimizer=dict( |
|
type='AdamW', |
|
lr=0.0001, |
|
weight_decay=0.0001), |
|
clip_grad=dict(max_norm=0.1, norm_type=2), |
|
paramwise_cfg=dict(custom_keys={'backbone': dict(lr_mult=0.1)}) |
|
) |
|
|
|
|
|
max_epochs = 100 |
|
train_cfg = dict( |
|
type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=20,) |
|
|
|
val_cfg = dict(type='ValLoop') |
|
test_cfg = dict(type='TestLoop') |
|
|
|
param_scheduler = [ |
|
dict( |
|
type='MultiStepLR', |
|
begin=0, |
|
end=max_epochs, |
|
by_epoch=True, |
|
milestones=[90], |
|
gamma=0.1) |
|
] |
|
|
|
|
|
|
|
auto_scale_lr = dict(base_batch_size=4) |