retinanet_swin-t-p4-w7_fpn_1x_coco.py 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. _base_ = [
  2. '../_base_/models/retinanet_r50_fpn.py',
  3. '../_base_/datasets/coco_detection.py',
  4. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  5. ]
  6. pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth' # noqa
  7. model = dict(
  8. backbone=dict(
  9. _delete_=True,
  10. type='SwinTransformer',
  11. embed_dims=96,
  12. depths=[2, 2, 6, 2],
  13. num_heads=[3, 6, 12, 24],
  14. window_size=7,
  15. mlp_ratio=4,
  16. qkv_bias=True,
  17. qk_scale=None,
  18. drop_rate=0.,
  19. attn_drop_rate=0.,
  20. drop_path_rate=0.2,
  21. patch_norm=True,
  22. out_indices=(1, 2, 3),
  23. # Please only add indices that would be used
  24. # in FPN, otherwise some parameter will not be used
  25. with_cp=False,
  26. convert_weights=True,
  27. init_cfg=dict(type='Pretrained', checkpoint=pretrained)),
  28. neck=dict(in_channels=[192, 384, 768], start_level=0, num_outs=5))
  29. # optimizer
  30. optim_wrapper = dict(optimizer=dict(lr=0.01))