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.

41 lines
1.3KB

  1. # Parameters
  2. nc: 80 # number of classes
  3. depth_multiple: 1.0 # model depth multiple
  4. width_multiple: 1.0 # layer channel multiple
  5. anchors:
  6. - [ 10,13, 16,30, 33,23 ] # P3/8
  7. - [ 30,61, 62,45, 59,119 ] # P4/16
  8. - [ 116,90, 156,198, 373,326 ] # P5/32
  9. # YOLOv5 backbone
  10. backbone:
  11. # [from, number, module, args]
  12. [ [ -1, 1, Focus, [ 64, 3 ] ], # 0-P1/2
  13. [ -1, 1, Conv, [ 128, 3, 2 ] ], # 1-P2/4
  14. [ -1, 3, Bottleneck, [ 128 ] ],
  15. [ -1, 1, Conv, [ 256, 3, 2 ] ], # 3-P3/8
  16. [ -1, 9, BottleneckCSP, [ 256 ] ],
  17. [ -1, 1, Conv, [ 512, 3, 2 ] ], # 5-P4/16
  18. [ -1, 9, BottleneckCSP, [ 512 ] ],
  19. [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 7-P5/32
  20. [ -1, 1, SPP, [ 1024, [ 5, 9, 13 ] ] ],
  21. [ -1, 6, BottleneckCSP, [ 1024 ] ], # 9
  22. ]
  23. # YOLOv5 BiFPN head
  24. head:
  25. [ [ -1, 3, BottleneckCSP, [ 1024, False ] ], # 10 (P5/32-large)
  26. [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
  27. [ [ -1, 20, 6 ], 1, Concat, [ 1 ] ], # cat P4
  28. [ -1, 1, Conv, [ 512, 1, 1 ] ],
  29. [ -1, 3, BottleneckCSP, [ 512, False ] ], # 14 (P4/16-medium)
  30. [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
  31. [ [ -1, 4 ], 1, Concat, [ 1 ] ], # cat backbone P3
  32. [ -1, 1, Conv, [ 256, 1, 1 ] ],
  33. [ -1, 3, BottleneckCSP, [ 256, False ] ], # 18 (P3/8-small)
  34. [ [ 18, 14, 10 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5)
  35. ]