rtcdet_config.py 15 KB

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