|
| 1 | +_base_ = [ |
| 2 | + '../_base_/datasets/coco_detection.py', |
| 3 | + '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' |
| 4 | +] |
| 5 | +model = dict( |
| 6 | + type='TOOD', |
| 7 | + backbone=dict( |
| 8 | + type='ResNet', |
| 9 | + depth=50, |
| 10 | + num_stages=4, |
| 11 | + out_indices=(0, 1, 2, 3), |
| 12 | + frozen_stages=1, |
| 13 | + norm_cfg=dict(type='BN', requires_grad=True), |
| 14 | + norm_eval=True, |
| 15 | + style='pytorch', |
| 16 | + init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), |
| 17 | + neck=dict( |
| 18 | + type='FPN', |
| 19 | + in_channels=[256, 512, 1024, 2048], |
| 20 | + out_channels=256, |
| 21 | + start_level=1, |
| 22 | + add_extra_convs='on_output', |
| 23 | + num_outs=5), |
| 24 | + bbox_head=dict( |
| 25 | + type='TOODHead', |
| 26 | + num_classes=80, |
| 27 | + in_channels=256, |
| 28 | + stacked_convs=6, |
| 29 | + feat_channels=256, |
| 30 | + anchor_type='anchor_free', |
| 31 | + anchor_generator=dict( |
| 32 | + type='AnchorGenerator', |
| 33 | + ratios=[1.0], |
| 34 | + octave_base_scale=8, |
| 35 | + scales_per_octave=1, |
| 36 | + strides=[8, 16, 32, 64, 128]), |
| 37 | + bbox_coder=dict( |
| 38 | + type='DeltaXYWHBBoxCoder', |
| 39 | + target_means=[.0, .0, .0, .0], |
| 40 | + target_stds=[0.1, 0.1, 0.2, 0.2]), |
| 41 | + initial_loss_cls=dict( |
| 42 | + type='FocalLoss', |
| 43 | + use_sigmoid=True, |
| 44 | + activated=True, # use probability instead of logit as input |
| 45 | + gamma=2.0, |
| 46 | + alpha=0.25, |
| 47 | + loss_weight=1.0), |
| 48 | + loss_cls=dict( |
| 49 | + type='QualityFocalLoss', |
| 50 | + use_sigmoid=True, |
| 51 | + activated=True, # use probability instead of logit as input |
| 52 | + beta=2.0, |
| 53 | + loss_weight=1.0), |
| 54 | + loss_bbox=dict(type='GIoULoss', loss_weight=2.0)), |
| 55 | + train_cfg=dict( |
| 56 | + initial_epoch=4, |
| 57 | + initial_assigner=dict(type='ATSSAssigner', topk=9), |
| 58 | + assigner=dict(type='TaskAlignedAssigner', topk=13), |
| 59 | + alpha=1, |
| 60 | + beta=6, |
| 61 | + allowed_border=-1, |
| 62 | + pos_weight=-1, |
| 63 | + debug=False), |
| 64 | + test_cfg=dict( |
| 65 | + nms_pre=1000, |
| 66 | + min_bbox_size=0, |
| 67 | + score_thr=0.05, |
| 68 | + nms=dict(type='nms', iou_threshold=0.6), |
| 69 | + max_per_img=100)) |
| 70 | +# optimizer |
| 71 | +optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) |
| 72 | + |
| 73 | +# custom hooks |
| 74 | +custom_hooks = [dict(type='SetEpochInfoHook')] |
0 commit comments