Skip to content

Commit 346184f

Browse files
author
Edward Yang
committed
successful pare backbone yolov10m step1
1 parent a41f064 commit 346184f

4 files changed

Lines changed: 446 additions & 6 deletions

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Ultralytics YOLO 🚀, AGPL-3.0 license
2+
# YOLOv10 object detection model. For Usage examples see https://docs.ultralytics.com/tasks/detect
3+
4+
# Parameters
5+
nc: 80 # number of classes
6+
scales: # model compound scaling constants, i.e. 'model=yolov10n.yaml' will call yolov10.yaml with scale 'n'
7+
# [depth, width, max_channels]
8+
m: [0.67, 0.75, 768]
9+
10+
backbone:
11+
# [from, repeats, module, args]
12+
- [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
13+
14+
- [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
15+
- [-1, 3, C2f, [128, True]] # 2-loc1
16+
17+
- [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
18+
- [-1, 6, C2f, [256, True]] # 4-loc2
19+
20+
- [-1, 1, SCDown, [512, 3, 2]] # 5-P4/16
21+
- [-1, 6, C2f, [512, True]] # 6-loc3
22+
23+
- [-1, 1, SCDown, [1024, 3, 2]] # 7-P5/32
24+
- [-1, 3, C2fCIB, [1024, True]]
25+
26+
- [-1, 1, SPPF, [1024, 5]] # 9
27+
- [-1, 1, PSA, [1024]] # 10
28+
29+
30+
n_first_layers: 11
31+
32+
b1_save: [0, 2, 4, 6, 10]
33+
b2_save: [12, 14, 19]
34+
35+
keep_input: True
36+
37+
dual_backbone:
38+
- [0, 1, CBLinear, [[64]]] # 0 # From P1/2 block 0: last layer index, 64: start/end width
39+
- [2, 1, CBLinear, [[64, 128]]] # 1 # P2/4 2 128
40+
- [4, 1, CBLinear, [[64, 128, 256]]] # 2 # P3/8 4 256
41+
- [6, 1, CBLinear, [[64, 128, 256, 512]]] # 3 # P4/16 6 512
42+
- [10, 1, CBLinear, [[64, 128, 256, 512, 1024]]] # 4. # P5/32 10 1024
43+
44+
- [input, 1, Conv, [64, 3, 2]] # 5-P1/2
45+
- [[-6, -5, -4, -3, -2, -1], 1, CBFuse, [[0, 0, 0, 0, 0]]] # 6
46+
47+
- [-1, 1, Conv, [128, 3, 2]] # 7-P2/4
48+
- [[-7, -6, -5, -4, -1], 1, CBFuse, [[1, 1, 1, 1]]] # 8
49+
- [-1, 3, C2f, [128, True]] # 9-loc1
50+
51+
- [-1, 1, Conv, [256, 3, 2]] # 10-P3/8
52+
- [[-9, -8, -7, -1], 1, CBFuse, [[2, 2, 2]]] # 11
53+
- [-1, 6, C2f, [256, True]] # 12-loc2
54+
55+
- [-1, 1, SCDown, [512, 3, 2]] # 12-P4/16
56+
- [[-11, -10, -1], 1, CBFuse, [[3, 3]]] # 13
57+
- [-1, 6, C2f, [512, True]] # 14-loc3
58+
59+
- [-1, 1, SCDown, [1024, 3, 2]] # 15-P5/32
60+
- [[-13, -1], 1, CBFuse, [[4]]] # 16
61+
- [-1, 3, C2fCIB, [1024, True]]
62+
- [-1, 1, SPPF, [1024, 5]] #18
63+
- [-1, 1, PSA, [1024]] # 19-loc4
64+
65+
# YOLOv10.0n head
66+
head:
67+
- [10, 1, nn.Upsample, [None, 2, "nearest"]] # 0
68+
- [[-1, 6], 1, Concat, [1]] # cat backbone P4
69+
- [-1, 3, C2f, [512]] # 2
70+
71+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
72+
- [[-1, 4], 1, Concat, [1]] # cat backbone P3
73+
- [-1, 3, C2f, [256]] # 5 (P3/8-small)
74+
75+
- [-1, 1, Conv, [256, 3, 2]]
76+
- [[-1, -6], 1, Concat, [1]] # cat head P4
77+
- [-1, 3, C2fCIB, [512, True]] # 8 (P4/16-medium)
78+
79+
- [-1, 1, SCDown, [512, 3, 2]]
80+
- [[-1, 10], 1, Concat, [1]] # cat head P5
81+
- [-1, 3, C2fCIB, [1024, True]] # 11 (P5/32-large)
82+
83+
- [[-7, -4, -1], 1, v10Detect, [nc]] # Detect(P3, P4, P5)
84+
85+
head2:
86+
- [19, 1, nn.Upsample, [None, 2, "nearest"]] # 0
87+
- [[-1, 14], 1, Concat, [1]] # cat dual_backbone P4
88+
- [-1, 3, C2f, [512]] # 2
89+
90+
- [-1, 1, nn.Upsample, [None, 2, "nearest"]]
91+
- [[-1, 12], 1, Concat, [1]] # cat backbone P3
92+
- [-1, 3, C2f, [256]] # 5 (P3/8-small)
93+
94+
- [-1, 1, Conv, [256, 3, 2]]
95+
- [[-1, -6], 1, Concat, [1]] # cat head P4
96+
- [-1, 3, C2fCIB, [512, True]] # 8 (P4/16-medium)
97+
98+
- [-1, 1, SCDown, [512, 3, 2]]
99+
- [[-1, 19], 1, Concat, [1]] # cat head P5
100+
- [-1, 3, C2fCIB, [1024, True]] # 11 (P5/32-large)
101+
102+
- [[-7, -4, -1], 1, v10Detect, [nc]] # Detect(P3, P4, P5)

0 commit comments

Comments
 (0)