yolox2_config.py 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. # YOLOX2 Config
  2. yolox2_cfg = {
  3. 'yolox2_n':{
  4. # ---------------- Model config ----------------
  5. ## Backbone
  6. 'bk_act': 'silu',
  7. 'bk_norm': 'BN',
  8. 'bk_depthwise': False,
  9. 'width': 0.25,
  10. 'depth': 0.34,
  11. 'ratio': 2.0,
  12. 'stride': [8, 16, 32], # P3, P4, P5
  13. 'max_stride': 32,
  14. ## Neck: SPP
  15. 'neck': 'sppf',
  16. 'neck_expand_ratio': 0.5,
  17. 'pooling_size': 5,
  18. 'neck_act': 'silu',
  19. 'neck_norm': 'BN',
  20. 'neck_depthwise': False,
  21. ## Neck: PaFPN
  22. 'fpn': 'yolox2_pafpn',
  23. 'fpn_act': 'silu',
  24. 'fpn_norm': 'BN',
  25. 'fpn_depthwise': False,
  26. ## Head
  27. 'head': 'decoupled_head',
  28. 'head_act': 'silu',
  29. 'head_norm': 'BN',
  30. 'num_cls_head': 2,
  31. 'num_reg_head': 2,
  32. 'head_depthwise': False,
  33. # ---------------- Train config ----------------
  34. ## input
  35. 'multi_scale': [0.7, 1.25], # 448 -> 800
  36. 'trans_type': 'yolox_nano',
  37. # ---------------- Assignment config ----------------
  38. ## Matcher
  39. 'matcher': "aligned_simota",
  40. 'matcher_hpy': {'soft_center_radius': 3.0,
  41. 'topk_candidates': 13},
  42. # ---------------- Loss config ----------------
  43. ## loss weight
  44. 'loss_cls_weight': 1.0,
  45. 'loss_box_weight': 2.0,
  46. # ---------------- Train config ----------------
  47. 'trainer_type': 'rtcdet',
  48. },
  49. 'yolox2_t':{
  50. # ---------------- Model config ----------------
  51. ## Backbone
  52. 'bk_act': 'silu',
  53. 'bk_norm': 'BN',
  54. 'bk_depthwise': False,
  55. 'width': 0.375,
  56. 'depth': 0.34,
  57. 'ratio': 2.0,
  58. 'stride': [8, 16, 32], # P3, P4, P5
  59. 'max_stride': 32,
  60. ## Neck: SPP
  61. 'neck': 'sppf',
  62. 'neck_expand_ratio': 0.5,
  63. 'pooling_size': 5,
  64. 'neck_act': 'silu',
  65. 'neck_norm': 'BN',
  66. 'neck_depthwise': False,
  67. ## Neck: PaFPN
  68. 'fpn': 'yolox2_pafpn',
  69. 'fpn_act': 'silu',
  70. 'fpn_norm': 'BN',
  71. 'fpn_depthwise': False,
  72. ## Head
  73. 'head': 'decoupled_head',
  74. 'head_act': 'silu',
  75. 'head_norm': 'BN',
  76. 'num_cls_head': 2,
  77. 'num_reg_head': 2,
  78. 'head_depthwise': False,
  79. # ---------------- Train config ----------------
  80. ## input
  81. 'multi_scale': [0.7, 1.25], # 448 -> 800
  82. 'trans_type': 'yolox_nano',
  83. # ---------------- Assignment config ----------------
  84. ## Matcher
  85. 'matcher': "aligned_simota",
  86. 'matcher_hpy': {'soft_center_radius': 3.0,
  87. 'topk_candidates': 13},
  88. # ---------------- Loss config ----------------
  89. ## loss weight
  90. 'loss_cls_weight': 1.0,
  91. 'loss_box_weight': 2.0,
  92. # ---------------- Train config ----------------
  93. 'trainer_type': 'rtcdet',
  94. },
  95. 'yolox2_s':{
  96. # ---------------- Model config ----------------
  97. ## Backbone
  98. 'bk_act': 'silu',
  99. 'bk_norm': 'BN',
  100. 'bk_depthwise': False,
  101. 'width': 0.50,
  102. 'depth': 0.34,
  103. 'ratio': 2.0,
  104. 'stride': [8, 16, 32], # P3, P4, P5
  105. 'max_stride': 32,
  106. ## Neck: SPP
  107. 'neck': 'sppf',
  108. 'neck_expand_ratio': 0.5,
  109. 'pooling_size': 5,
  110. 'neck_act': 'silu',
  111. 'neck_norm': 'BN',
  112. 'neck_depthwise': False,
  113. ## Neck: PaFPN
  114. 'fpn': 'yolox2_pafpn',
  115. 'fpn_act': 'silu',
  116. 'fpn_norm': 'BN',
  117. 'fpn_depthwise': False,
  118. ## Head
  119. 'head': 'decoupled_head',
  120. 'head_act': 'silu',
  121. 'head_norm': 'BN',
  122. 'num_cls_head': 2,
  123. 'num_reg_head': 2,
  124. 'head_depthwise': False,
  125. # ---------------- Train config ----------------
  126. ## input
  127. 'multi_scale': [0.7, 1.25], # 448 -> 800
  128. 'trans_type': 'yolox_small',
  129. # ---------------- Assignment config ----------------
  130. ## matcher
  131. 'matcher': "aligned_simota",
  132. 'matcher_hpy': {'soft_center_radius': 3.0,
  133. 'topk_candidates': 13},
  134. # ---------------- Loss config ----------------
  135. ## loss weight
  136. 'loss_cls_weight': 1.0,
  137. 'loss_box_weight': 2.0,
  138. # ---------------- Train config ----------------
  139. 'trainer_type': 'rtcdet',
  140. },
  141. 'yolox2_m':{
  142. # ---------------- Model config ----------------
  143. ## Backbone
  144. 'bk_act': 'silu',
  145. 'bk_norm': 'BN',
  146. 'bk_depthwise': False,
  147. 'width': 0.75,
  148. 'depth': 0.67,
  149. 'ratio': 1.5,
  150. 'stride': [8, 16, 32], # P3, P4, P5
  151. 'max_stride': 32,
  152. ## Neck: SPP
  153. 'neck': 'sppf',
  154. 'neck_expand_ratio': 0.5,
  155. 'pooling_size': 5,
  156. 'neck_act': 'silu',
  157. 'neck_norm': 'BN',
  158. 'neck_depthwise': False,
  159. ## Neck: PaFPN
  160. 'fpn': 'yolox2_pafpn',
  161. 'fpn_act': 'silu',
  162. 'fpn_norm': 'BN',
  163. 'fpn_depthwise': False,
  164. ## Head
  165. 'head': 'decoupled_head',
  166. 'head_act': 'silu',
  167. 'head_norm': 'BN',
  168. 'num_cls_head': 2,
  169. 'num_reg_head': 2,
  170. 'head_depthwise': False,
  171. # ---------------- Train config ----------------
  172. ## input
  173. 'multi_scale': [0.7, 1.25], # 448 -> 800
  174. 'trans_type': 'yolox_medium',
  175. # ---------------- Assignment config ----------------
  176. ## matcher
  177. 'matcher': "aligned_simota",
  178. 'matcher_hpy': {'soft_center_radius': 3.0,
  179. 'topk_candidates': 13},
  180. # ---------------- Loss config ----------------
  181. ## loss weight
  182. 'loss_cls_weight': 1.0,
  183. 'loss_box_weight': 2.0,
  184. # ---------------- Train config ----------------
  185. 'trainer_type': 'rtcdet',
  186. },
  187. 'yolox2_l':{
  188. # ---------------- Model config ----------------
  189. ## Backbone
  190. 'bk_act': 'silu',
  191. 'bk_norm': 'BN',
  192. 'bk_depthwise': False,
  193. 'width': 1.0,
  194. 'depth': 1.0,
  195. 'ratio': 1.0,
  196. 'stride': [8, 16, 32], # P3, P4, P5
  197. 'max_stride': 32,
  198. ## Neck: SPP
  199. 'neck': 'sppf',
  200. 'neck_expand_ratio': 0.5,
  201. 'pooling_size': 5,
  202. 'neck_act': 'silu',
  203. 'neck_norm': 'BN',
  204. 'neck_depthwise': False,
  205. ## Neck: PaFPN
  206. 'fpn': 'yolox2_pafpn',
  207. 'fpn_act': 'silu',
  208. 'fpn_norm': 'BN',
  209. 'fpn_depthwise': False,
  210. ## Head
  211. 'head': 'decoupled_head',
  212. 'head_act': 'silu',
  213. 'head_norm': 'BN',
  214. 'num_cls_head': 2,
  215. 'num_reg_head': 2,
  216. 'head_depthwise': False,
  217. # ---------------- Train config ----------------
  218. ## input
  219. 'multi_scale': [0.7, 1.25], # 448 -> 800
  220. 'trans_type': 'yolox_large',
  221. # ---------------- Assignment config ----------------
  222. ## matcher
  223. 'matcher': "aligned_simota",
  224. 'matcher_hpy': {'soft_center_radius': 3.0,
  225. 'topk_candidates': 13},
  226. # ---------------- Loss config ----------------
  227. ## loss weight
  228. 'loss_cls_weight': 1.0,
  229. 'loss_box_weight': 2.0,
  230. # ---------------- Train config ----------------
  231. 'trainer_type': 'rtcdet',
  232. },
  233. 'yolox2_x':{
  234. # ---------------- Model config ----------------
  235. ## Backbone
  236. 'bk_act': 'silu',
  237. 'bk_norm': 'BN',
  238. 'bk_depthwise': False,
  239. 'width': 1.25,
  240. 'depth': 1.34,
  241. 'ratio': 1.0,
  242. 'stride': [8, 16, 32], # P3, P4, P5
  243. 'max_stride': 32,
  244. ## Neck: SPP
  245. 'neck': 'sppf',
  246. 'neck_expand_ratio': 0.5,
  247. 'pooling_size': 5,
  248. 'neck_act': 'silu',
  249. 'neck_norm': 'BN',
  250. 'neck_depthwise': False,
  251. ## Neck: PaFPN
  252. 'fpn': 'yolox2_pafpn',
  253. 'fpn_act': 'silu',
  254. 'fpn_norm': 'BN',
  255. 'fpn_depthwise': False,
  256. ## Head
  257. 'head': 'decoupled_head',
  258. 'head_act': 'silu',
  259. 'head_norm': 'BN',
  260. 'num_cls_head': 2,
  261. 'num_reg_head': 2,
  262. 'head_depthwise': False,
  263. # ---------------- Train config ----------------
  264. ## input
  265. 'multi_scale': [0.7, 1.25], # 448 -> 800
  266. 'trans_type': 'yolox_huge',
  267. # ---------------- Assignment config ----------------
  268. ## matcher
  269. 'matcher': "aligned_simota",
  270. 'matcher_hpy': {'soft_center_radius': 3.0,
  271. 'topk_candidates': 13},
  272. # ---------------- Loss config ----------------
  273. ## loss weight
  274. 'loss_cls_weight': 1.0,
  275. 'loss_box_weight': 2.0,
  276. # ---------------- Train config ----------------
  277. 'trainer_type': 'rtcdet',
  278. },
  279. }