yolov7_config.py 4.8 KB

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