rtcdet_config.py 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. # rtcdet Config
  2. rtcdet_cfg = {
  3. 'rtcdet_n':{
  4. # ---------------- Model config ----------------
  5. ## Backbone
  6. 'bk_pretrained': True,
  7. 'bk_act': 'silu',
  8. 'bk_norm': 'BN',
  9. 'bk_depthwise': False,
  10. 'width': 0.25,
  11. 'depth': 0.34,
  12. 'ratio': 2.0,
  13. 'stride': [8, 16, 32], # P3, P4, P5
  14. 'max_stride': 32,
  15. ## Neck: SPP
  16. 'neck': 'sppf',
  17. 'neck_expand_ratio': 0.5,
  18. 'pooling_size': 5,
  19. 'neck_act': 'silu',
  20. 'neck_norm': 'BN',
  21. 'neck_depthwise': False,
  22. ## Neck: PaFPN
  23. 'fpn': 'rtcdet_pafpn',
  24. 'fpn_act': 'silu',
  25. 'fpn_norm': 'BN',
  26. 'fpn_depthwise': False,
  27. ## Head
  28. 'num_cls_head': 2,
  29. 'num_reg_head': 2,
  30. 'head_act': 'silu',
  31. 'head_norm': 'BN',
  32. 'head_depthwise': False,
  33. # ---------------- Train config ----------------
  34. ## input
  35. 'multi_scale': [0.5, 1.25], # 320 -> 800
  36. 'trans_type': 'yolox_n',
  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. 'rtcdet_t':{
  50. # ---------------- Model config ----------------
  51. ## Backbone
  52. 'bk_pretrained': True,
  53. 'bk_act': 'silu',
  54. 'bk_norm': 'BN',
  55. 'bk_depthwise': False,
  56. 'width': 0.375,
  57. 'depth': 0.34,
  58. 'ratio': 2.0,
  59. 'stride': [8, 16, 32], # P3, P4, P5
  60. 'max_stride': 32,
  61. ## Neck: SPP
  62. 'neck': 'sppf',
  63. 'neck_expand_ratio': 0.5,
  64. 'pooling_size': 5,
  65. 'neck_act': 'silu',
  66. 'neck_norm': 'BN',
  67. 'neck_depthwise': False,
  68. ## Neck: PaFPN
  69. 'fpn': 'rtcdet_pafpn',
  70. 'fpn_act': 'silu',
  71. 'fpn_norm': 'BN',
  72. 'fpn_depthwise': False,
  73. ## 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.5, 1.25], # 320 -> 800
  82. 'trans_type': 'yolox_n',
  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. 'rtcdet_s':{
  96. # ---------------- Model config ----------------
  97. ## Backbone
  98. 'bk_pretrained': True,
  99. 'bk_act': 'silu',
  100. 'bk_norm': 'BN',
  101. 'bk_depthwise': False,
  102. 'width': 0.50,
  103. 'depth': 0.34,
  104. 'ratio': 2.0,
  105. 'stride': [8, 16, 32], # P3, P4, P5
  106. 'max_stride': 32,
  107. ## Neck: SPP
  108. 'neck': 'sppf',
  109. 'neck_expand_ratio': 0.5,
  110. 'pooling_size': 5,
  111. 'neck_act': 'silu',
  112. 'neck_norm': 'BN',
  113. 'neck_depthwise': False,
  114. ## Neck: PaFPN
  115. 'fpn': 'rtcdet_pafpn',
  116. 'fpn_act': 'silu',
  117. 'fpn_norm': 'BN',
  118. 'fpn_depthwise': False,
  119. ## 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.5, 1.25], # 320 -> 800
  128. 'trans_type': 'yolox_s',
  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. 'rtcdet_m':{
  142. # ---------------- Model config ----------------
  143. ## Backbone
  144. 'bk_pretrained': True,
  145. 'bk_act': 'silu',
  146. 'bk_norm': 'BN',
  147. 'bk_depthwise': False,
  148. 'width': 0.75,
  149. 'depth': 0.67,
  150. 'ratio': 1.5,
  151. 'stride': [8, 16, 32], # P3, P4, P5
  152. 'max_stride': 32,
  153. ## Neck: SPP
  154. 'neck': 'sppf',
  155. 'neck_expand_ratio': 0.5,
  156. 'pooling_size': 5,
  157. 'neck_act': 'silu',
  158. 'neck_norm': 'BN',
  159. 'neck_depthwise': False,
  160. ## Neck: PaFPN
  161. 'fpn': 'rtcdet_pafpn',
  162. 'fpn_act': 'silu',
  163. 'fpn_norm': 'BN',
  164. 'fpn_depthwise': False,
  165. ## 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.5, 1.25], # 320 -> 800
  174. 'trans_type': 'yolox_m',
  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. 'rtcdet_l':{
  188. # ---------------- Model config ----------------
  189. ## Backbone
  190. 'bk_pretrained': True,
  191. 'bk_act': 'silu',
  192. 'bk_norm': 'BN',
  193. 'bk_depthwise': False,
  194. 'width': 1.0,
  195. 'depth': 1.0,
  196. 'ratio': 1.0,
  197. 'stride': [8, 16, 32], # P3, P4, P5
  198. 'max_stride': 32,
  199. ## Neck: SPP
  200. 'neck': 'sppf',
  201. 'neck_expand_ratio': 0.5,
  202. 'pooling_size': 5,
  203. 'neck_act': 'silu',
  204. 'neck_norm': 'BN',
  205. 'neck_depthwise': False,
  206. ## Neck: PaFPN
  207. 'fpn': 'rtcdet_pafpn',
  208. 'fpn_act': 'silu',
  209. 'fpn_norm': 'BN',
  210. 'fpn_depthwise': False,
  211. ## 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.5, 1.25], # 320 -> 800
  220. 'trans_type': 'yolox_l',
  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. 'rtcdet_x':{
  234. # ---------------- Model config ----------------
  235. ## Backbone
  236. 'bk_pretrained': True,
  237. 'bk_act': 'silu',
  238. 'bk_norm': 'BN',
  239. 'bk_depthwise': False,
  240. 'width': 1.25,
  241. 'depth': 1.34,
  242. 'ratio': 1.0,
  243. 'stride': [8, 16, 32], # P3, P4, P5
  244. 'max_stride': 32,
  245. ## Neck: SPP
  246. 'neck': 'sppf',
  247. 'neck_expand_ratio': 0.5,
  248. 'pooling_size': 5,
  249. 'neck_act': 'silu',
  250. 'neck_norm': 'BN',
  251. 'neck_depthwise': False,
  252. ## Neck: PaFPN
  253. 'fpn': 'rtcdet_pafpn',
  254. 'fpn_act': 'silu',
  255. 'fpn_norm': 'BN',
  256. 'fpn_depthwise': False,
  257. ## 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.5, 1.25], # 320 -> 800
  266. 'trans_type': 'yolox_x',
  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. }