yolov4_config.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # YOLOv4 Config
  2. yolov4_cfg = {
  3. 'yolov4':{
  4. # ---------------- Model config ----------------
  5. ## Backbone
  6. 'backbone': 'cspdarknet53',
  7. 'pretrained': True,
  8. 'stride': [8, 16, 32], # P3, P4, P5
  9. 'width': 1.0,
  10. 'depth': 1.0,
  11. 'max_stride': 32,
  12. ## Neck
  13. 'neck': 'csp_sppf',
  14. 'expand_ratio': 0.5,
  15. 'pooling_size': 5,
  16. 'neck_act': 'silu',
  17. 'neck_norm': 'BN',
  18. 'neck_depthwise': False,
  19. ## FPN
  20. 'fpn': 'yolov4_pafpn',
  21. 'fpn_act': 'silu',
  22. 'fpn_norm': 'BN',
  23. 'fpn_depthwise': False,
  24. ## Head
  25. 'head': 'decoupled_head',
  26. 'head_act': 'silu',
  27. 'head_norm': 'BN',
  28. 'num_cls_head': 2,
  29. 'num_reg_head': 2,
  30. 'head_depthwise': False,
  31. 'anchor_size': [[10, 13], [16, 30], [33, 23], # P3
  32. [30, 61], [62, 45], [59, 119], # P4
  33. [116, 90], [156, 198], [373, 326]], # P5
  34. # ---------------- Train config ----------------
  35. ## input
  36. 'trans_type': 'yolov5_l',
  37. 'multi_scale': [0.5, 1.25], # 320 -> 800
  38. # ---------------- Assignment config ----------------
  39. ## matcher
  40. 'iou_thresh': 0.5,
  41. # ---------------- Loss config ----------------
  42. ## loss weight
  43. 'loss_obj_weight': 1.0,
  44. 'loss_cls_weight': 1.0,
  45. 'loss_box_weight': 5.0,
  46. # ---------------- Train config ----------------
  47. 'trainer_type': 'rtcdet',
  48. },
  49. 'yolov4_tiny':{
  50. # ---------------- Model config ----------------
  51. ## Backbone
  52. 'backbone': 'cspdarknet_tiny',
  53. 'pretrained': True,
  54. 'stride': [8, 16, 32], # P3, P4, P5
  55. 'width': 0.25,
  56. 'depth': 0.34,
  57. 'max_stride': 32,
  58. ## Neck
  59. 'neck': 'csp_sppf',
  60. 'expand_ratio': 0.5,
  61. 'pooling_size': 5,
  62. 'neck_act': 'silu',
  63. 'neck_norm': 'BN',
  64. 'neck_depthwise': False,
  65. ## FPN
  66. 'fpn': 'yolov4_pafpn',
  67. 'fpn_act': 'silu',
  68. 'fpn_norm': 'BN',
  69. 'fpn_depthwise': False,
  70. ## Head
  71. 'head': 'decoupled_head',
  72. 'head_act': 'silu',
  73. 'head_norm': 'BN',
  74. 'num_cls_head': 2,
  75. 'num_reg_head': 2,
  76. 'head_depthwise': False,
  77. 'anchor_size': [[10, 13], [16, 30], [33, 23], # P3
  78. [30, 61], [62, 45], [59, 119], # P4
  79. [116, 90], [156, 198], [373, 326]], # P5
  80. # ---------------- Train config ----------------
  81. ## input
  82. 'trans_type': 'yolov5_n',
  83. 'multi_scale': [0.5, 1.25], # 320 -> 800
  84. # ---------------- Assignment config ----------------
  85. ## matcher
  86. 'iou_thresh': 0.5,
  87. # ---------------- Loss config ----------------
  88. ## loss weight
  89. 'loss_obj_weight': 1.0,
  90. 'loss_cls_weight': 1.0,
  91. 'loss_box_weight': 5.0,
  92. # ---------------- Train config ----------------
  93. 'trainer_type': 'rtcdet',
  94. },
  95. }