TensorRT转化代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6KB

  1. # parameters
  2. nc: 80 # number of classes
  3. depth_multiple: 0.67 # model depth multiple
  4. width_multiple: 0.75 # layer channel multiple
  5. # anchors
  6. anchors:
  7. - [5,6, 8,14, 15,11] #P2/4
  8. - [10,13, 16,30, 33,23] # P3/8
  9. - [30,61, 62,45, 59,119] # P4/16
  10. # YOLOv5 backbone
  11. backbone:
  12. # [from, number, module, args]
  13. [[-1, 1, Focus, [64, 3]], # 0-P1/2
  14. [-1, 1, Conv, [128, 3, 2]], # 1-P2/4
  15. [-1, 3, C3, [128]], #160*160
  16. [-1, 1, Conv, [256, 3, 2]], # 3-P3/8
  17. [-1, 9, C3, [256]], #80*80
  18. [-1, 1, Conv, [512, 3, 2]], # 5-P4/16
  19. [-1, 9, C3, [512]], #40*40
  20. [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
  21. [-1, 1, SPP, [1024, [5, 9, 13]]],
  22. [-1, 3, C3, [1024, False]], # 9 20*20
  23. ]
  24. # YOLOv5 head
  25. head:
  26. [[-1, 1, Conv, [512, 1, 1]], #20*20
  27. [-1, 1, nn.Upsample, [None, 2, 'nearest']], #40*40
  28. [[-1, 6], 1, Concat, [1]], # cat backbone P4 40*40
  29. [-1, 3, C3, [512, False]], # 13 40*40
  30. [-1, 1, Conv, [512, 1, 1]], #40*40
  31. [-1, 1, nn.Upsample, [None, 2, 'nearest']],
  32. [[-1, 4], 1, Concat, [1]], # cat backbone P3 80*80
  33. [-1, 3, C3, [512, False]], # 17 (P3/8-small) 80*80
  34. [-1, 1, Conv, [256, 1, 1]], #18 80*80
  35. [-1, 1, nn.Upsample, [None, 2, 'nearest']], #19 160*160
  36. [[-1, 2], 1, Concat, [1]], #20 cat backbone p2 160*160
  37. [-1, 3, C3, [256, False]], #21 160*160
  38. [-1, 1, Conv, [256, 3, 2]], #22 80*80
  39. [[-1, 18], 1, Concat, [1]], #23 80*80
  40. [-1, 3, C3, [256, False]], #24 80*80
  41. [-1, 1, Conv, [512, 3, 2]], #25 40*40
  42. [[-1, 14], 1, Concat, [1]], # 26 cat head P4 40*40
  43. [-1, 3, C3, [1024, False]], # 27 (P4/16-medium) 40*40
  44. [[21, 24, 27], 1, Detect, [nc, anchors]], # Detect(p2, P3, P4)
  45. ]