yolov7_config.py 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # YOLOv7 Config
  2. yolov7_cfg = {
  3. 'yolov7_tiny':{
  4. # ---------------- Model config ----------------
  5. ## Backbone
  6. 'backbone': 'elannet_tiny',
  7. 'pretrained': False,
  8. 'bk_act': 'silu',
  9. 'bk_norm': 'BN',
  10. 'bk_dpw': False,
  11. 'stride': [8, 16, 32], # P3, P4, P5
  12. 'max_stride': 32,
  13. ## Neck
  14. 'neck': 'csp_sppf',
  15. 'neck_act': 'silu',
  16. 'neck_norm': 'BN',
  17. 'neck_depthwise': False,
  18. 'expand_ratio': 0.5,
  19. 'pooling_size': 5,
  20. ## FPN
  21. 'fpn': 'yolov7_pafpn',
  22. 'fpn_act': 'silu',
  23. 'fpn_norm': 'BN',
  24. 'fpn_depthwise': False,
  25. 'branch_width': 2, # number of branch in ELANBlockFPN
  26. 'branch_depth': 1, # number of each branch's depth in ELANBlockFPN
  27. 'channel_width': 0.5, # width factor of channels in FPN
  28. ## Head
  29. 'head': 'decoupled_head',
  30. 'head_act': 'silu',
  31. 'head_norm': 'BN',
  32. 'num_cls_head': 2,
  33. 'num_reg_head': 2,
  34. 'head_depthwise': False,
  35. # ---------------- Data process config ----------------
  36. 'trans_type': 'yolox_s',
  37. 'multi_scale': [0.5, 1.5], # 320 -> 960
  38. # ---------------- Assignment config ----------------
  39. ## matcher
  40. 'matcher': {'center_sampling_radius': 2.5,
  41. 'topk_candicate': 10},
  42. # ---------------- Loss config ----------------
  43. ## loss weight
  44. 'loss_obj_weight': 1.0,
  45. 'loss_cls_weight': 1.0,
  46. 'loss_box_weight': 5.0,
  47. # ---------------- Train config ----------------
  48. 'trainer_type': 'yolo',
  49. },
  50. 'yolov7':{
  51. # ---------------- Model config ----------------
  52. ## Backbone
  53. 'backbone': 'elannet_large',
  54. 'pretrained': False,
  55. 'bk_act': 'silu',
  56. 'bk_norm': 'BN',
  57. 'bk_dpw': False,
  58. 'stride': [8, 16, 32], # P3, P4, P5
  59. 'max_stride': 32,
  60. # neck
  61. 'neck': 'csp_sppf',
  62. 'neck_act': 'silu',
  63. 'neck_norm': 'BN',
  64. 'neck_depthwise': False,
  65. 'expand_ratio': 0.5,
  66. 'pooling_size': 5,
  67. # fpn
  68. 'fpn': 'yolov7_pafpn',
  69. 'fpn_act': 'silu',
  70. 'fpn_norm': 'BN',
  71. 'fpn_depthwise': False,
  72. 'branch_width': 4, # number of branch in ELANBlockFPN
  73. 'branch_depth': 1, # number of each branch's depth in ELANBlockFPN
  74. 'channel_width': 1.0, # width factor of channel in FPN
  75. # head
  76. 'head': 'decoupled_head',
  77. 'head_act': 'silu',
  78. 'head_norm': 'BN',
  79. 'num_cls_head': 2,
  80. 'num_reg_head': 2,
  81. 'head_depthwise': False,
  82. # ---------------- Data process config ----------------
  83. 'trans_type': 'yolox_l',
  84. 'multi_scale': [0.5, 1.25], # 320 -> 800
  85. # ---------------- Assignment config ----------------
  86. ## matcher
  87. 'matcher': {'center_sampling_radius': 2.5,
  88. 'topk_candicate': 10},
  89. # ---------------- Loss config ----------------
  90. ## loss weight
  91. 'loss_obj_weight': 1.0,
  92. 'loss_cls_weight': 1.0,
  93. 'loss_box_weight': 5.0,
  94. # ---------------- Train config ----------------
  95. 'trainer_type': 'yolo',
  96. },
  97. 'yolov7_x':{
  98. # ---------------- Model config ----------------
  99. ## Backbone
  100. 'backbone': 'elannet_huge',
  101. 'pretrained': False,
  102. 'bk_act': 'silu',
  103. 'bk_norm': 'BN',
  104. 'bk_dpw': False,
  105. 'stride': [8, 16, 32], # P3, P4, P5
  106. 'max_stride': 32,
  107. ## Neck
  108. 'neck': 'csp_sppf',
  109. 'neck_act': 'silu',
  110. 'neck_norm': 'BN',
  111. 'neck_depthwise': False,
  112. 'expand_ratio': 0.5,
  113. 'pooling_size': 5,
  114. ## FPN
  115. 'fpn': 'yolov7_pafpn',
  116. 'fpn_act': 'silu',
  117. 'fpn_norm': 'BN',
  118. 'fpn_depthwise': False,
  119. 'branch_width': 4, # number of branch in ELANBlockFPN
  120. 'branch_depth': 2, # # number of each branch's depth in ELANBlockFPN
  121. 'channel_width': 1.25, # width factor of channel in FPN
  122. ## Head
  123. 'head': 'decoupled_head',
  124. 'head_act': 'silu',
  125. 'head_norm': 'BN',
  126. 'num_cls_head': 2,
  127. 'num_reg_head': 2,
  128. 'head_depthwise': False,
  129. # ---------------- Data process config ----------------
  130. 'trans_type': 'yolox_x',
  131. 'multi_scale': [0.5, 1.5], # 320 -> 960
  132. # ---------------- Assignment config ----------------
  133. ## matcher
  134. 'matcher': {'center_sampling_radius': 2.5,
  135. 'topk_candicate': 10},
  136. # ---------------- Loss config ----------------
  137. ## loss weight
  138. 'loss_obj_weight': 1.0,
  139. 'loss_cls_weight': 1.0,
  140. 'loss_box_weight': 5.0,
  141. # ---------------- Train config ----------------
  142. 'trainer_type': 'yolo',
  143. },
  144. }