rtcdet_config.py 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. # Real-time Convolution Object Detector
  2. # ------------------- Det task --------------------
  3. rtcdet_cfg = {
  4. 'rtcdet_n':{
  5. # ---------------- Model config ----------------
  6. ## Backbone
  7. 'bk_pretrained': True,
  8. 'bk_pretrained_mae': False,
  9. 'bk_act': 'silu',
  10. 'bk_norm': 'BN',
  11. 'bk_depthwise': False,
  12. 'width': 0.25,
  13. 'depth': 0.34,
  14. 'ratio': 2.0,
  15. 'stride': [8, 16, 32], # P3, P4, P5
  16. 'max_stride': 32,
  17. ## Neck: SPP
  18. 'neck': 'sppf',
  19. 'neck_expand_ratio': 0.5,
  20. 'pooling_size': 5,
  21. 'neck_act': 'silu',
  22. 'neck_norm': 'BN',
  23. 'neck_depthwise': False,
  24. ## Neck: PaFPN
  25. 'fpn': 'rtcdet_pafpn',
  26. 'fpn_act': 'silu',
  27. 'fpn_norm': 'BN',
  28. 'fpn_depthwise': False,
  29. ## Head
  30. 'det_head': {'name': 'decoupled_head',
  31. 'num_cls_head': 2,
  32. 'num_reg_head': 2,
  33. 'head_act': 'silu',
  34. 'head_norm': 'BN',
  35. 'head_depthwise': False,
  36. },
  37. 'seg_head': {'name': None,
  38. },
  39. 'pos_head': {'name': None,
  40. },
  41. # ---------------- Train config ----------------
  42. ## input
  43. 'multi_scale': [0.5, 1.25], # 320 -> 800
  44. 'trans_type': 'yolov5_n',
  45. # ---------------- Assignment config ----------------
  46. ## Matcher
  47. 'matcher': "aligned_simota",
  48. 'matcher_hpy': {'soft_center_radius': 3.0,
  49. 'topk_candidates': 13},
  50. # ---------------- Loss config ----------------
  51. ## loss weight
  52. 'loss_cls_weight': 1.0,
  53. 'loss_box_weight': 2.0,
  54. 'loss_box_aux': False,
  55. # ---------------- Train config ----------------
  56. 'trainer_type': 'rtcdet',
  57. },
  58. 'rtcdet_s':{
  59. # ---------------- Model config ----------------
  60. ## Backbone
  61. 'bk_pretrained': True,
  62. 'bk_pretrained_mae': False,
  63. 'bk_act': 'silu',
  64. 'bk_norm': 'BN',
  65. 'bk_depthwise': False,
  66. 'width': 0.50,
  67. 'depth': 0.34,
  68. 'ratio': 2.0,
  69. 'stride': [8, 16, 32], # P3, P4, P5
  70. 'max_stride': 32,
  71. ## Neck: SPP
  72. 'neck': 'sppf',
  73. 'neck_expand_ratio': 0.5,
  74. 'pooling_size': 5,
  75. 'neck_act': 'silu',
  76. 'neck_norm': 'BN',
  77. 'neck_depthwise': False,
  78. ## Neck: PaFPN
  79. 'fpn': 'rtcdet_pafpn',
  80. 'fpn_act': 'silu',
  81. 'fpn_norm': 'BN',
  82. 'fpn_depthwise': False,
  83. ## Head
  84. 'det_head': {'name': 'decoupled_head',
  85. 'num_cls_head': 2,
  86. 'num_reg_head': 2,
  87. 'head_act': 'silu',
  88. 'head_norm': 'BN',
  89. 'head_depthwise': False,
  90. },
  91. 'seg_head': {'name': None,
  92. },
  93. 'pos_head': {'name': None,
  94. },
  95. # ---------------- Train config ----------------
  96. ## input
  97. 'multi_scale': [0.5, 1.25], # 320 -> 800
  98. 'trans_type': 'yolov5_s',
  99. # ---------------- Assignment config ----------------
  100. ## matcher
  101. 'matcher': "aligned_simota",
  102. 'matcher_hpy': {'soft_center_radius': 3.0,
  103. 'topk_candidates': 13},
  104. # ---------------- Loss config ----------------
  105. ## loss weight
  106. 'loss_cls_weight': 1.0,
  107. 'loss_box_weight': 2.0,
  108. 'loss_box_aux': False,
  109. # ---------------- Train config ----------------
  110. 'trainer_type': 'rtcdet',
  111. },
  112. 'rtcdet_m':{
  113. # ---------------- Model config ----------------
  114. ## Backbone
  115. 'bk_pretrained': True,
  116. 'bk_pretrained_mae': False,
  117. 'bk_act': 'silu',
  118. 'bk_norm': 'BN',
  119. 'bk_depthwise': False,
  120. 'width': 0.75,
  121. 'depth': 0.67,
  122. 'ratio': 1.5,
  123. 'stride': [8, 16, 32], # P3, P4, P5
  124. 'max_stride': 32,
  125. ## Neck: SPP
  126. 'neck': 'sppf',
  127. 'neck_expand_ratio': 0.5,
  128. 'pooling_size': 5,
  129. 'neck_act': 'silu',
  130. 'neck_norm': 'BN',
  131. 'neck_depthwise': False,
  132. ## Neck: PaFPN
  133. 'fpn': 'rtcdet_pafpn',
  134. 'fpn_act': 'silu',
  135. 'fpn_norm': 'BN',
  136. 'fpn_depthwise': False,
  137. ## Head
  138. 'det_head': {'name': 'decoupled_head',
  139. 'num_cls_head': 2,
  140. 'num_reg_head': 2,
  141. 'head_act': 'silu',
  142. 'head_norm': 'BN',
  143. 'head_depthwise': False,
  144. },
  145. 'seg_head': {'name': None,
  146. },
  147. 'pos_head': {'name': None,
  148. },
  149. # ---------------- Train config ----------------
  150. ## input
  151. 'multi_scale': [0.5, 1.25], # 320 -> 800
  152. 'trans_type': 'yolov5_m',
  153. # ---------------- Assignment config ----------------
  154. ## matcher
  155. 'matcher': "aligned_simota",
  156. 'matcher_hpy': {'soft_center_radius': 3.0,
  157. 'topk_candidates': 13},
  158. # ---------------- Loss config ----------------
  159. ## loss weight
  160. 'loss_cls_weight': 1.0,
  161. 'loss_box_weight': 2.0,
  162. 'loss_box_aux': False,
  163. # ---------------- Train config ----------------
  164. 'trainer_type': 'rtcdet',
  165. },
  166. 'rtcdet_l':{
  167. # ---------------- Model config ----------------
  168. ## Backbone
  169. 'bk_pretrained': True,
  170. 'bk_pretrained_mae': False,
  171. 'bk_act': 'silu',
  172. 'bk_norm': 'BN',
  173. 'bk_depthwise': False,
  174. 'width': 1.0,
  175. 'depth': 1.0,
  176. 'ratio': 1.0,
  177. 'stride': [8, 16, 32], # P3, P4, P5
  178. 'max_stride': 32,
  179. ## Neck: SPP
  180. 'neck': 'sppf',
  181. 'neck_expand_ratio': 0.5,
  182. 'pooling_size': 5,
  183. 'neck_act': 'silu',
  184. 'neck_norm': 'BN',
  185. 'neck_depthwise': False,
  186. ## Neck: PaFPN
  187. 'fpn': 'rtcdet_pafpn',
  188. 'fpn_act': 'silu',
  189. 'fpn_norm': 'BN',
  190. 'fpn_depthwise': False,
  191. ## Head
  192. 'det_head': {'name': 'decoupled_head',
  193. 'num_cls_head': 2,
  194. 'num_reg_head': 2,
  195. 'head_act': 'silu',
  196. 'head_norm': 'BN',
  197. 'head_depthwise': False,
  198. },
  199. 'seg_head': {'name': None,
  200. },
  201. 'pos_head': {'name': None,
  202. },
  203. # ---------------- Train config ----------------
  204. ## input
  205. 'multi_scale': [0.5, 1.25], # 320 -> 800
  206. 'trans_type': 'yolov5_l',
  207. # ---------------- Assignment config ----------------
  208. ## matcher
  209. 'matcher': "aligned_simota",
  210. 'matcher_hpy': {'soft_center_radius': 3.0,
  211. 'topk_candidates': 13},
  212. # ---------------- Loss config ----------------
  213. ## loss weight
  214. 'loss_cls_weight': 1.0,
  215. 'loss_box_weight': 2.0,
  216. 'loss_box_aux': False,
  217. # ---------------- Train config ----------------
  218. 'trainer_type': 'rtcdet',
  219. },
  220. 'rtcdet_x':{
  221. # ---------------- Model config ----------------
  222. ## Backbone
  223. 'bk_pretrained': True,
  224. 'bk_pretrained_mae': False,
  225. 'bk_act': 'silu',
  226. 'bk_norm': 'BN',
  227. 'bk_depthwise': False,
  228. 'width': 1.25,
  229. 'depth': 1.34,
  230. 'ratio': 1.0,
  231. 'stride': [8, 16, 32], # P3, P4, P5
  232. 'max_stride': 32,
  233. ## Neck: SPP
  234. 'neck': 'sppf',
  235. 'neck_expand_ratio': 0.5,
  236. 'pooling_size': 5,
  237. 'neck_act': 'silu',
  238. 'neck_norm': 'BN',
  239. 'neck_depthwise': False,
  240. ## Neck: PaFPN
  241. 'fpn': 'rtcdet_pafpn',
  242. 'fpn_act': 'silu',
  243. 'fpn_norm': 'BN',
  244. 'fpn_depthwise': False,
  245. ## Head
  246. 'det_head': {'name': 'decoupled_head',
  247. 'num_cls_head': 2,
  248. 'num_reg_head': 2,
  249. 'head_act': 'silu',
  250. 'head_norm': 'BN',
  251. 'head_depthwise': False,
  252. },
  253. 'seg_head': {'name': None,
  254. },
  255. 'pos_head': {'name': None,
  256. },
  257. # ---------------- Train config ----------------
  258. ## input
  259. 'multi_scale': [0.5, 1.25], # 320 -> 800
  260. 'trans_type': 'yolov5_x',
  261. # ---------------- Assignment config ----------------
  262. ## matcher
  263. 'matcher': "aligned_simota",
  264. 'matcher_hpy': {'soft_center_radius': 3.0,
  265. 'topk_candidates': 13},
  266. # ---------------- Loss config ----------------
  267. ## loss weight
  268. 'loss_cls_weight': 1.0,
  269. 'loss_box_weight': 2.0,
  270. 'loss_box_aux': False,
  271. # ---------------- Train config ----------------
  272. 'trainer_type': 'rtcdet',
  273. },
  274. }
  275. # ------------------- Det + Seg task -------------------
  276. rtcdet_seg_cfg = {
  277. 'rtcdet_seg_n':{
  278. # ---------------- Model config ----------------
  279. ## Backbone
  280. 'bk_pretrained': True,
  281. 'bk_pretrained_mae': False,
  282. 'bk_act': 'silu',
  283. 'bk_norm': 'BN',
  284. 'bk_depthwise': False,
  285. 'width': 0.25,
  286. 'depth': 0.34,
  287. 'ratio': 2.0,
  288. 'stride': [8, 16, 32], # P3, P4, P5
  289. 'max_stride': 32,
  290. ## Neck: SPP
  291. 'neck': 'sppf',
  292. 'neck_expand_ratio': 0.5,
  293. 'pooling_size': 5,
  294. 'neck_act': 'silu',
  295. 'neck_norm': 'BN',
  296. 'neck_depthwise': False,
  297. ## Neck: PaFPN
  298. 'fpn': 'rtcdet_pafpn',
  299. 'fpn_act': 'silu',
  300. 'fpn_norm': 'BN',
  301. 'fpn_depthwise': False,
  302. ## Head
  303. 'det_head': {'name': 'decoupled_head',
  304. 'num_cls_head': 2,
  305. 'num_reg_head': 2,
  306. 'head_act': 'silu',
  307. 'head_norm': 'BN',
  308. 'head_depthwise': False,
  309. },
  310. 'seg_head': {'name': None,
  311. },
  312. 'pos_head': {'name': None,
  313. },
  314. # ---------------- Train config ----------------
  315. ## input
  316. 'multi_scale': [0.5, 1.25], # 320 -> 800
  317. 'trans_type': 'yolov5_n',
  318. # ---------------- Assignment config ----------------
  319. ## Matcher
  320. 'matcher': "aligned_simota",
  321. 'matcher_hpy': {'soft_center_radius': 3.0,
  322. 'topk_candidates': 13},
  323. # ---------------- Loss config ----------------
  324. ## loss weight
  325. 'loss_cls_weight': 1.0,
  326. 'loss_box_weight': 2.0,
  327. 'loss_box_aux': False,
  328. # ---------------- Train config ----------------
  329. 'trainer_type': 'rtcdet',
  330. },
  331. }
  332. # ------------------- Det + Pos task -------------------
  333. rtcdet_pos_cfg = {
  334. 'rtcdet_pos_n':{
  335. # ---------------- Model config ----------------
  336. ## Backbone
  337. 'bk_pretrained': True,
  338. 'bk_pretrained_mae': False,
  339. 'bk_act': 'silu',
  340. 'bk_norm': 'BN',
  341. 'bk_depthwise': False,
  342. 'width': 0.25,
  343. 'depth': 0.34,
  344. 'ratio': 2.0,
  345. 'stride': [8, 16, 32], # P3, P4, P5
  346. 'max_stride': 32,
  347. ## Neck: SPP
  348. 'neck': 'sppf',
  349. 'neck_expand_ratio': 0.5,
  350. 'pooling_size': 5,
  351. 'neck_act': 'silu',
  352. 'neck_norm': 'BN',
  353. 'neck_depthwise': False,
  354. ## Neck: PaFPN
  355. 'fpn': 'rtcdet_pafpn',
  356. 'fpn_act': 'silu',
  357. 'fpn_norm': 'BN',
  358. 'fpn_depthwise': False,
  359. ## Head
  360. 'det_head': {'name': 'decoupled_head',
  361. 'num_cls_head': 2,
  362. 'num_reg_head': 2,
  363. 'head_act': 'silu',
  364. 'head_norm': 'BN',
  365. 'head_depthwise': False,
  366. },
  367. 'seg_head': {'name': None,
  368. },
  369. 'pos_head': {'name': None,
  370. },
  371. # ---------------- Train config ----------------
  372. ## input
  373. 'multi_scale': [0.5, 1.25], # 320 -> 800
  374. 'trans_type': 'yolov5_n',
  375. # ---------------- Assignment config ----------------
  376. ## Matcher
  377. 'matcher': "aligned_simota",
  378. 'matcher_hpy': {'soft_center_radius': 3.0,
  379. 'topk_candidates': 13},
  380. # ---------------- Loss config ----------------
  381. ## loss weight
  382. 'loss_cls_weight': 1.0,
  383. 'loss_box_weight': 2.0,
  384. 'loss_box_aux': False,
  385. # ---------------- Train config ----------------
  386. 'trainer_type': 'rtcdet',
  387. },
  388. }
  389. # ------------------- Det + Seg + Pos task -------------------
  390. rtcdet_seg_pos_cfg = {
  391. 'rtcdet_seg_pos_n':{
  392. # ---------------- Model config ----------------
  393. ## Backbone
  394. 'bk_pretrained': True,
  395. 'bk_pretrained_mae': False,
  396. 'bk_act': 'silu',
  397. 'bk_norm': 'BN',
  398. 'bk_depthwise': False,
  399. 'width': 0.25,
  400. 'depth': 0.34,
  401. 'ratio': 2.0,
  402. 'stride': [8, 16, 32], # P3, P4, P5
  403. 'max_stride': 32,
  404. ## Neck: SPP
  405. 'neck': 'sppf',
  406. 'neck_expand_ratio': 0.5,
  407. 'pooling_size': 5,
  408. 'neck_act': 'silu',
  409. 'neck_norm': 'BN',
  410. 'neck_depthwise': False,
  411. ## Neck: PaFPN
  412. 'fpn': 'rtcdet_pafpn',
  413. 'fpn_act': 'silu',
  414. 'fpn_norm': 'BN',
  415. 'fpn_depthwise': False,
  416. ## Head
  417. 'det_head': {'name': 'decoupled_head',
  418. 'num_cls_head': 2,
  419. 'num_reg_head': 2,
  420. 'head_act': 'silu',
  421. 'head_norm': 'BN',
  422. 'head_depthwise': False,
  423. },
  424. 'seg_head': {'name': None,
  425. },
  426. 'pos_head': {'name': None,
  427. },
  428. # ---------------- Train config ----------------
  429. ## input
  430. 'multi_scale': [0.5, 1.25], # 320 -> 800
  431. 'trans_type': 'yolov5_n',
  432. # ---------------- Assignment config ----------------
  433. ## Matcher
  434. 'matcher': "aligned_simota",
  435. 'matcher_hpy': {'soft_center_radius': 3.0,
  436. 'topk_candidates': 13},
  437. # ---------------- Loss config ----------------
  438. ## loss weight
  439. 'loss_cls_weight': 1.0,
  440. 'loss_box_weight': 2.0,
  441. 'loss_box_aux': False,
  442. # ---------------- Train config ----------------
  443. 'trainer_type': 'rtcdet',
  444. },
  445. }