# Ultralytics YOLO 🚀, AGPL-3.0 license
# YOLOv8-cls image classification model. For Usage examples see https://docs.ultralytics.com/tasks/classify
# epth, width, 都是系数 depth 其实是为了下边 backbone 设置的
# 大模型 depth 是 1 ,那么backbone 的 depth 是 1 那么repeats x depth,乘积 如果小于1就算1
# 如果 repeats = 6, depth = 0.33,那么 repeats x depth = 6 x 0.33 = 2
# Parameters
nc: 1000 # number of classes
scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n'
# [depth, width, max_channels]
n: [0.33, 0.25, 1024]
s: [0.33, 0.50, 1024]
m: [0.67, 0.75, 1024]
l: [1.00, 1.00, 1024]
x: [1.00, 1.25, 1024]
# YOLOv8.0n backbone
# from -1 是连接上边
# module 里 [64, 3, 2] 64是通道数 3 是卷积核大小(3X3),2 是步长(减半)
# 这里主要做特征的提取
backbone:
# [from, repeats, module, args]
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
- [-1, 3, C2f, [128, True]]
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
- [-1, 6, C2f, [256, True]]
- [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
- [-1, 6, C2f, [512, True]]
- [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
- [-1, 3, C2f, [1024, True]]
# YOLOv8.0n head
# 实现分类
head:
- [-1, 1, Classify, [nc]] # Classify