yolov8-ghost.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
  2. # Ultralytics YOLOv8 object detection model with P3/8 - P5/32 outputs
  3. # Model docs: https://docs.ultralytics.com/models/yolov8
  4. # Task docs: https://docs.ultralytics.com/tasks/detect
  5. # Employs Ghost convolutions and modules proposed in Huawei's GhostNet in https://arxiv.org/abs/1911.11907v2
  6. # Parameters
  7. nc: 80 # number of classes
  8. scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
  9. # [depth, width, max_channels]
  10. n: [0.33, 0.25, 1024] # YOLOv8n-ghost summary: 403 layers, 1865316 parameters, 1865300 gradients, 5.8 GFLOPs
  11. s: [0.33, 0.50, 1024] # YOLOv8s-ghost summary: 403 layers, 5960072 parameters, 5960056 gradients, 16.4 GFLOPs
  12. m: [0.67, 0.75, 768] # YOLOv8m-ghost summary: 603 layers, 10336312 parameters, 10336296 gradients, 32.7 GFLOPs
  13. l: [1.00, 1.00, 512] # YOLOv8l-ghost summary: 803 layers, 14277872 parameters, 14277856 gradients, 53.7 GFLOPs
  14. x: [1.00, 1.25, 512] # YOLOv8x-ghost summary: 803 layers, 22229308 parameters, 22229292 gradients, 83.3 GFLOPs
  15. # YOLOv8.0n-ghost backbone
  16. backbone:
  17. # [from, repeats, module, args]
  18. - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
  19. - [-1, 1, GhostConv, [128, 3, 2]] # 1-P2/4
  20. - [-1, 3, C3Ghost, [128, True]]
  21. - [-1, 1, GhostConv, [256, 3, 2]] # 3-P3/8
  22. - [-1, 6, C3Ghost, [256, True]]
  23. - [-1, 1, GhostConv, [512, 3, 2]] # 5-P4/16
  24. - [-1, 6, C3Ghost, [512, True]]
  25. - [-1, 1, GhostConv, [1024, 3, 2]] # 7-P5/32
  26. - [-1, 3, C3Ghost, [1024, True]]
  27. - [-1, 1, SPPF, [1024, 5]] # 9
  28. # YOLOv8.0n head
  29. head:
  30. - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
  31. - [[-1, 6], 1, Concat, [1]] # cat backbone P4
  32. - [-1, 3, C3Ghost, [512]] # 12
  33. - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
  34. - [[-1, 4], 1, Concat, [1]] # cat backbone P3
  35. - [-1, 3, C3Ghost, [256]] # 15 (P3/8-small)
  36. - [-1, 1, GhostConv, [256, 3, 2]]
  37. - [[-1, 12], 1, Concat, [1]] # cat head P4
  38. - [-1, 3, C3Ghost, [512]] # 18 (P4/16-medium)
  39. - [-1, 1, GhostConv, [512, 3, 2]]
  40. - [[-1, 9], 1, Concat, [1]] # cat head P5
  41. - [-1, 3, C3Ghost, [1024]] # 21 (P5/32-large)
  42. - [[15, 18, 21], 1, Detect, [nc]] # Detect(P3, P4, P5)