d2_retinanet_r50-caffe_fpn_ms-90k_coco.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. _base_ = '../common/ms-90k_coco.py'
  2. # model settings
  3. model = dict(
  4. type='Detectron2Wrapper',
  5. bgr_to_rgb=False,
  6. detector=dict(
  7. # The settings in `d2_detector` will merged into default settings
  8. # in detectron2. More details please refer to
  9. # https://github.com/facebookresearch/detectron2/blob/main/detectron2/config/defaults.py # noqa
  10. meta_architecture='RetinaNet',
  11. # If you want to finetune the detector, you can use the
  12. # checkpoint released by detectron2, for example:
  13. # weights='detectron2://COCO-Detection/retinanet_R_50_FPN_1x/190397773/model_final_bfca0b.pkl' # noqa
  14. weights='detectron2://ImageNetPretrained/MSRA/R-50.pkl',
  15. mask_on=False,
  16. pixel_mean=[103.530, 116.280, 123.675],
  17. pixel_std=[1.0, 1.0, 1.0],
  18. backbone=dict(name='build_retinanet_resnet_fpn_backbone', freeze_at=2),
  19. resnets=dict(
  20. depth=50,
  21. out_features=['res3', 'res4', 'res5'],
  22. num_groups=1,
  23. norm='FrozenBN'),
  24. fpn=dict(in_features=['res3', 'res4', 'res5'], out_channels=256),
  25. anchor_generator=dict(
  26. name='DefaultAnchorGenerator',
  27. sizes=[[x, x * 2**(1.0 / 3), x * 2**(2.0 / 3)]
  28. for x in [32, 64, 128, 256, 512]],
  29. aspect_ratios=[[0.5, 1.0, 2.0]],
  30. angles=[[-90, 0, 90]]),
  31. retinanet=dict(
  32. num_classes=80,
  33. in_features=['p3', 'p4', 'p5', 'p6', 'p7'],
  34. num_convs=4,
  35. iou_thresholds=[0.4, 0.5],
  36. iou_labels=[0, -1, 1],
  37. bbox_reg_weights=(1.0, 1.0, 1.0, 1.0),
  38. bbox_reg_loss_type='smooth_l1',
  39. smooth_l1_loss_beta=0.0,
  40. focal_loss_gamma=2.0,
  41. focal_loss_alpha=0.25,
  42. prior_prob=0.01,
  43. score_thresh_test=0.05,
  44. topk_candidates_test=1000,
  45. nms_thresh_test=0.5)))
  46. optim_wrapper = dict(optimizer=dict(lr=0.01))