yolov12.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # YOLOv12 🚀, AGPL-3.0 license
  2. # YOLOv12 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect
  3. # CFG file for YOLOv12-turbo
  4. # Parameters
  5. nc: 80 # number of classes
  6. scales: # model compound scaling constants, i.e. 'model=yolov12n.yaml' will call yolov12.yaml with scale 'n'
  7. # [depth, width, max_channels]
  8. n: [0.50, 0.25, 1024] # summary: 497 layers, 2,553,904 parameters, 2,553,888 gradients, 6.2 GFLOPs
  9. s: [0.50, 0.50, 1024] # summary: 497 layers, 9,127,424 parameters, 9,127,408 gradients, 19.7 GFLOPs
  10. m: [0.50, 1.00, 512] # summary: 533 layers, 19,670,784 parameters, 19,670,768 gradients, 60.4 GFLOPs
  11. l: [1.00, 1.00, 512] # summary: 895 layers, 26,506,496 parameters, 26,506,480 gradients, 83.3 GFLOPs
  12. x: [1.00, 1.50, 512] # summary: 895 layers, 59,414,176 parameters, 59,414,160 gradients, 185.9 GFLOPs
  13. # YOLO12-turbo backbone
  14. backbone:
  15. # [from, repeats, module, args]
  16. - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
  17. - [-1, 1, Conv, [128, 3, 2, 1, 2]] # 1-P2/4
  18. - [-1, 2, C3k2, [256, False, 0.25]]
  19. - [-1, 1, Conv, [256, 3, 2, 1, 4]] # 3-P3/8
  20. - [-1, 2, C3k2, [512, False, 0.25]]
  21. - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
  22. - [-1, 4, A2C2f, [512, True, 4]]
  23. - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
  24. - [-1, 4, A2C2f, [1024, True, 1]] # 8
  25. # YOLO12-turbo head
  26. head:
  27. - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
  28. - [[-1, 6], 1, Concat, [1]] # cat backbone P4
  29. - [-1, 2, A2C2f, [512, False, -1]] # 11
  30. - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
  31. - [[-1, 4], 1, Concat, [1]] # cat backbone P3
  32. - [-1, 2, A2C2f, [256, False, -1]] # 14
  33. - [-1, 1, Conv, [256, 3, 2]]
  34. - [[-1, 11], 1, Concat, [1]] # cat head P4
  35. - [-1, 2, A2C2f, [512, False, -1]] # 17
  36. - [-1, 1, Conv, [512, 3, 2]]
  37. - [[-1, 8], 1, Concat, [1]] # cat head P5
  38. - [-1, 2, C3k2, [1024, True]] # 20 (P5/32-large)
  39. - [[14, 17, 20], 1, Detect, [nc]] # Detect(P3, P4, P5)