交通事故检测代码
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.

68 lines
2.2KB

  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. anchors: 3
  7. # YOLOv5 backbone
  8. backbone:
  9. # [from, number, module, args]
  10. [ [ -1, 1, Focus, [ 64, 3 ] ], # 0-P1/2
  11. [ -1, 1, Conv, [ 128, 3, 2 ] ], # 1-P2/4
  12. [ -1, 3, C3, [ 128 ] ],
  13. [ -1, 1, Conv, [ 256, 3, 2 ] ], # 3-P3/8
  14. [ -1, 9, C3, [ 256 ] ],
  15. [ -1, 1, Conv, [ 512, 3, 2 ] ], # 5-P4/16
  16. [ -1, 9, C3, [ 512 ] ],
  17. [ -1, 1, Conv, [ 768, 3, 2 ] ], # 7-P5/32
  18. [ -1, 3, C3, [ 768 ] ],
  19. [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 9-P6/64
  20. [ -1, 3, C3, [ 1024 ] ],
  21. [ -1, 1, Conv, [ 1280, 3, 2 ] ], # 11-P7/128
  22. [ -1, 1, SPP, [ 1280, [ 3, 5 ] ] ],
  23. [ -1, 3, C3, [ 1280, False ] ], # 13
  24. ]
  25. # YOLOv5 head
  26. head:
  27. [ [ -1, 1, Conv, [ 1024, 1, 1 ] ],
  28. [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
  29. [ [ -1, 10 ], 1, Concat, [ 1 ] ], # cat backbone P6
  30. [ -1, 3, C3, [ 1024, False ] ], # 17
  31. [ -1, 1, Conv, [ 768, 1, 1 ] ],
  32. [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
  33. [ [ -1, 8 ], 1, Concat, [ 1 ] ], # cat backbone P5
  34. [ -1, 3, C3, [ 768, False ] ], # 21
  35. [ -1, 1, Conv, [ 512, 1, 1 ] ],
  36. [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
  37. [ [ -1, 6 ], 1, Concat, [ 1 ] ], # cat backbone P4
  38. [ -1, 3, C3, [ 512, False ] ], # 25
  39. [ -1, 1, Conv, [ 256, 1, 1 ] ],
  40. [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
  41. [ [ -1, 4 ], 1, Concat, [ 1 ] ], # cat backbone P3
  42. [ -1, 3, C3, [ 256, False ] ], # 29 (P3/8-small)
  43. [ -1, 1, Conv, [ 256, 3, 2 ] ],
  44. [ [ -1, 26 ], 1, Concat, [ 1 ] ], # cat head P4
  45. [ -1, 3, C3, [ 512, False ] ], # 32 (P4/16-medium)
  46. [ -1, 1, Conv, [ 512, 3, 2 ] ],
  47. [ [ -1, 22 ], 1, Concat, [ 1 ] ], # cat head P5
  48. [ -1, 3, C3, [ 768, False ] ], # 35 (P5/32-large)
  49. [ -1, 1, Conv, [ 768, 3, 2 ] ],
  50. [ [ -1, 18 ], 1, Concat, [ 1 ] ], # cat head P6
  51. [ -1, 3, C3, [ 1024, False ] ], # 38 (P6/64-xlarge)
  52. [ -1, 1, Conv, [ 1024, 3, 2 ] ],
  53. [ [ -1, 14 ], 1, Concat, [ 1 ] ], # cat head P7
  54. [ -1, 3, C3, [ 1280, False ] ], # 41 (P7/128-xxlarge)
  55. [ [ 29, 32, 35, 38, 41 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5, P6, P7)
  56. ]