faster-rcnn_r50_fpn_fcos-rpn_1x_coco.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. _base_ = [
  2. '../_base_/models/faster-rcnn_r50_fpn.py',
  3. '../_base_/datasets/coco_detection.py',
  4. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  5. ]
  6. model = dict(
  7. # copied from configs/fcos/fcos_r50-caffe_fpn_gn-head_1x_coco.py
  8. neck=dict(
  9. start_level=1,
  10. add_extra_convs='on_output', # use P5
  11. relu_before_extra_convs=True),
  12. rpn_head=dict(
  13. _delete_=True, # ignore the unused old settings
  14. type='FCOSHead',
  15. # num_classes = 1 for rpn,
  16. # if num_classes > 1, it will be set to 1 in
  17. # TwoStageDetector automatically
  18. num_classes=1,
  19. in_channels=256,
  20. stacked_convs=4,
  21. feat_channels=256,
  22. strides=[8, 16, 32, 64, 128],
  23. loss_cls=dict(
  24. type='FocalLoss',
  25. use_sigmoid=True,
  26. gamma=2.0,
  27. alpha=0.25,
  28. loss_weight=1.0),
  29. loss_bbox=dict(type='IoULoss', loss_weight=1.0),
  30. loss_centerness=dict(
  31. type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
  32. roi_head=dict( # update featmap_strides
  33. bbox_roi_extractor=dict(featmap_strides=[8, 16, 32, 64, 128])))
  34. # learning rate
  35. param_scheduler = [
  36. dict(
  37. type='LinearLR', start_factor=0.001, by_epoch=False, begin=0,
  38. end=1000), # Slowly increase lr, otherwise loss becomes NAN
  39. dict(
  40. type='MultiStepLR',
  41. begin=0,
  42. end=12,
  43. by_epoch=True,
  44. milestones=[8, 11],
  45. gamma=0.1)
  46. ]