Spaces:
Build error
Build error
owaiskha9654
commited on
Commit
·
454ed76
1
Parent(s):
a89751e
Upload cfg
Browse files- cfg/baseline/r50-csp.yaml +49 -0
- cfg/baseline/x50-csp.yaml +49 -0
- cfg/baseline/yolor-csp-x.yaml +52 -0
- cfg/baseline/yolor-csp.yaml +52 -0
- cfg/baseline/yolor-d6.yaml +63 -0
- cfg/baseline/yolor-e6.yaml +63 -0
- cfg/baseline/yolor-p6.yaml +63 -0
- cfg/baseline/yolor-w6.yaml +63 -0
- cfg/baseline/yolov3-spp.yaml +51 -0
- cfg/baseline/yolov3.yaml +51 -0
- cfg/baseline/yolov4-csp.yaml +52 -0
- cfg/deploy/yolov7-d6.yaml +202 -0
- cfg/deploy/yolov7-e6.yaml +180 -0
- cfg/deploy/yolov7-e6e.yaml +301 -0
- cfg/deploy/yolov7-tiny-silu.yaml +112 -0
- cfg/deploy/yolov7-tiny.yaml +112 -0
- cfg/deploy/yolov7-w6.yaml +158 -0
- cfg/deploy/yolov7.yaml +140 -0
- cfg/deploy/yolov7x.yaml +156 -0
- cfg/training/yolov7-d6.yaml +207 -0
- cfg/training/yolov7-e6.yaml +185 -0
- cfg/training/yolov7-e6e.yaml +306 -0
- cfg/training/yolov7-tiny.yaml +112 -0
- cfg/training/yolov7-w6.yaml +163 -0
- cfg/training/yolov7.yaml +140 -0
- cfg/training/yolov7x.yaml +156 -0
cfg/baseline/r50-csp.yaml
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# CSP-ResNet backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Stem, [128]], # 0-P1/2
|
16 |
+
[-1, 3, ResCSPC, [128]],
|
17 |
+
[-1, 1, Conv, [256, 3, 2]], # 2-P3/8
|
18 |
+
[-1, 4, ResCSPC, [256]],
|
19 |
+
[-1, 1, Conv, [512, 3, 2]], # 4-P3/8
|
20 |
+
[-1, 6, ResCSPC, [512]],
|
21 |
+
[-1, 1, Conv, [1024, 3, 2]], # 6-P3/8
|
22 |
+
[-1, 3, ResCSPC, [1024]], # 7
|
23 |
+
]
|
24 |
+
|
25 |
+
# CSP-Res-PAN head
|
26 |
+
head:
|
27 |
+
[[-1, 1, SPPCSPC, [512]], # 8
|
28 |
+
[-1, 1, Conv, [256, 1, 1]],
|
29 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
30 |
+
[5, 1, Conv, [256, 1, 1]], # route backbone P4
|
31 |
+
[[-1, -2], 1, Concat, [1]],
|
32 |
+
[-1, 2, ResCSPB, [256]], # 13
|
33 |
+
[-1, 1, Conv, [128, 1, 1]],
|
34 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
35 |
+
[3, 1, Conv, [128, 1, 1]], # route backbone P3
|
36 |
+
[[-1, -2], 1, Concat, [1]],
|
37 |
+
[-1, 2, ResCSPB, [128]], # 18
|
38 |
+
[-1, 1, Conv, [256, 3, 1]],
|
39 |
+
[-2, 1, Conv, [256, 3, 2]],
|
40 |
+
[[-1, 13], 1, Concat, [1]], # cat
|
41 |
+
[-1, 2, ResCSPB, [256]], # 22
|
42 |
+
[-1, 1, Conv, [512, 3, 1]],
|
43 |
+
[-2, 1, Conv, [512, 3, 2]],
|
44 |
+
[[-1, 8], 1, Concat, [1]], # cat
|
45 |
+
[-1, 2, ResCSPB, [512]], # 26
|
46 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
47 |
+
|
48 |
+
[[19,23,27], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
49 |
+
]
|
cfg/baseline/x50-csp.yaml
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# CSP-ResNeXt backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Stem, [128]], # 0-P1/2
|
16 |
+
[-1, 3, ResXCSPC, [128]],
|
17 |
+
[-1, 1, Conv, [256, 3, 2]], # 2-P3/8
|
18 |
+
[-1, 4, ResXCSPC, [256]],
|
19 |
+
[-1, 1, Conv, [512, 3, 2]], # 4-P3/8
|
20 |
+
[-1, 6, ResXCSPC, [512]],
|
21 |
+
[-1, 1, Conv, [1024, 3, 2]], # 6-P3/8
|
22 |
+
[-1, 3, ResXCSPC, [1024]], # 7
|
23 |
+
]
|
24 |
+
|
25 |
+
# CSP-ResX-PAN head
|
26 |
+
head:
|
27 |
+
[[-1, 1, SPPCSPC, [512]], # 8
|
28 |
+
[-1, 1, Conv, [256, 1, 1]],
|
29 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
30 |
+
[5, 1, Conv, [256, 1, 1]], # route backbone P4
|
31 |
+
[[-1, -2], 1, Concat, [1]],
|
32 |
+
[-1, 2, ResXCSPB, [256]], # 13
|
33 |
+
[-1, 1, Conv, [128, 1, 1]],
|
34 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
35 |
+
[3, 1, Conv, [128, 1, 1]], # route backbone P3
|
36 |
+
[[-1, -2], 1, Concat, [1]],
|
37 |
+
[-1, 2, ResXCSPB, [128]], # 18
|
38 |
+
[-1, 1, Conv, [256, 3, 1]],
|
39 |
+
[-2, 1, Conv, [256, 3, 2]],
|
40 |
+
[[-1, 13], 1, Concat, [1]], # cat
|
41 |
+
[-1, 2, ResXCSPB, [256]], # 22
|
42 |
+
[-1, 1, Conv, [512, 3, 1]],
|
43 |
+
[-2, 1, Conv, [512, 3, 2]],
|
44 |
+
[[-1, 8], 1, Concat, [1]], # cat
|
45 |
+
[-1, 2, ResXCSPB, [512]], # 26
|
46 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
47 |
+
|
48 |
+
[[19,23,27], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
49 |
+
]
|
cfg/baseline/yolor-csp-x.yaml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# parameters
|
2 |
+
nc: 80 # number of classes
|
3 |
+
depth_multiple: 1.33 # model depth multiple
|
4 |
+
width_multiple: 1.25 # layer channel multiple
|
5 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# CSP-Darknet backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
17 |
+
[-1, 1, Bottleneck, [64]],
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
19 |
+
[-1, 2, BottleneckCSPC, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
|
21 |
+
[-1, 8, BottleneckCSPC, [256]],
|
22 |
+
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
|
23 |
+
[-1, 8, BottleneckCSPC, [512]],
|
24 |
+
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
|
25 |
+
[-1, 4, BottleneckCSPC, [1024]], # 10
|
26 |
+
]
|
27 |
+
|
28 |
+
# CSP-Dark-PAN head
|
29 |
+
head:
|
30 |
+
[[-1, 1, SPPCSPC, [512]], # 11
|
31 |
+
[-1, 1, Conv, [256, 1, 1]],
|
32 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
33 |
+
[8, 1, Conv, [256, 1, 1]], # route backbone P4
|
34 |
+
[[-1, -2], 1, Concat, [1]],
|
35 |
+
[-1, 2, BottleneckCSPB, [256]], # 16
|
36 |
+
[-1, 1, Conv, [128, 1, 1]],
|
37 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
38 |
+
[6, 1, Conv, [128, 1, 1]], # route backbone P3
|
39 |
+
[[-1, -2], 1, Concat, [1]],
|
40 |
+
[-1, 2, BottleneckCSPB, [128]], # 21
|
41 |
+
[-1, 1, Conv, [256, 3, 1]],
|
42 |
+
[-2, 1, Conv, [256, 3, 2]],
|
43 |
+
[[-1, 16], 1, Concat, [1]], # cat
|
44 |
+
[-1, 2, BottleneckCSPB, [256]], # 25
|
45 |
+
[-1, 1, Conv, [512, 3, 1]],
|
46 |
+
[-2, 1, Conv, [512, 3, 2]],
|
47 |
+
[[-1, 11], 1, Concat, [1]], # cat
|
48 |
+
[-1, 2, BottleneckCSPB, [512]], # 29
|
49 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
50 |
+
|
51 |
+
[[22,26,30], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
52 |
+
]
|
cfg/baseline/yolor-csp.yaml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# CSP-Darknet backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
17 |
+
[-1, 1, Bottleneck, [64]],
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
19 |
+
[-1, 2, BottleneckCSPC, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
|
21 |
+
[-1, 8, BottleneckCSPC, [256]],
|
22 |
+
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
|
23 |
+
[-1, 8, BottleneckCSPC, [512]],
|
24 |
+
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
|
25 |
+
[-1, 4, BottleneckCSPC, [1024]], # 10
|
26 |
+
]
|
27 |
+
|
28 |
+
# CSP-Dark-PAN head
|
29 |
+
head:
|
30 |
+
[[-1, 1, SPPCSPC, [512]], # 11
|
31 |
+
[-1, 1, Conv, [256, 1, 1]],
|
32 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
33 |
+
[8, 1, Conv, [256, 1, 1]], # route backbone P4
|
34 |
+
[[-1, -2], 1, Concat, [1]],
|
35 |
+
[-1, 2, BottleneckCSPB, [256]], # 16
|
36 |
+
[-1, 1, Conv, [128, 1, 1]],
|
37 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
38 |
+
[6, 1, Conv, [128, 1, 1]], # route backbone P3
|
39 |
+
[[-1, -2], 1, Concat, [1]],
|
40 |
+
[-1, 2, BottleneckCSPB, [128]], # 21
|
41 |
+
[-1, 1, Conv, [256, 3, 1]],
|
42 |
+
[-2, 1, Conv, [256, 3, 2]],
|
43 |
+
[[-1, 16], 1, Concat, [1]], # cat
|
44 |
+
[-1, 2, BottleneckCSPB, [256]], # 25
|
45 |
+
[-1, 1, Conv, [512, 3, 1]],
|
46 |
+
[-2, 1, Conv, [512, 3, 2]],
|
47 |
+
[[-1, 11], 1, Concat, [1]], # cat
|
48 |
+
[-1, 2, BottleneckCSPB, [512]], # 29
|
49 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
50 |
+
|
51 |
+
[[22,26,30], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
52 |
+
]
|
cfg/baseline/yolor-d6.yaml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# parameters
|
2 |
+
nc: 80 # number of classes
|
3 |
+
depth_multiple: 1.0 # expand model depth
|
4 |
+
width_multiple: 1.25 # expand layer channels
|
5 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# CSP-Darknet backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args]
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
|
18 |
+
[-1, 1, DownC, [128]], # 2-P2/4
|
19 |
+
[-1, 3, BottleneckCSPA, [128]],
|
20 |
+
[-1, 1, DownC, [256]], # 4-P3/8
|
21 |
+
[-1, 15, BottleneckCSPA, [256]],
|
22 |
+
[-1, 1, DownC, [512]], # 6-P4/16
|
23 |
+
[-1, 15, BottleneckCSPA, [512]],
|
24 |
+
[-1, 1, DownC, [768]], # 8-P5/32
|
25 |
+
[-1, 7, BottleneckCSPA, [768]],
|
26 |
+
[-1, 1, DownC, [1024]], # 10-P6/64
|
27 |
+
[-1, 7, BottleneckCSPA, [1024]], # 11
|
28 |
+
]
|
29 |
+
|
30 |
+
# CSP-Dark-PAN head
|
31 |
+
head:
|
32 |
+
[[-1, 1, SPPCSPC, [512]], # 12
|
33 |
+
[-1, 1, Conv, [384, 1, 1]],
|
34 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
35 |
+
[-6, 1, Conv, [384, 1, 1]], # route backbone P5
|
36 |
+
[[-1, -2], 1, Concat, [1]],
|
37 |
+
[-1, 3, BottleneckCSPB, [384]], # 17
|
38 |
+
[-1, 1, Conv, [256, 1, 1]],
|
39 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
40 |
+
[-13, 1, Conv, [256, 1, 1]], # route backbone P4
|
41 |
+
[[-1, -2], 1, Concat, [1]],
|
42 |
+
[-1, 3, BottleneckCSPB, [256]], # 22
|
43 |
+
[-1, 1, Conv, [128, 1, 1]],
|
44 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
45 |
+
[-20, 1, Conv, [128, 1, 1]], # route backbone P3
|
46 |
+
[[-1, -2], 1, Concat, [1]],
|
47 |
+
[-1, 3, BottleneckCSPB, [128]], # 27
|
48 |
+
[-1, 1, Conv, [256, 3, 1]],
|
49 |
+
[-2, 1, DownC, [256]],
|
50 |
+
[[-1, 22], 1, Concat, [1]], # cat
|
51 |
+
[-1, 3, BottleneckCSPB, [256]], # 31
|
52 |
+
[-1, 1, Conv, [512, 3, 1]],
|
53 |
+
[-2, 1, DownC, [384]],
|
54 |
+
[[-1, 17], 1, Concat, [1]], # cat
|
55 |
+
[-1, 3, BottleneckCSPB, [384]], # 35
|
56 |
+
[-1, 1, Conv, [768, 3, 1]],
|
57 |
+
[-2, 1, DownC, [512]],
|
58 |
+
[[-1, 12], 1, Concat, [1]], # cat
|
59 |
+
[-1, 3, BottleneckCSPB, [512]], # 39
|
60 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
61 |
+
|
62 |
+
[[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
63 |
+
]
|
cfg/baseline/yolor-e6.yaml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# parameters
|
2 |
+
nc: 80 # number of classes
|
3 |
+
depth_multiple: 1.0 # expand model depth
|
4 |
+
width_multiple: 1.25 # expand layer channels
|
5 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# CSP-Darknet backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args]
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
|
18 |
+
[-1, 1, DownC, [128]], # 2-P2/4
|
19 |
+
[-1, 3, BottleneckCSPA, [128]],
|
20 |
+
[-1, 1, DownC, [256]], # 4-P3/8
|
21 |
+
[-1, 7, BottleneckCSPA, [256]],
|
22 |
+
[-1, 1, DownC, [512]], # 6-P4/16
|
23 |
+
[-1, 7, BottleneckCSPA, [512]],
|
24 |
+
[-1, 1, DownC, [768]], # 8-P5/32
|
25 |
+
[-1, 3, BottleneckCSPA, [768]],
|
26 |
+
[-1, 1, DownC, [1024]], # 10-P6/64
|
27 |
+
[-1, 3, BottleneckCSPA, [1024]], # 11
|
28 |
+
]
|
29 |
+
|
30 |
+
# CSP-Dark-PAN head
|
31 |
+
head:
|
32 |
+
[[-1, 1, SPPCSPC, [512]], # 12
|
33 |
+
[-1, 1, Conv, [384, 1, 1]],
|
34 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
35 |
+
[-6, 1, Conv, [384, 1, 1]], # route backbone P5
|
36 |
+
[[-1, -2], 1, Concat, [1]],
|
37 |
+
[-1, 3, BottleneckCSPB, [384]], # 17
|
38 |
+
[-1, 1, Conv, [256, 1, 1]],
|
39 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
40 |
+
[-13, 1, Conv, [256, 1, 1]], # route backbone P4
|
41 |
+
[[-1, -2], 1, Concat, [1]],
|
42 |
+
[-1, 3, BottleneckCSPB, [256]], # 22
|
43 |
+
[-1, 1, Conv, [128, 1, 1]],
|
44 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
45 |
+
[-20, 1, Conv, [128, 1, 1]], # route backbone P3
|
46 |
+
[[-1, -2], 1, Concat, [1]],
|
47 |
+
[-1, 3, BottleneckCSPB, [128]], # 27
|
48 |
+
[-1, 1, Conv, [256, 3, 1]],
|
49 |
+
[-2, 1, DownC, [256]],
|
50 |
+
[[-1, 22], 1, Concat, [1]], # cat
|
51 |
+
[-1, 3, BottleneckCSPB, [256]], # 31
|
52 |
+
[-1, 1, Conv, [512, 3, 1]],
|
53 |
+
[-2, 1, DownC, [384]],
|
54 |
+
[[-1, 17], 1, Concat, [1]], # cat
|
55 |
+
[-1, 3, BottleneckCSPB, [384]], # 35
|
56 |
+
[-1, 1, Conv, [768, 3, 1]],
|
57 |
+
[-2, 1, DownC, [512]],
|
58 |
+
[[-1, 12], 1, Concat, [1]], # cat
|
59 |
+
[-1, 3, BottleneckCSPB, [512]], # 39
|
60 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
61 |
+
|
62 |
+
[[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
63 |
+
]
|
cfg/baseline/yolor-p6.yaml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# parameters
|
2 |
+
nc: 80 # number of classes
|
3 |
+
depth_multiple: 1.0 # expand model depth
|
4 |
+
width_multiple: 1.0 # expand layer channels
|
5 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# CSP-Darknet backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args]
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 2-P2/4
|
19 |
+
[-1, 3, BottleneckCSPA, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 4-P3/8
|
21 |
+
[-1, 7, BottleneckCSPA, [256]],
|
22 |
+
[-1, 1, Conv, [384, 3, 2]], # 6-P4/16
|
23 |
+
[-1, 7, BottleneckCSPA, [384]],
|
24 |
+
[-1, 1, Conv, [512, 3, 2]], # 8-P5/32
|
25 |
+
[-1, 3, BottleneckCSPA, [512]],
|
26 |
+
[-1, 1, Conv, [640, 3, 2]], # 10-P6/64
|
27 |
+
[-1, 3, BottleneckCSPA, [640]], # 11
|
28 |
+
]
|
29 |
+
|
30 |
+
# CSP-Dark-PAN head
|
31 |
+
head:
|
32 |
+
[[-1, 1, SPPCSPC, [320]], # 12
|
33 |
+
[-1, 1, Conv, [256, 1, 1]],
|
34 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
35 |
+
[-6, 1, Conv, [256, 1, 1]], # route backbone P5
|
36 |
+
[[-1, -2], 1, Concat, [1]],
|
37 |
+
[-1, 3, BottleneckCSPB, [256]], # 17
|
38 |
+
[-1, 1, Conv, [192, 1, 1]],
|
39 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
40 |
+
[-13, 1, Conv, [192, 1, 1]], # route backbone P4
|
41 |
+
[[-1, -2], 1, Concat, [1]],
|
42 |
+
[-1, 3, BottleneckCSPB, [192]], # 22
|
43 |
+
[-1, 1, Conv, [128, 1, 1]],
|
44 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
45 |
+
[-20, 1, Conv, [128, 1, 1]], # route backbone P3
|
46 |
+
[[-1, -2], 1, Concat, [1]],
|
47 |
+
[-1, 3, BottleneckCSPB, [128]], # 27
|
48 |
+
[-1, 1, Conv, [256, 3, 1]],
|
49 |
+
[-2, 1, Conv, [192, 3, 2]],
|
50 |
+
[[-1, 22], 1, Concat, [1]], # cat
|
51 |
+
[-1, 3, BottleneckCSPB, [192]], # 31
|
52 |
+
[-1, 1, Conv, [384, 3, 1]],
|
53 |
+
[-2, 1, Conv, [256, 3, 2]],
|
54 |
+
[[-1, 17], 1, Concat, [1]], # cat
|
55 |
+
[-1, 3, BottleneckCSPB, [256]], # 35
|
56 |
+
[-1, 1, Conv, [512, 3, 1]],
|
57 |
+
[-2, 1, Conv, [320, 3, 2]],
|
58 |
+
[[-1, 12], 1, Concat, [1]], # cat
|
59 |
+
[-1, 3, BottleneckCSPB, [320]], # 39
|
60 |
+
[-1, 1, Conv, [640, 3, 1]],
|
61 |
+
|
62 |
+
[[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
63 |
+
]
|
cfg/baseline/yolor-w6.yaml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# parameters
|
2 |
+
nc: 80 # number of classes
|
3 |
+
depth_multiple: 1.0 # expand model depth
|
4 |
+
width_multiple: 1.0 # expand layer channels
|
5 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# CSP-Darknet backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args]
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 2-P2/4
|
19 |
+
[-1, 3, BottleneckCSPA, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 4-P3/8
|
21 |
+
[-1, 7, BottleneckCSPA, [256]],
|
22 |
+
[-1, 1, Conv, [512, 3, 2]], # 6-P4/16
|
23 |
+
[-1, 7, BottleneckCSPA, [512]],
|
24 |
+
[-1, 1, Conv, [768, 3, 2]], # 8-P5/32
|
25 |
+
[-1, 3, BottleneckCSPA, [768]],
|
26 |
+
[-1, 1, Conv, [1024, 3, 2]], # 10-P6/64
|
27 |
+
[-1, 3, BottleneckCSPA, [1024]], # 11
|
28 |
+
]
|
29 |
+
|
30 |
+
# CSP-Dark-PAN head
|
31 |
+
head:
|
32 |
+
[[-1, 1, SPPCSPC, [512]], # 12
|
33 |
+
[-1, 1, Conv, [384, 1, 1]],
|
34 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
35 |
+
[-6, 1, Conv, [384, 1, 1]], # route backbone P5
|
36 |
+
[[-1, -2], 1, Concat, [1]],
|
37 |
+
[-1, 3, BottleneckCSPB, [384]], # 17
|
38 |
+
[-1, 1, Conv, [256, 1, 1]],
|
39 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
40 |
+
[-13, 1, Conv, [256, 1, 1]], # route backbone P4
|
41 |
+
[[-1, -2], 1, Concat, [1]],
|
42 |
+
[-1, 3, BottleneckCSPB, [256]], # 22
|
43 |
+
[-1, 1, Conv, [128, 1, 1]],
|
44 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
45 |
+
[-20, 1, Conv, [128, 1, 1]], # route backbone P3
|
46 |
+
[[-1, -2], 1, Concat, [1]],
|
47 |
+
[-1, 3, BottleneckCSPB, [128]], # 27
|
48 |
+
[-1, 1, Conv, [256, 3, 1]],
|
49 |
+
[-2, 1, Conv, [256, 3, 2]],
|
50 |
+
[[-1, 22], 1, Concat, [1]], # cat
|
51 |
+
[-1, 3, BottleneckCSPB, [256]], # 31
|
52 |
+
[-1, 1, Conv, [512, 3, 1]],
|
53 |
+
[-2, 1, Conv, [384, 3, 2]],
|
54 |
+
[[-1, 17], 1, Concat, [1]], # cat
|
55 |
+
[-1, 3, BottleneckCSPB, [384]], # 35
|
56 |
+
[-1, 1, Conv, [768, 3, 1]],
|
57 |
+
[-2, 1, Conv, [512, 3, 2]],
|
58 |
+
[[-1, 12], 1, Concat, [1]], # cat
|
59 |
+
[-1, 3, BottleneckCSPB, [512]], # 39
|
60 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
61 |
+
|
62 |
+
[[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
63 |
+
]
|
cfg/baseline/yolov3-spp.yaml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [10,13, 16,30, 33,23] # P3/8
|
9 |
+
- [30,61, 62,45, 59,119] # P4/16
|
10 |
+
- [116,90, 156,198, 373,326] # P5/32
|
11 |
+
|
12 |
+
# darknet53 backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
17 |
+
[-1, 1, Bottleneck, [64]],
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
19 |
+
[-1, 2, Bottleneck, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
|
21 |
+
[-1, 8, Bottleneck, [256]],
|
22 |
+
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
|
23 |
+
[-1, 8, Bottleneck, [512]],
|
24 |
+
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
|
25 |
+
[-1, 4, Bottleneck, [1024]], # 10
|
26 |
+
]
|
27 |
+
|
28 |
+
# YOLOv3-SPP head
|
29 |
+
head:
|
30 |
+
[[-1, 1, Bottleneck, [1024, False]],
|
31 |
+
[-1, 1, SPP, [512, [5, 9, 13]]],
|
32 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
33 |
+
[-1, 1, Conv, [512, 1, 1]],
|
34 |
+
[-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large)
|
35 |
+
|
36 |
+
[-2, 1, Conv, [256, 1, 1]],
|
37 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
38 |
+
[[-1, 8], 1, Concat, [1]], # cat backbone P4
|
39 |
+
[-1, 1, Bottleneck, [512, False]],
|
40 |
+
[-1, 1, Bottleneck, [512, False]],
|
41 |
+
[-1, 1, Conv, [256, 1, 1]],
|
42 |
+
[-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium)
|
43 |
+
|
44 |
+
[-2, 1, Conv, [128, 1, 1]],
|
45 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
46 |
+
[[-1, 6], 1, Concat, [1]], # cat backbone P3
|
47 |
+
[-1, 1, Bottleneck, [256, False]],
|
48 |
+
[-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small)
|
49 |
+
|
50 |
+
[[27, 22, 15], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
51 |
+
]
|
cfg/baseline/yolov3.yaml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [10,13, 16,30, 33,23] # P3/8
|
9 |
+
- [30,61, 62,45, 59,119] # P4/16
|
10 |
+
- [116,90, 156,198, 373,326] # P5/32
|
11 |
+
|
12 |
+
# darknet53 backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
17 |
+
[-1, 1, Bottleneck, [64]],
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
19 |
+
[-1, 2, Bottleneck, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
|
21 |
+
[-1, 8, Bottleneck, [256]],
|
22 |
+
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
|
23 |
+
[-1, 8, Bottleneck, [512]],
|
24 |
+
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
|
25 |
+
[-1, 4, Bottleneck, [1024]], # 10
|
26 |
+
]
|
27 |
+
|
28 |
+
# YOLOv3 head
|
29 |
+
head:
|
30 |
+
[[-1, 1, Bottleneck, [1024, False]],
|
31 |
+
[-1, 1, Conv, [512, [1, 1]]],
|
32 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
33 |
+
[-1, 1, Conv, [512, 1, 1]],
|
34 |
+
[-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large)
|
35 |
+
|
36 |
+
[-2, 1, Conv, [256, 1, 1]],
|
37 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
38 |
+
[[-1, 8], 1, Concat, [1]], # cat backbone P4
|
39 |
+
[-1, 1, Bottleneck, [512, False]],
|
40 |
+
[-1, 1, Bottleneck, [512, False]],
|
41 |
+
[-1, 1, Conv, [256, 1, 1]],
|
42 |
+
[-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium)
|
43 |
+
|
44 |
+
[-2, 1, Conv, [128, 1, 1]],
|
45 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
46 |
+
[[-1, 6], 1, Concat, [1]], # cat backbone P3
|
47 |
+
[-1, 1, Bottleneck, [256, False]],
|
48 |
+
[-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small)
|
49 |
+
|
50 |
+
[[27, 22, 15], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
51 |
+
]
|
cfg/baseline/yolov4-csp.yaml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# CSP-Darknet backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
17 |
+
[-1, 1, Bottleneck, [64]],
|
18 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
19 |
+
[-1, 2, BottleneckCSPC, [128]],
|
20 |
+
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
|
21 |
+
[-1, 8, BottleneckCSPC, [256]],
|
22 |
+
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
|
23 |
+
[-1, 8, BottleneckCSPC, [512]],
|
24 |
+
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
|
25 |
+
[-1, 4, BottleneckCSPC, [1024]], # 10
|
26 |
+
]
|
27 |
+
|
28 |
+
# CSP-Dark-PAN head
|
29 |
+
head:
|
30 |
+
[[-1, 1, SPPCSPC, [512]], # 11
|
31 |
+
[-1, 1, Conv, [256, 1, 1]],
|
32 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
33 |
+
[8, 1, Conv, [256, 1, 1]], # route backbone P4
|
34 |
+
[[-1, -2], 1, Concat, [1]],
|
35 |
+
[-1, 2, BottleneckCSPB, [256]], # 16
|
36 |
+
[-1, 1, Conv, [128, 1, 1]],
|
37 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
38 |
+
[6, 1, Conv, [128, 1, 1]], # route backbone P3
|
39 |
+
[[-1, -2], 1, Concat, [1]],
|
40 |
+
[-1, 2, BottleneckCSPB, [128]], # 21
|
41 |
+
[-1, 1, Conv, [256, 3, 1]],
|
42 |
+
[-2, 1, Conv, [256, 3, 2]],
|
43 |
+
[[-1, 16], 1, Concat, [1]], # cat
|
44 |
+
[-1, 2, BottleneckCSPB, [256]], # 25
|
45 |
+
[-1, 1, Conv, [512, 3, 1]],
|
46 |
+
[-2, 1, Conv, [512, 3, 2]],
|
47 |
+
[[-1, 11], 1, Concat, [1]], # cat
|
48 |
+
[-1, 2, BottleneckCSPB, [512]], # 29
|
49 |
+
[-1, 1, Conv, [1024, 3, 1]],
|
50 |
+
|
51 |
+
[[22,26,30], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
52 |
+
]
|
cfg/deploy/yolov7-d6.yaml
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7-d6 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args],
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [96, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, DownC, [192]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[-1, 1, Conv, [64, 3, 1]],
|
29 |
+
[-1, 1, Conv, [64, 3, 1]],
|
30 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
31 |
+
[-1, 1, Conv, [192, 1, 1]], # 14
|
32 |
+
|
33 |
+
[-1, 1, DownC, [384]], # 15-P3/8
|
34 |
+
[-1, 1, Conv, [128, 1, 1]],
|
35 |
+
[-2, 1, Conv, [128, 1, 1]],
|
36 |
+
[-1, 1, Conv, [128, 3, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[-1, 1, Conv, [128, 3, 1]],
|
41 |
+
[-1, 1, Conv, [128, 3, 1]],
|
42 |
+
[-1, 1, Conv, [128, 3, 1]],
|
43 |
+
[-1, 1, Conv, [128, 3, 1]],
|
44 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
45 |
+
[-1, 1, Conv, [384, 1, 1]], # 27
|
46 |
+
|
47 |
+
[-1, 1, DownC, [768]], # 28-P4/16
|
48 |
+
[-1, 1, Conv, [256, 1, 1]],
|
49 |
+
[-2, 1, Conv, [256, 1, 1]],
|
50 |
+
[-1, 1, Conv, [256, 3, 1]],
|
51 |
+
[-1, 1, Conv, [256, 3, 1]],
|
52 |
+
[-1, 1, Conv, [256, 3, 1]],
|
53 |
+
[-1, 1, Conv, [256, 3, 1]],
|
54 |
+
[-1, 1, Conv, [256, 3, 1]],
|
55 |
+
[-1, 1, Conv, [256, 3, 1]],
|
56 |
+
[-1, 1, Conv, [256, 3, 1]],
|
57 |
+
[-1, 1, Conv, [256, 3, 1]],
|
58 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
59 |
+
[-1, 1, Conv, [768, 1, 1]], # 40
|
60 |
+
|
61 |
+
[-1, 1, DownC, [1152]], # 41-P5/32
|
62 |
+
[-1, 1, Conv, [384, 1, 1]],
|
63 |
+
[-2, 1, Conv, [384, 1, 1]],
|
64 |
+
[-1, 1, Conv, [384, 3, 1]],
|
65 |
+
[-1, 1, Conv, [384, 3, 1]],
|
66 |
+
[-1, 1, Conv, [384, 3, 1]],
|
67 |
+
[-1, 1, Conv, [384, 3, 1]],
|
68 |
+
[-1, 1, Conv, [384, 3, 1]],
|
69 |
+
[-1, 1, Conv, [384, 3, 1]],
|
70 |
+
[-1, 1, Conv, [384, 3, 1]],
|
71 |
+
[-1, 1, Conv, [384, 3, 1]],
|
72 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
73 |
+
[-1, 1, Conv, [1152, 1, 1]], # 53
|
74 |
+
|
75 |
+
[-1, 1, DownC, [1536]], # 54-P6/64
|
76 |
+
[-1, 1, Conv, [512, 1, 1]],
|
77 |
+
[-2, 1, Conv, [512, 1, 1]],
|
78 |
+
[-1, 1, Conv, [512, 3, 1]],
|
79 |
+
[-1, 1, Conv, [512, 3, 1]],
|
80 |
+
[-1, 1, Conv, [512, 3, 1]],
|
81 |
+
[-1, 1, Conv, [512, 3, 1]],
|
82 |
+
[-1, 1, Conv, [512, 3, 1]],
|
83 |
+
[-1, 1, Conv, [512, 3, 1]],
|
84 |
+
[-1, 1, Conv, [512, 3, 1]],
|
85 |
+
[-1, 1, Conv, [512, 3, 1]],
|
86 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
87 |
+
[-1, 1, Conv, [1536, 1, 1]], # 66
|
88 |
+
]
|
89 |
+
|
90 |
+
# yolov7-d6 head
|
91 |
+
head:
|
92 |
+
[[-1, 1, SPPCSPC, [768]], # 67
|
93 |
+
|
94 |
+
[-1, 1, Conv, [576, 1, 1]],
|
95 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
96 |
+
[53, 1, Conv, [576, 1, 1]], # route backbone P5
|
97 |
+
[[-1, -2], 1, Concat, [1]],
|
98 |
+
|
99 |
+
[-1, 1, Conv, [384, 1, 1]],
|
100 |
+
[-2, 1, Conv, [384, 1, 1]],
|
101 |
+
[-1, 1, Conv, [192, 3, 1]],
|
102 |
+
[-1, 1, Conv, [192, 3, 1]],
|
103 |
+
[-1, 1, Conv, [192, 3, 1]],
|
104 |
+
[-1, 1, Conv, [192, 3, 1]],
|
105 |
+
[-1, 1, Conv, [192, 3, 1]],
|
106 |
+
[-1, 1, Conv, [192, 3, 1]],
|
107 |
+
[-1, 1, Conv, [192, 3, 1]],
|
108 |
+
[-1, 1, Conv, [192, 3, 1]],
|
109 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
110 |
+
[-1, 1, Conv, [576, 1, 1]], # 83
|
111 |
+
|
112 |
+
[-1, 1, Conv, [384, 1, 1]],
|
113 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
114 |
+
[40, 1, Conv, [384, 1, 1]], # route backbone P4
|
115 |
+
[[-1, -2], 1, Concat, [1]],
|
116 |
+
|
117 |
+
[-1, 1, Conv, [256, 1, 1]],
|
118 |
+
[-2, 1, Conv, [256, 1, 1]],
|
119 |
+
[-1, 1, Conv, [128, 3, 1]],
|
120 |
+
[-1, 1, Conv, [128, 3, 1]],
|
121 |
+
[-1, 1, Conv, [128, 3, 1]],
|
122 |
+
[-1, 1, Conv, [128, 3, 1]],
|
123 |
+
[-1, 1, Conv, [128, 3, 1]],
|
124 |
+
[-1, 1, Conv, [128, 3, 1]],
|
125 |
+
[-1, 1, Conv, [128, 3, 1]],
|
126 |
+
[-1, 1, Conv, [128, 3, 1]],
|
127 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
128 |
+
[-1, 1, Conv, [384, 1, 1]], # 99
|
129 |
+
|
130 |
+
[-1, 1, Conv, [192, 1, 1]],
|
131 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
132 |
+
[27, 1, Conv, [192, 1, 1]], # route backbone P3
|
133 |
+
[[-1, -2], 1, Concat, [1]],
|
134 |
+
|
135 |
+
[-1, 1, Conv, [128, 1, 1]],
|
136 |
+
[-2, 1, Conv, [128, 1, 1]],
|
137 |
+
[-1, 1, Conv, [64, 3, 1]],
|
138 |
+
[-1, 1, Conv, [64, 3, 1]],
|
139 |
+
[-1, 1, Conv, [64, 3, 1]],
|
140 |
+
[-1, 1, Conv, [64, 3, 1]],
|
141 |
+
[-1, 1, Conv, [64, 3, 1]],
|
142 |
+
[-1, 1, Conv, [64, 3, 1]],
|
143 |
+
[-1, 1, Conv, [64, 3, 1]],
|
144 |
+
[-1, 1, Conv, [64, 3, 1]],
|
145 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
146 |
+
[-1, 1, Conv, [192, 1, 1]], # 115
|
147 |
+
|
148 |
+
[-1, 1, DownC, [384]],
|
149 |
+
[[-1, 99], 1, Concat, [1]],
|
150 |
+
|
151 |
+
[-1, 1, Conv, [256, 1, 1]],
|
152 |
+
[-2, 1, Conv, [256, 1, 1]],
|
153 |
+
[-1, 1, Conv, [128, 3, 1]],
|
154 |
+
[-1, 1, Conv, [128, 3, 1]],
|
155 |
+
[-1, 1, Conv, [128, 3, 1]],
|
156 |
+
[-1, 1, Conv, [128, 3, 1]],
|
157 |
+
[-1, 1, Conv, [128, 3, 1]],
|
158 |
+
[-1, 1, Conv, [128, 3, 1]],
|
159 |
+
[-1, 1, Conv, [128, 3, 1]],
|
160 |
+
[-1, 1, Conv, [128, 3, 1]],
|
161 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
162 |
+
[-1, 1, Conv, [384, 1, 1]], # 129
|
163 |
+
|
164 |
+
[-1, 1, DownC, [576]],
|
165 |
+
[[-1, 83], 1, Concat, [1]],
|
166 |
+
|
167 |
+
[-1, 1, Conv, [384, 1, 1]],
|
168 |
+
[-2, 1, Conv, [384, 1, 1]],
|
169 |
+
[-1, 1, Conv, [192, 3, 1]],
|
170 |
+
[-1, 1, Conv, [192, 3, 1]],
|
171 |
+
[-1, 1, Conv, [192, 3, 1]],
|
172 |
+
[-1, 1, Conv, [192, 3, 1]],
|
173 |
+
[-1, 1, Conv, [192, 3, 1]],
|
174 |
+
[-1, 1, Conv, [192, 3, 1]],
|
175 |
+
[-1, 1, Conv, [192, 3, 1]],
|
176 |
+
[-1, 1, Conv, [192, 3, 1]],
|
177 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
178 |
+
[-1, 1, Conv, [576, 1, 1]], # 143
|
179 |
+
|
180 |
+
[-1, 1, DownC, [768]],
|
181 |
+
[[-1, 67], 1, Concat, [1]],
|
182 |
+
|
183 |
+
[-1, 1, Conv, [512, 1, 1]],
|
184 |
+
[-2, 1, Conv, [512, 1, 1]],
|
185 |
+
[-1, 1, Conv, [256, 3, 1]],
|
186 |
+
[-1, 1, Conv, [256, 3, 1]],
|
187 |
+
[-1, 1, Conv, [256, 3, 1]],
|
188 |
+
[-1, 1, Conv, [256, 3, 1]],
|
189 |
+
[-1, 1, Conv, [256, 3, 1]],
|
190 |
+
[-1, 1, Conv, [256, 3, 1]],
|
191 |
+
[-1, 1, Conv, [256, 3, 1]],
|
192 |
+
[-1, 1, Conv, [256, 3, 1]],
|
193 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
194 |
+
[-1, 1, Conv, [768, 1, 1]], # 157
|
195 |
+
|
196 |
+
[115, 1, Conv, [384, 3, 1]],
|
197 |
+
[129, 1, Conv, [768, 3, 1]],
|
198 |
+
[143, 1, Conv, [1152, 3, 1]],
|
199 |
+
[157, 1, Conv, [1536, 3, 1]],
|
200 |
+
|
201 |
+
[[158,159,160,161], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
202 |
+
]
|
cfg/deploy/yolov7-e6.yaml
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7-e6 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args],
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [80, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, DownC, [160]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
29 |
+
[-1, 1, Conv, [160, 1, 1]], # 12
|
30 |
+
|
31 |
+
[-1, 1, DownC, [320]], # 13-P3/8
|
32 |
+
[-1, 1, Conv, [128, 1, 1]],
|
33 |
+
[-2, 1, Conv, [128, 1, 1]],
|
34 |
+
[-1, 1, Conv, [128, 3, 1]],
|
35 |
+
[-1, 1, Conv, [128, 3, 1]],
|
36 |
+
[-1, 1, Conv, [128, 3, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
41 |
+
[-1, 1, Conv, [320, 1, 1]], # 23
|
42 |
+
|
43 |
+
[-1, 1, DownC, [640]], # 24-P4/16
|
44 |
+
[-1, 1, Conv, [256, 1, 1]],
|
45 |
+
[-2, 1, Conv, [256, 1, 1]],
|
46 |
+
[-1, 1, Conv, [256, 3, 1]],
|
47 |
+
[-1, 1, Conv, [256, 3, 1]],
|
48 |
+
[-1, 1, Conv, [256, 3, 1]],
|
49 |
+
[-1, 1, Conv, [256, 3, 1]],
|
50 |
+
[-1, 1, Conv, [256, 3, 1]],
|
51 |
+
[-1, 1, Conv, [256, 3, 1]],
|
52 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
53 |
+
[-1, 1, Conv, [640, 1, 1]], # 34
|
54 |
+
|
55 |
+
[-1, 1, DownC, [960]], # 35-P5/32
|
56 |
+
[-1, 1, Conv, [384, 1, 1]],
|
57 |
+
[-2, 1, Conv, [384, 1, 1]],
|
58 |
+
[-1, 1, Conv, [384, 3, 1]],
|
59 |
+
[-1, 1, Conv, [384, 3, 1]],
|
60 |
+
[-1, 1, Conv, [384, 3, 1]],
|
61 |
+
[-1, 1, Conv, [384, 3, 1]],
|
62 |
+
[-1, 1, Conv, [384, 3, 1]],
|
63 |
+
[-1, 1, Conv, [384, 3, 1]],
|
64 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
65 |
+
[-1, 1, Conv, [960, 1, 1]], # 45
|
66 |
+
|
67 |
+
[-1, 1, DownC, [1280]], # 46-P6/64
|
68 |
+
[-1, 1, Conv, [512, 1, 1]],
|
69 |
+
[-2, 1, Conv, [512, 1, 1]],
|
70 |
+
[-1, 1, Conv, [512, 3, 1]],
|
71 |
+
[-1, 1, Conv, [512, 3, 1]],
|
72 |
+
[-1, 1, Conv, [512, 3, 1]],
|
73 |
+
[-1, 1, Conv, [512, 3, 1]],
|
74 |
+
[-1, 1, Conv, [512, 3, 1]],
|
75 |
+
[-1, 1, Conv, [512, 3, 1]],
|
76 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
77 |
+
[-1, 1, Conv, [1280, 1, 1]], # 56
|
78 |
+
]
|
79 |
+
|
80 |
+
# yolov7-e6 head
|
81 |
+
head:
|
82 |
+
[[-1, 1, SPPCSPC, [640]], # 57
|
83 |
+
|
84 |
+
[-1, 1, Conv, [480, 1, 1]],
|
85 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
86 |
+
[45, 1, Conv, [480, 1, 1]], # route backbone P5
|
87 |
+
[[-1, -2], 1, Concat, [1]],
|
88 |
+
|
89 |
+
[-1, 1, Conv, [384, 1, 1]],
|
90 |
+
[-2, 1, Conv, [384, 1, 1]],
|
91 |
+
[-1, 1, Conv, [192, 3, 1]],
|
92 |
+
[-1, 1, Conv, [192, 3, 1]],
|
93 |
+
[-1, 1, Conv, [192, 3, 1]],
|
94 |
+
[-1, 1, Conv, [192, 3, 1]],
|
95 |
+
[-1, 1, Conv, [192, 3, 1]],
|
96 |
+
[-1, 1, Conv, [192, 3, 1]],
|
97 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
98 |
+
[-1, 1, Conv, [480, 1, 1]], # 71
|
99 |
+
|
100 |
+
[-1, 1, Conv, [320, 1, 1]],
|
101 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
102 |
+
[34, 1, Conv, [320, 1, 1]], # route backbone P4
|
103 |
+
[[-1, -2], 1, Concat, [1]],
|
104 |
+
|
105 |
+
[-1, 1, Conv, [256, 1, 1]],
|
106 |
+
[-2, 1, Conv, [256, 1, 1]],
|
107 |
+
[-1, 1, Conv, [128, 3, 1]],
|
108 |
+
[-1, 1, Conv, [128, 3, 1]],
|
109 |
+
[-1, 1, Conv, [128, 3, 1]],
|
110 |
+
[-1, 1, Conv, [128, 3, 1]],
|
111 |
+
[-1, 1, Conv, [128, 3, 1]],
|
112 |
+
[-1, 1, Conv, [128, 3, 1]],
|
113 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
114 |
+
[-1, 1, Conv, [320, 1, 1]], # 85
|
115 |
+
|
116 |
+
[-1, 1, Conv, [160, 1, 1]],
|
117 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
118 |
+
[23, 1, Conv, [160, 1, 1]], # route backbone P3
|
119 |
+
[[-1, -2], 1, Concat, [1]],
|
120 |
+
|
121 |
+
[-1, 1, Conv, [128, 1, 1]],
|
122 |
+
[-2, 1, Conv, [128, 1, 1]],
|
123 |
+
[-1, 1, Conv, [64, 3, 1]],
|
124 |
+
[-1, 1, Conv, [64, 3, 1]],
|
125 |
+
[-1, 1, Conv, [64, 3, 1]],
|
126 |
+
[-1, 1, Conv, [64, 3, 1]],
|
127 |
+
[-1, 1, Conv, [64, 3, 1]],
|
128 |
+
[-1, 1, Conv, [64, 3, 1]],
|
129 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
130 |
+
[-1, 1, Conv, [160, 1, 1]], # 99
|
131 |
+
|
132 |
+
[-1, 1, DownC, [320]],
|
133 |
+
[[-1, 85], 1, Concat, [1]],
|
134 |
+
|
135 |
+
[-1, 1, Conv, [256, 1, 1]],
|
136 |
+
[-2, 1, Conv, [256, 1, 1]],
|
137 |
+
[-1, 1, Conv, [128, 3, 1]],
|
138 |
+
[-1, 1, Conv, [128, 3, 1]],
|
139 |
+
[-1, 1, Conv, [128, 3, 1]],
|
140 |
+
[-1, 1, Conv, [128, 3, 1]],
|
141 |
+
[-1, 1, Conv, [128, 3, 1]],
|
142 |
+
[-1, 1, Conv, [128, 3, 1]],
|
143 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
144 |
+
[-1, 1, Conv, [320, 1, 1]], # 111
|
145 |
+
|
146 |
+
[-1, 1, DownC, [480]],
|
147 |
+
[[-1, 71], 1, Concat, [1]],
|
148 |
+
|
149 |
+
[-1, 1, Conv, [384, 1, 1]],
|
150 |
+
[-2, 1, Conv, [384, 1, 1]],
|
151 |
+
[-1, 1, Conv, [192, 3, 1]],
|
152 |
+
[-1, 1, Conv, [192, 3, 1]],
|
153 |
+
[-1, 1, Conv, [192, 3, 1]],
|
154 |
+
[-1, 1, Conv, [192, 3, 1]],
|
155 |
+
[-1, 1, Conv, [192, 3, 1]],
|
156 |
+
[-1, 1, Conv, [192, 3, 1]],
|
157 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
158 |
+
[-1, 1, Conv, [480, 1, 1]], # 123
|
159 |
+
|
160 |
+
[-1, 1, DownC, [640]],
|
161 |
+
[[-1, 57], 1, Concat, [1]],
|
162 |
+
|
163 |
+
[-1, 1, Conv, [512, 1, 1]],
|
164 |
+
[-2, 1, Conv, [512, 1, 1]],
|
165 |
+
[-1, 1, Conv, [256, 3, 1]],
|
166 |
+
[-1, 1, Conv, [256, 3, 1]],
|
167 |
+
[-1, 1, Conv, [256, 3, 1]],
|
168 |
+
[-1, 1, Conv, [256, 3, 1]],
|
169 |
+
[-1, 1, Conv, [256, 3, 1]],
|
170 |
+
[-1, 1, Conv, [256, 3, 1]],
|
171 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
172 |
+
[-1, 1, Conv, [640, 1, 1]], # 135
|
173 |
+
|
174 |
+
[99, 1, Conv, [320, 3, 1]],
|
175 |
+
[111, 1, Conv, [640, 3, 1]],
|
176 |
+
[123, 1, Conv, [960, 3, 1]],
|
177 |
+
[135, 1, Conv, [1280, 3, 1]],
|
178 |
+
|
179 |
+
[[136,137,138,139], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
180 |
+
]
|
cfg/deploy/yolov7-e6e.yaml
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7-e6e backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args],
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [80, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, DownC, [160]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
29 |
+
[-1, 1, Conv, [160, 1, 1]], # 12
|
30 |
+
[-11, 1, Conv, [64, 1, 1]],
|
31 |
+
[-12, 1, Conv, [64, 1, 1]],
|
32 |
+
[-1, 1, Conv, [64, 3, 1]],
|
33 |
+
[-1, 1, Conv, [64, 3, 1]],
|
34 |
+
[-1, 1, Conv, [64, 3, 1]],
|
35 |
+
[-1, 1, Conv, [64, 3, 1]],
|
36 |
+
[-1, 1, Conv, [64, 3, 1]],
|
37 |
+
[-1, 1, Conv, [64, 3, 1]],
|
38 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
39 |
+
[-1, 1, Conv, [160, 1, 1]], # 22
|
40 |
+
[[-1, -11], 1, Shortcut, [1]], # 23
|
41 |
+
|
42 |
+
[-1, 1, DownC, [320]], # 24-P3/8
|
43 |
+
[-1, 1, Conv, [128, 1, 1]],
|
44 |
+
[-2, 1, Conv, [128, 1, 1]],
|
45 |
+
[-1, 1, Conv, [128, 3, 1]],
|
46 |
+
[-1, 1, Conv, [128, 3, 1]],
|
47 |
+
[-1, 1, Conv, [128, 3, 1]],
|
48 |
+
[-1, 1, Conv, [128, 3, 1]],
|
49 |
+
[-1, 1, Conv, [128, 3, 1]],
|
50 |
+
[-1, 1, Conv, [128, 3, 1]],
|
51 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
52 |
+
[-1, 1, Conv, [320, 1, 1]], # 34
|
53 |
+
[-11, 1, Conv, [128, 1, 1]],
|
54 |
+
[-12, 1, Conv, [128, 1, 1]],
|
55 |
+
[-1, 1, Conv, [128, 3, 1]],
|
56 |
+
[-1, 1, Conv, [128, 3, 1]],
|
57 |
+
[-1, 1, Conv, [128, 3, 1]],
|
58 |
+
[-1, 1, Conv, [128, 3, 1]],
|
59 |
+
[-1, 1, Conv, [128, 3, 1]],
|
60 |
+
[-1, 1, Conv, [128, 3, 1]],
|
61 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
62 |
+
[-1, 1, Conv, [320, 1, 1]], # 44
|
63 |
+
[[-1, -11], 1, Shortcut, [1]], # 45
|
64 |
+
|
65 |
+
[-1, 1, DownC, [640]], # 46-P4/16
|
66 |
+
[-1, 1, Conv, [256, 1, 1]],
|
67 |
+
[-2, 1, Conv, [256, 1, 1]],
|
68 |
+
[-1, 1, Conv, [256, 3, 1]],
|
69 |
+
[-1, 1, Conv, [256, 3, 1]],
|
70 |
+
[-1, 1, Conv, [256, 3, 1]],
|
71 |
+
[-1, 1, Conv, [256, 3, 1]],
|
72 |
+
[-1, 1, Conv, [256, 3, 1]],
|
73 |
+
[-1, 1, Conv, [256, 3, 1]],
|
74 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
75 |
+
[-1, 1, Conv, [640, 1, 1]], # 56
|
76 |
+
[-11, 1, Conv, [256, 1, 1]],
|
77 |
+
[-12, 1, Conv, [256, 1, 1]],
|
78 |
+
[-1, 1, Conv, [256, 3, 1]],
|
79 |
+
[-1, 1, Conv, [256, 3, 1]],
|
80 |
+
[-1, 1, Conv, [256, 3, 1]],
|
81 |
+
[-1, 1, Conv, [256, 3, 1]],
|
82 |
+
[-1, 1, Conv, [256, 3, 1]],
|
83 |
+
[-1, 1, Conv, [256, 3, 1]],
|
84 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
85 |
+
[-1, 1, Conv, [640, 1, 1]], # 66
|
86 |
+
[[-1, -11], 1, Shortcut, [1]], # 67
|
87 |
+
|
88 |
+
[-1, 1, DownC, [960]], # 68-P5/32
|
89 |
+
[-1, 1, Conv, [384, 1, 1]],
|
90 |
+
[-2, 1, Conv, [384, 1, 1]],
|
91 |
+
[-1, 1, Conv, [384, 3, 1]],
|
92 |
+
[-1, 1, Conv, [384, 3, 1]],
|
93 |
+
[-1, 1, Conv, [384, 3, 1]],
|
94 |
+
[-1, 1, Conv, [384, 3, 1]],
|
95 |
+
[-1, 1, Conv, [384, 3, 1]],
|
96 |
+
[-1, 1, Conv, [384, 3, 1]],
|
97 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
98 |
+
[-1, 1, Conv, [960, 1, 1]], # 78
|
99 |
+
[-11, 1, Conv, [384, 1, 1]],
|
100 |
+
[-12, 1, Conv, [384, 1, 1]],
|
101 |
+
[-1, 1, Conv, [384, 3, 1]],
|
102 |
+
[-1, 1, Conv, [384, 3, 1]],
|
103 |
+
[-1, 1, Conv, [384, 3, 1]],
|
104 |
+
[-1, 1, Conv, [384, 3, 1]],
|
105 |
+
[-1, 1, Conv, [384, 3, 1]],
|
106 |
+
[-1, 1, Conv, [384, 3, 1]],
|
107 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
108 |
+
[-1, 1, Conv, [960, 1, 1]], # 88
|
109 |
+
[[-1, -11], 1, Shortcut, [1]], # 89
|
110 |
+
|
111 |
+
[-1, 1, DownC, [1280]], # 90-P6/64
|
112 |
+
[-1, 1, Conv, [512, 1, 1]],
|
113 |
+
[-2, 1, Conv, [512, 1, 1]],
|
114 |
+
[-1, 1, Conv, [512, 3, 1]],
|
115 |
+
[-1, 1, Conv, [512, 3, 1]],
|
116 |
+
[-1, 1, Conv, [512, 3, 1]],
|
117 |
+
[-1, 1, Conv, [512, 3, 1]],
|
118 |
+
[-1, 1, Conv, [512, 3, 1]],
|
119 |
+
[-1, 1, Conv, [512, 3, 1]],
|
120 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
121 |
+
[-1, 1, Conv, [1280, 1, 1]], # 100
|
122 |
+
[-11, 1, Conv, [512, 1, 1]],
|
123 |
+
[-12, 1, Conv, [512, 1, 1]],
|
124 |
+
[-1, 1, Conv, [512, 3, 1]],
|
125 |
+
[-1, 1, Conv, [512, 3, 1]],
|
126 |
+
[-1, 1, Conv, [512, 3, 1]],
|
127 |
+
[-1, 1, Conv, [512, 3, 1]],
|
128 |
+
[-1, 1, Conv, [512, 3, 1]],
|
129 |
+
[-1, 1, Conv, [512, 3, 1]],
|
130 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
131 |
+
[-1, 1, Conv, [1280, 1, 1]], # 110
|
132 |
+
[[-1, -11], 1, Shortcut, [1]], # 111
|
133 |
+
]
|
134 |
+
|
135 |
+
# yolov7-e6e head
|
136 |
+
head:
|
137 |
+
[[-1, 1, SPPCSPC, [640]], # 112
|
138 |
+
|
139 |
+
[-1, 1, Conv, [480, 1, 1]],
|
140 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
141 |
+
[89, 1, Conv, [480, 1, 1]], # route backbone P5
|
142 |
+
[[-1, -2], 1, Concat, [1]],
|
143 |
+
|
144 |
+
[-1, 1, Conv, [384, 1, 1]],
|
145 |
+
[-2, 1, Conv, [384, 1, 1]],
|
146 |
+
[-1, 1, Conv, [192, 3, 1]],
|
147 |
+
[-1, 1, Conv, [192, 3, 1]],
|
148 |
+
[-1, 1, Conv, [192, 3, 1]],
|
149 |
+
[-1, 1, Conv, [192, 3, 1]],
|
150 |
+
[-1, 1, Conv, [192, 3, 1]],
|
151 |
+
[-1, 1, Conv, [192, 3, 1]],
|
152 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
153 |
+
[-1, 1, Conv, [480, 1, 1]], # 126
|
154 |
+
[-11, 1, Conv, [384, 1, 1]],
|
155 |
+
[-12, 1, Conv, [384, 1, 1]],
|
156 |
+
[-1, 1, Conv, [192, 3, 1]],
|
157 |
+
[-1, 1, Conv, [192, 3, 1]],
|
158 |
+
[-1, 1, Conv, [192, 3, 1]],
|
159 |
+
[-1, 1, Conv, [192, 3, 1]],
|
160 |
+
[-1, 1, Conv, [192, 3, 1]],
|
161 |
+
[-1, 1, Conv, [192, 3, 1]],
|
162 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
163 |
+
[-1, 1, Conv, [480, 1, 1]], # 136
|
164 |
+
[[-1, -11], 1, Shortcut, [1]], # 137
|
165 |
+
|
166 |
+
[-1, 1, Conv, [320, 1, 1]],
|
167 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
168 |
+
[67, 1, Conv, [320, 1, 1]], # route backbone P4
|
169 |
+
[[-1, -2], 1, Concat, [1]],
|
170 |
+
|
171 |
+
[-1, 1, Conv, [256, 1, 1]],
|
172 |
+
[-2, 1, Conv, [256, 1, 1]],
|
173 |
+
[-1, 1, Conv, [128, 3, 1]],
|
174 |
+
[-1, 1, Conv, [128, 3, 1]],
|
175 |
+
[-1, 1, Conv, [128, 3, 1]],
|
176 |
+
[-1, 1, Conv, [128, 3, 1]],
|
177 |
+
[-1, 1, Conv, [128, 3, 1]],
|
178 |
+
[-1, 1, Conv, [128, 3, 1]],
|
179 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
180 |
+
[-1, 1, Conv, [320, 1, 1]], # 151
|
181 |
+
[-11, 1, Conv, [256, 1, 1]],
|
182 |
+
[-12, 1, Conv, [256, 1, 1]],
|
183 |
+
[-1, 1, Conv, [128, 3, 1]],
|
184 |
+
[-1, 1, Conv, [128, 3, 1]],
|
185 |
+
[-1, 1, Conv, [128, 3, 1]],
|
186 |
+
[-1, 1, Conv, [128, 3, 1]],
|
187 |
+
[-1, 1, Conv, [128, 3, 1]],
|
188 |
+
[-1, 1, Conv, [128, 3, 1]],
|
189 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
190 |
+
[-1, 1, Conv, [320, 1, 1]], # 161
|
191 |
+
[[-1, -11], 1, Shortcut, [1]], # 162
|
192 |
+
|
193 |
+
[-1, 1, Conv, [160, 1, 1]],
|
194 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
195 |
+
[45, 1, Conv, [160, 1, 1]], # route backbone P3
|
196 |
+
[[-1, -2], 1, Concat, [1]],
|
197 |
+
|
198 |
+
[-1, 1, Conv, [128, 1, 1]],
|
199 |
+
[-2, 1, Conv, [128, 1, 1]],
|
200 |
+
[-1, 1, Conv, [64, 3, 1]],
|
201 |
+
[-1, 1, Conv, [64, 3, 1]],
|
202 |
+
[-1, 1, Conv, [64, 3, 1]],
|
203 |
+
[-1, 1, Conv, [64, 3, 1]],
|
204 |
+
[-1, 1, Conv, [64, 3, 1]],
|
205 |
+
[-1, 1, Conv, [64, 3, 1]],
|
206 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
207 |
+
[-1, 1, Conv, [160, 1, 1]], # 176
|
208 |
+
[-11, 1, Conv, [128, 1, 1]],
|
209 |
+
[-12, 1, Conv, [128, 1, 1]],
|
210 |
+
[-1, 1, Conv, [64, 3, 1]],
|
211 |
+
[-1, 1, Conv, [64, 3, 1]],
|
212 |
+
[-1, 1, Conv, [64, 3, 1]],
|
213 |
+
[-1, 1, Conv, [64, 3, 1]],
|
214 |
+
[-1, 1, Conv, [64, 3, 1]],
|
215 |
+
[-1, 1, Conv, [64, 3, 1]],
|
216 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
217 |
+
[-1, 1, Conv, [160, 1, 1]], # 186
|
218 |
+
[[-1, -11], 1, Shortcut, [1]], # 187
|
219 |
+
|
220 |
+
[-1, 1, DownC, [320]],
|
221 |
+
[[-1, 162], 1, Concat, [1]],
|
222 |
+
|
223 |
+
[-1, 1, Conv, [256, 1, 1]],
|
224 |
+
[-2, 1, Conv, [256, 1, 1]],
|
225 |
+
[-1, 1, Conv, [128, 3, 1]],
|
226 |
+
[-1, 1, Conv, [128, 3, 1]],
|
227 |
+
[-1, 1, Conv, [128, 3, 1]],
|
228 |
+
[-1, 1, Conv, [128, 3, 1]],
|
229 |
+
[-1, 1, Conv, [128, 3, 1]],
|
230 |
+
[-1, 1, Conv, [128, 3, 1]],
|
231 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
232 |
+
[-1, 1, Conv, [320, 1, 1]], # 199
|
233 |
+
[-11, 1, Conv, [256, 1, 1]],
|
234 |
+
[-12, 1, Conv, [256, 1, 1]],
|
235 |
+
[-1, 1, Conv, [128, 3, 1]],
|
236 |
+
[-1, 1, Conv, [128, 3, 1]],
|
237 |
+
[-1, 1, Conv, [128, 3, 1]],
|
238 |
+
[-1, 1, Conv, [128, 3, 1]],
|
239 |
+
[-1, 1, Conv, [128, 3, 1]],
|
240 |
+
[-1, 1, Conv, [128, 3, 1]],
|
241 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
242 |
+
[-1, 1, Conv, [320, 1, 1]], # 209
|
243 |
+
[[-1, -11], 1, Shortcut, [1]], # 210
|
244 |
+
|
245 |
+
[-1, 1, DownC, [480]],
|
246 |
+
[[-1, 137], 1, Concat, [1]],
|
247 |
+
|
248 |
+
[-1, 1, Conv, [384, 1, 1]],
|
249 |
+
[-2, 1, Conv, [384, 1, 1]],
|
250 |
+
[-1, 1, Conv, [192, 3, 1]],
|
251 |
+
[-1, 1, Conv, [192, 3, 1]],
|
252 |
+
[-1, 1, Conv, [192, 3, 1]],
|
253 |
+
[-1, 1, Conv, [192, 3, 1]],
|
254 |
+
[-1, 1, Conv, [192, 3, 1]],
|
255 |
+
[-1, 1, Conv, [192, 3, 1]],
|
256 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
257 |
+
[-1, 1, Conv, [480, 1, 1]], # 222
|
258 |
+
[-11, 1, Conv, [384, 1, 1]],
|
259 |
+
[-12, 1, Conv, [384, 1, 1]],
|
260 |
+
[-1, 1, Conv, [192, 3, 1]],
|
261 |
+
[-1, 1, Conv, [192, 3, 1]],
|
262 |
+
[-1, 1, Conv, [192, 3, 1]],
|
263 |
+
[-1, 1, Conv, [192, 3, 1]],
|
264 |
+
[-1, 1, Conv, [192, 3, 1]],
|
265 |
+
[-1, 1, Conv, [192, 3, 1]],
|
266 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
267 |
+
[-1, 1, Conv, [480, 1, 1]], # 232
|
268 |
+
[[-1, -11], 1, Shortcut, [1]], # 233
|
269 |
+
|
270 |
+
[-1, 1, DownC, [640]],
|
271 |
+
[[-1, 112], 1, Concat, [1]],
|
272 |
+
|
273 |
+
[-1, 1, Conv, [512, 1, 1]],
|
274 |
+
[-2, 1, Conv, [512, 1, 1]],
|
275 |
+
[-1, 1, Conv, [256, 3, 1]],
|
276 |
+
[-1, 1, Conv, [256, 3, 1]],
|
277 |
+
[-1, 1, Conv, [256, 3, 1]],
|
278 |
+
[-1, 1, Conv, [256, 3, 1]],
|
279 |
+
[-1, 1, Conv, [256, 3, 1]],
|
280 |
+
[-1, 1, Conv, [256, 3, 1]],
|
281 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
282 |
+
[-1, 1, Conv, [640, 1, 1]], # 245
|
283 |
+
[-11, 1, Conv, [512, 1, 1]],
|
284 |
+
[-12, 1, Conv, [512, 1, 1]],
|
285 |
+
[-1, 1, Conv, [256, 3, 1]],
|
286 |
+
[-1, 1, Conv, [256, 3, 1]],
|
287 |
+
[-1, 1, Conv, [256, 3, 1]],
|
288 |
+
[-1, 1, Conv, [256, 3, 1]],
|
289 |
+
[-1, 1, Conv, [256, 3, 1]],
|
290 |
+
[-1, 1, Conv, [256, 3, 1]],
|
291 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
292 |
+
[-1, 1, Conv, [640, 1, 1]], # 255
|
293 |
+
[[-1, -11], 1, Shortcut, [1]], # 256
|
294 |
+
|
295 |
+
[187, 1, Conv, [320, 3, 1]],
|
296 |
+
[210, 1, Conv, [640, 3, 1]],
|
297 |
+
[233, 1, Conv, [960, 3, 1]],
|
298 |
+
[256, 1, Conv, [1280, 3, 1]],
|
299 |
+
|
300 |
+
[[257,258,259,260], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
301 |
+
]
|
cfg/deploy/yolov7-tiny-silu.yaml
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [10,13, 16,30, 33,23] # P3/8
|
9 |
+
- [30,61, 62,45, 59,119] # P4/16
|
10 |
+
- [116,90, 156,198, 373,326] # P5/32
|
11 |
+
|
12 |
+
# YOLOv7-tiny backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 2]], # 0-P1/2
|
16 |
+
|
17 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P2/4
|
18 |
+
|
19 |
+
[-1, 1, Conv, [32, 1, 1]],
|
20 |
+
[-2, 1, Conv, [32, 1, 1]],
|
21 |
+
[-1, 1, Conv, [32, 3, 1]],
|
22 |
+
[-1, 1, Conv, [32, 3, 1]],
|
23 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
24 |
+
[-1, 1, Conv, [64, 1, 1]], # 7
|
25 |
+
|
26 |
+
[-1, 1, MP, []], # 8-P3/8
|
27 |
+
[-1, 1, Conv, [64, 1, 1]],
|
28 |
+
[-2, 1, Conv, [64, 1, 1]],
|
29 |
+
[-1, 1, Conv, [64, 3, 1]],
|
30 |
+
[-1, 1, Conv, [64, 3, 1]],
|
31 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
32 |
+
[-1, 1, Conv, [128, 1, 1]], # 14
|
33 |
+
|
34 |
+
[-1, 1, MP, []], # 15-P4/16
|
35 |
+
[-1, 1, Conv, [128, 1, 1]],
|
36 |
+
[-2, 1, Conv, [128, 1, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
40 |
+
[-1, 1, Conv, [256, 1, 1]], # 21
|
41 |
+
|
42 |
+
[-1, 1, MP, []], # 22-P5/32
|
43 |
+
[-1, 1, Conv, [256, 1, 1]],
|
44 |
+
[-2, 1, Conv, [256, 1, 1]],
|
45 |
+
[-1, 1, Conv, [256, 3, 1]],
|
46 |
+
[-1, 1, Conv, [256, 3, 1]],
|
47 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
48 |
+
[-1, 1, Conv, [512, 1, 1]], # 28
|
49 |
+
]
|
50 |
+
|
51 |
+
# YOLOv7-tiny head
|
52 |
+
head:
|
53 |
+
[[-1, 1, Conv, [256, 1, 1]],
|
54 |
+
[-2, 1, Conv, [256, 1, 1]],
|
55 |
+
[-1, 1, SP, [5]],
|
56 |
+
[-2, 1, SP, [9]],
|
57 |
+
[-3, 1, SP, [13]],
|
58 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
59 |
+
[-1, 1, Conv, [256, 1, 1]],
|
60 |
+
[[-1, -7], 1, Concat, [1]],
|
61 |
+
[-1, 1, Conv, [256, 1, 1]], # 37
|
62 |
+
|
63 |
+
[-1, 1, Conv, [128, 1, 1]],
|
64 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
65 |
+
[21, 1, Conv, [128, 1, 1]], # route backbone P4
|
66 |
+
[[-1, -2], 1, Concat, [1]],
|
67 |
+
|
68 |
+
[-1, 1, Conv, [64, 1, 1]],
|
69 |
+
[-2, 1, Conv, [64, 1, 1]],
|
70 |
+
[-1, 1, Conv, [64, 3, 1]],
|
71 |
+
[-1, 1, Conv, [64, 3, 1]],
|
72 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
73 |
+
[-1, 1, Conv, [128, 1, 1]], # 47
|
74 |
+
|
75 |
+
[-1, 1, Conv, [64, 1, 1]],
|
76 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
77 |
+
[14, 1, Conv, [64, 1, 1]], # route backbone P3
|
78 |
+
[[-1, -2], 1, Concat, [1]],
|
79 |
+
|
80 |
+
[-1, 1, Conv, [32, 1, 1]],
|
81 |
+
[-2, 1, Conv, [32, 1, 1]],
|
82 |
+
[-1, 1, Conv, [32, 3, 1]],
|
83 |
+
[-1, 1, Conv, [32, 3, 1]],
|
84 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
85 |
+
[-1, 1, Conv, [64, 1, 1]], # 57
|
86 |
+
|
87 |
+
[-1, 1, Conv, [128, 3, 2]],
|
88 |
+
[[-1, 47], 1, Concat, [1]],
|
89 |
+
|
90 |
+
[-1, 1, Conv, [64, 1, 1]],
|
91 |
+
[-2, 1, Conv, [64, 1, 1]],
|
92 |
+
[-1, 1, Conv, [64, 3, 1]],
|
93 |
+
[-1, 1, Conv, [64, 3, 1]],
|
94 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
95 |
+
[-1, 1, Conv, [128, 1, 1]], # 65
|
96 |
+
|
97 |
+
[-1, 1, Conv, [256, 3, 2]],
|
98 |
+
[[-1, 37], 1, Concat, [1]],
|
99 |
+
|
100 |
+
[-1, 1, Conv, [128, 1, 1]],
|
101 |
+
[-2, 1, Conv, [128, 1, 1]],
|
102 |
+
[-1, 1, Conv, [128, 3, 1]],
|
103 |
+
[-1, 1, Conv, [128, 3, 1]],
|
104 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
105 |
+
[-1, 1, Conv, [256, 1, 1]], # 73
|
106 |
+
|
107 |
+
[57, 1, Conv, [128, 3, 1]],
|
108 |
+
[65, 1, Conv, [256, 3, 1]],
|
109 |
+
[73, 1, Conv, [512, 3, 1]],
|
110 |
+
|
111 |
+
[[74,75,76], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
112 |
+
]
|
cfg/deploy/yolov7-tiny.yaml
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [10,13, 16,30, 33,23] # P3/8
|
9 |
+
- [30,61, 62,45, 59,119] # P4/16
|
10 |
+
- [116,90, 156,198, 373,326] # P5/32
|
11 |
+
|
12 |
+
# yolov7-tiny backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args] c2, k=1, s=1, p=None, g=1, act=True
|
15 |
+
[[-1, 1, Conv, [32, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 0-P1/2
|
16 |
+
|
17 |
+
[-1, 1, Conv, [64, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 1-P2/4
|
18 |
+
|
19 |
+
[-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
20 |
+
[-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
21 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
22 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
23 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
24 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 7
|
25 |
+
|
26 |
+
[-1, 1, MP, []], # 8-P3/8
|
27 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
28 |
+
[-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
29 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
30 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
31 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
32 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 14
|
33 |
+
|
34 |
+
[-1, 1, MP, []], # 15-P4/16
|
35 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
36 |
+
[-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
39 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
40 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 21
|
41 |
+
|
42 |
+
[-1, 1, MP, []], # 22-P5/32
|
43 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
44 |
+
[-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
45 |
+
[-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
46 |
+
[-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
47 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
48 |
+
[-1, 1, Conv, [512, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 28
|
49 |
+
]
|
50 |
+
|
51 |
+
# yolov7-tiny head
|
52 |
+
head:
|
53 |
+
[[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
54 |
+
[-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
55 |
+
[-1, 1, SP, [5]],
|
56 |
+
[-2, 1, SP, [9]],
|
57 |
+
[-3, 1, SP, [13]],
|
58 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
59 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
60 |
+
[[-1, -7], 1, Concat, [1]],
|
61 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 37
|
62 |
+
|
63 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
64 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
65 |
+
[21, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P4
|
66 |
+
[[-1, -2], 1, Concat, [1]],
|
67 |
+
|
68 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
69 |
+
[-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
70 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
71 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
72 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
73 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 47
|
74 |
+
|
75 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
76 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
77 |
+
[14, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P3
|
78 |
+
[[-1, -2], 1, Concat, [1]],
|
79 |
+
|
80 |
+
[-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
81 |
+
[-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
82 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
83 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
84 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
85 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 57
|
86 |
+
|
87 |
+
[-1, 1, Conv, [128, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
|
88 |
+
[[-1, 47], 1, Concat, [1]],
|
89 |
+
|
90 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
91 |
+
[-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
92 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
93 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
94 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
95 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 65
|
96 |
+
|
97 |
+
[-1, 1, Conv, [256, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
|
98 |
+
[[-1, 37], 1, Concat, [1]],
|
99 |
+
|
100 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
101 |
+
[-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
102 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
103 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
104 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
105 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 73
|
106 |
+
|
107 |
+
[57, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
108 |
+
[65, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
109 |
+
[73, 1, Conv, [512, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
110 |
+
|
111 |
+
[[74,75,76], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
112 |
+
]
|
cfg/deploy/yolov7-w6.yaml
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7-w6 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args]
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, Conv, [128, 3, 2]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
27 |
+
[-1, 1, Conv, [128, 1, 1]], # 10
|
28 |
+
|
29 |
+
[-1, 1, Conv, [256, 3, 2]], # 11-P3/8
|
30 |
+
[-1, 1, Conv, [128, 1, 1]],
|
31 |
+
[-2, 1, Conv, [128, 1, 1]],
|
32 |
+
[-1, 1, Conv, [128, 3, 1]],
|
33 |
+
[-1, 1, Conv, [128, 3, 1]],
|
34 |
+
[-1, 1, Conv, [128, 3, 1]],
|
35 |
+
[-1, 1, Conv, [128, 3, 1]],
|
36 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
37 |
+
[-1, 1, Conv, [256, 1, 1]], # 19
|
38 |
+
|
39 |
+
[-1, 1, Conv, [512, 3, 2]], # 20-P4/16
|
40 |
+
[-1, 1, Conv, [256, 1, 1]],
|
41 |
+
[-2, 1, Conv, [256, 1, 1]],
|
42 |
+
[-1, 1, Conv, [256, 3, 1]],
|
43 |
+
[-1, 1, Conv, [256, 3, 1]],
|
44 |
+
[-1, 1, Conv, [256, 3, 1]],
|
45 |
+
[-1, 1, Conv, [256, 3, 1]],
|
46 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
47 |
+
[-1, 1, Conv, [512, 1, 1]], # 28
|
48 |
+
|
49 |
+
[-1, 1, Conv, [768, 3, 2]], # 29-P5/32
|
50 |
+
[-1, 1, Conv, [384, 1, 1]],
|
51 |
+
[-2, 1, Conv, [384, 1, 1]],
|
52 |
+
[-1, 1, Conv, [384, 3, 1]],
|
53 |
+
[-1, 1, Conv, [384, 3, 1]],
|
54 |
+
[-1, 1, Conv, [384, 3, 1]],
|
55 |
+
[-1, 1, Conv, [384, 3, 1]],
|
56 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
57 |
+
[-1, 1, Conv, [768, 1, 1]], # 37
|
58 |
+
|
59 |
+
[-1, 1, Conv, [1024, 3, 2]], # 38-P6/64
|
60 |
+
[-1, 1, Conv, [512, 1, 1]],
|
61 |
+
[-2, 1, Conv, [512, 1, 1]],
|
62 |
+
[-1, 1, Conv, [512, 3, 1]],
|
63 |
+
[-1, 1, Conv, [512, 3, 1]],
|
64 |
+
[-1, 1, Conv, [512, 3, 1]],
|
65 |
+
[-1, 1, Conv, [512, 3, 1]],
|
66 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
67 |
+
[-1, 1, Conv, [1024, 1, 1]], # 46
|
68 |
+
]
|
69 |
+
|
70 |
+
# yolov7-w6 head
|
71 |
+
head:
|
72 |
+
[[-1, 1, SPPCSPC, [512]], # 47
|
73 |
+
|
74 |
+
[-1, 1, Conv, [384, 1, 1]],
|
75 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
76 |
+
[37, 1, Conv, [384, 1, 1]], # route backbone P5
|
77 |
+
[[-1, -2], 1, Concat, [1]],
|
78 |
+
|
79 |
+
[-1, 1, Conv, [384, 1, 1]],
|
80 |
+
[-2, 1, Conv, [384, 1, 1]],
|
81 |
+
[-1, 1, Conv, [192, 3, 1]],
|
82 |
+
[-1, 1, Conv, [192, 3, 1]],
|
83 |
+
[-1, 1, Conv, [192, 3, 1]],
|
84 |
+
[-1, 1, Conv, [192, 3, 1]],
|
85 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
86 |
+
[-1, 1, Conv, [384, 1, 1]], # 59
|
87 |
+
|
88 |
+
[-1, 1, Conv, [256, 1, 1]],
|
89 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
90 |
+
[28, 1, Conv, [256, 1, 1]], # route backbone P4
|
91 |
+
[[-1, -2], 1, Concat, [1]],
|
92 |
+
|
93 |
+
[-1, 1, Conv, [256, 1, 1]],
|
94 |
+
[-2, 1, Conv, [256, 1, 1]],
|
95 |
+
[-1, 1, Conv, [128, 3, 1]],
|
96 |
+
[-1, 1, Conv, [128, 3, 1]],
|
97 |
+
[-1, 1, Conv, [128, 3, 1]],
|
98 |
+
[-1, 1, Conv, [128, 3, 1]],
|
99 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
100 |
+
[-1, 1, Conv, [256, 1, 1]], # 71
|
101 |
+
|
102 |
+
[-1, 1, Conv, [128, 1, 1]],
|
103 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
104 |
+
[19, 1, Conv, [128, 1, 1]], # route backbone P3
|
105 |
+
[[-1, -2], 1, Concat, [1]],
|
106 |
+
|
107 |
+
[-1, 1, Conv, [128, 1, 1]],
|
108 |
+
[-2, 1, Conv, [128, 1, 1]],
|
109 |
+
[-1, 1, Conv, [64, 3, 1]],
|
110 |
+
[-1, 1, Conv, [64, 3, 1]],
|
111 |
+
[-1, 1, Conv, [64, 3, 1]],
|
112 |
+
[-1, 1, Conv, [64, 3, 1]],
|
113 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
114 |
+
[-1, 1, Conv, [128, 1, 1]], # 83
|
115 |
+
|
116 |
+
[-1, 1, Conv, [256, 3, 2]],
|
117 |
+
[[-1, 71], 1, Concat, [1]], # cat
|
118 |
+
|
119 |
+
[-1, 1, Conv, [256, 1, 1]],
|
120 |
+
[-2, 1, Conv, [256, 1, 1]],
|
121 |
+
[-1, 1, Conv, [128, 3, 1]],
|
122 |
+
[-1, 1, Conv, [128, 3, 1]],
|
123 |
+
[-1, 1, Conv, [128, 3, 1]],
|
124 |
+
[-1, 1, Conv, [128, 3, 1]],
|
125 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
126 |
+
[-1, 1, Conv, [256, 1, 1]], # 93
|
127 |
+
|
128 |
+
[-1, 1, Conv, [384, 3, 2]],
|
129 |
+
[[-1, 59], 1, Concat, [1]], # cat
|
130 |
+
|
131 |
+
[-1, 1, Conv, [384, 1, 1]],
|
132 |
+
[-2, 1, Conv, [384, 1, 1]],
|
133 |
+
[-1, 1, Conv, [192, 3, 1]],
|
134 |
+
[-1, 1, Conv, [192, 3, 1]],
|
135 |
+
[-1, 1, Conv, [192, 3, 1]],
|
136 |
+
[-1, 1, Conv, [192, 3, 1]],
|
137 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
138 |
+
[-1, 1, Conv, [384, 1, 1]], # 103
|
139 |
+
|
140 |
+
[-1, 1, Conv, [512, 3, 2]],
|
141 |
+
[[-1, 47], 1, Concat, [1]], # cat
|
142 |
+
|
143 |
+
[-1, 1, Conv, [512, 1, 1]],
|
144 |
+
[-2, 1, Conv, [512, 1, 1]],
|
145 |
+
[-1, 1, Conv, [256, 3, 1]],
|
146 |
+
[-1, 1, Conv, [256, 3, 1]],
|
147 |
+
[-1, 1, Conv, [256, 3, 1]],
|
148 |
+
[-1, 1, Conv, [256, 3, 1]],
|
149 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
150 |
+
[-1, 1, Conv, [512, 1, 1]], # 113
|
151 |
+
|
152 |
+
[83, 1, Conv, [256, 3, 1]],
|
153 |
+
[93, 1, Conv, [512, 3, 1]],
|
154 |
+
[103, 1, Conv, [768, 3, 1]],
|
155 |
+
[113, 1, Conv, [1024, 3, 1]],
|
156 |
+
|
157 |
+
[[114,115,116,117], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
158 |
+
]
|
cfg/deploy/yolov7.yaml
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# yolov7 backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
|
17 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
18 |
+
[-1, 1, Conv, [64, 3, 1]],
|
19 |
+
|
20 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
21 |
+
[-1, 1, Conv, [64, 1, 1]],
|
22 |
+
[-2, 1, Conv, [64, 1, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
28 |
+
[-1, 1, Conv, [256, 1, 1]], # 11
|
29 |
+
|
30 |
+
[-1, 1, MP, []],
|
31 |
+
[-1, 1, Conv, [128, 1, 1]],
|
32 |
+
[-3, 1, Conv, [128, 1, 1]],
|
33 |
+
[-1, 1, Conv, [128, 3, 2]],
|
34 |
+
[[-1, -3], 1, Concat, [1]], # 16-P3/8
|
35 |
+
[-1, 1, Conv, [128, 1, 1]],
|
36 |
+
[-2, 1, Conv, [128, 1, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[-1, 1, Conv, [128, 3, 1]],
|
41 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
42 |
+
[-1, 1, Conv, [512, 1, 1]], # 24
|
43 |
+
|
44 |
+
[-1, 1, MP, []],
|
45 |
+
[-1, 1, Conv, [256, 1, 1]],
|
46 |
+
[-3, 1, Conv, [256, 1, 1]],
|
47 |
+
[-1, 1, Conv, [256, 3, 2]],
|
48 |
+
[[-1, -3], 1, Concat, [1]], # 29-P4/16
|
49 |
+
[-1, 1, Conv, [256, 1, 1]],
|
50 |
+
[-2, 1, Conv, [256, 1, 1]],
|
51 |
+
[-1, 1, Conv, [256, 3, 1]],
|
52 |
+
[-1, 1, Conv, [256, 3, 1]],
|
53 |
+
[-1, 1, Conv, [256, 3, 1]],
|
54 |
+
[-1, 1, Conv, [256, 3, 1]],
|
55 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
56 |
+
[-1, 1, Conv, [1024, 1, 1]], # 37
|
57 |
+
|
58 |
+
[-1, 1, MP, []],
|
59 |
+
[-1, 1, Conv, [512, 1, 1]],
|
60 |
+
[-3, 1, Conv, [512, 1, 1]],
|
61 |
+
[-1, 1, Conv, [512, 3, 2]],
|
62 |
+
[[-1, -3], 1, Concat, [1]], # 42-P5/32
|
63 |
+
[-1, 1, Conv, [256, 1, 1]],
|
64 |
+
[-2, 1, Conv, [256, 1, 1]],
|
65 |
+
[-1, 1, Conv, [256, 3, 1]],
|
66 |
+
[-1, 1, Conv, [256, 3, 1]],
|
67 |
+
[-1, 1, Conv, [256, 3, 1]],
|
68 |
+
[-1, 1, Conv, [256, 3, 1]],
|
69 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
70 |
+
[-1, 1, Conv, [1024, 1, 1]], # 50
|
71 |
+
]
|
72 |
+
|
73 |
+
# yolov7 head
|
74 |
+
head:
|
75 |
+
[[-1, 1, SPPCSPC, [512]], # 51
|
76 |
+
|
77 |
+
[-1, 1, Conv, [256, 1, 1]],
|
78 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
79 |
+
[37, 1, Conv, [256, 1, 1]], # route backbone P4
|
80 |
+
[[-1, -2], 1, Concat, [1]],
|
81 |
+
|
82 |
+
[-1, 1, Conv, [256, 1, 1]],
|
83 |
+
[-2, 1, Conv, [256, 1, 1]],
|
84 |
+
[-1, 1, Conv, [128, 3, 1]],
|
85 |
+
[-1, 1, Conv, [128, 3, 1]],
|
86 |
+
[-1, 1, Conv, [128, 3, 1]],
|
87 |
+
[-1, 1, Conv, [128, 3, 1]],
|
88 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
89 |
+
[-1, 1, Conv, [256, 1, 1]], # 63
|
90 |
+
|
91 |
+
[-1, 1, Conv, [128, 1, 1]],
|
92 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
93 |
+
[24, 1, Conv, [128, 1, 1]], # route backbone P3
|
94 |
+
[[-1, -2], 1, Concat, [1]],
|
95 |
+
|
96 |
+
[-1, 1, Conv, [128, 1, 1]],
|
97 |
+
[-2, 1, Conv, [128, 1, 1]],
|
98 |
+
[-1, 1, Conv, [64, 3, 1]],
|
99 |
+
[-1, 1, Conv, [64, 3, 1]],
|
100 |
+
[-1, 1, Conv, [64, 3, 1]],
|
101 |
+
[-1, 1, Conv, [64, 3, 1]],
|
102 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
103 |
+
[-1, 1, Conv, [128, 1, 1]], # 75
|
104 |
+
|
105 |
+
[-1, 1, MP, []],
|
106 |
+
[-1, 1, Conv, [128, 1, 1]],
|
107 |
+
[-3, 1, Conv, [128, 1, 1]],
|
108 |
+
[-1, 1, Conv, [128, 3, 2]],
|
109 |
+
[[-1, -3, 63], 1, Concat, [1]],
|
110 |
+
|
111 |
+
[-1, 1, Conv, [256, 1, 1]],
|
112 |
+
[-2, 1, Conv, [256, 1, 1]],
|
113 |
+
[-1, 1, Conv, [128, 3, 1]],
|
114 |
+
[-1, 1, Conv, [128, 3, 1]],
|
115 |
+
[-1, 1, Conv, [128, 3, 1]],
|
116 |
+
[-1, 1, Conv, [128, 3, 1]],
|
117 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
118 |
+
[-1, 1, Conv, [256, 1, 1]], # 88
|
119 |
+
|
120 |
+
[-1, 1, MP, []],
|
121 |
+
[-1, 1, Conv, [256, 1, 1]],
|
122 |
+
[-3, 1, Conv, [256, 1, 1]],
|
123 |
+
[-1, 1, Conv, [256, 3, 2]],
|
124 |
+
[[-1, -3, 51], 1, Concat, [1]],
|
125 |
+
|
126 |
+
[-1, 1, Conv, [512, 1, 1]],
|
127 |
+
[-2, 1, Conv, [512, 1, 1]],
|
128 |
+
[-1, 1, Conv, [256, 3, 1]],
|
129 |
+
[-1, 1, Conv, [256, 3, 1]],
|
130 |
+
[-1, 1, Conv, [256, 3, 1]],
|
131 |
+
[-1, 1, Conv, [256, 3, 1]],
|
132 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
133 |
+
[-1, 1, Conv, [512, 1, 1]], # 101
|
134 |
+
|
135 |
+
[75, 1, RepConv, [256, 3, 1]],
|
136 |
+
[88, 1, RepConv, [512, 3, 1]],
|
137 |
+
[101, 1, RepConv, [1024, 3, 1]],
|
138 |
+
|
139 |
+
[[102,103,104], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
140 |
+
]
|
cfg/deploy/yolov7x.yaml
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# yolov7x backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [40, 3, 1]], # 0
|
16 |
+
|
17 |
+
[-1, 1, Conv, [80, 3, 2]], # 1-P1/2
|
18 |
+
[-1, 1, Conv, [80, 3, 1]],
|
19 |
+
|
20 |
+
[-1, 1, Conv, [160, 3, 2]], # 3-P2/4
|
21 |
+
[-1, 1, Conv, [64, 1, 1]],
|
22 |
+
[-2, 1, Conv, [64, 1, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[-1, 1, Conv, [64, 3, 1]],
|
29 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
30 |
+
[-1, 1, Conv, [320, 1, 1]], # 13
|
31 |
+
|
32 |
+
[-1, 1, MP, []],
|
33 |
+
[-1, 1, Conv, [160, 1, 1]],
|
34 |
+
[-3, 1, Conv, [160, 1, 1]],
|
35 |
+
[-1, 1, Conv, [160, 3, 2]],
|
36 |
+
[[-1, -3], 1, Concat, [1]], # 18-P3/8
|
37 |
+
[-1, 1, Conv, [128, 1, 1]],
|
38 |
+
[-2, 1, Conv, [128, 1, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[-1, 1, Conv, [128, 3, 1]],
|
41 |
+
[-1, 1, Conv, [128, 3, 1]],
|
42 |
+
[-1, 1, Conv, [128, 3, 1]],
|
43 |
+
[-1, 1, Conv, [128, 3, 1]],
|
44 |
+
[-1, 1, Conv, [128, 3, 1]],
|
45 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
46 |
+
[-1, 1, Conv, [640, 1, 1]], # 28
|
47 |
+
|
48 |
+
[-1, 1, MP, []],
|
49 |
+
[-1, 1, Conv, [320, 1, 1]],
|
50 |
+
[-3, 1, Conv, [320, 1, 1]],
|
51 |
+
[-1, 1, Conv, [320, 3, 2]],
|
52 |
+
[[-1, -3], 1, Concat, [1]], # 33-P4/16
|
53 |
+
[-1, 1, Conv, [256, 1, 1]],
|
54 |
+
[-2, 1, Conv, [256, 1, 1]],
|
55 |
+
[-1, 1, Conv, [256, 3, 1]],
|
56 |
+
[-1, 1, Conv, [256, 3, 1]],
|
57 |
+
[-1, 1, Conv, [256, 3, 1]],
|
58 |
+
[-1, 1, Conv, [256, 3, 1]],
|
59 |
+
[-1, 1, Conv, [256, 3, 1]],
|
60 |
+
[-1, 1, Conv, [256, 3, 1]],
|
61 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
62 |
+
[-1, 1, Conv, [1280, 1, 1]], # 43
|
63 |
+
|
64 |
+
[-1, 1, MP, []],
|
65 |
+
[-1, 1, Conv, [640, 1, 1]],
|
66 |
+
[-3, 1, Conv, [640, 1, 1]],
|
67 |
+
[-1, 1, Conv, [640, 3, 2]],
|
68 |
+
[[-1, -3], 1, Concat, [1]], # 48-P5/32
|
69 |
+
[-1, 1, Conv, [256, 1, 1]],
|
70 |
+
[-2, 1, Conv, [256, 1, 1]],
|
71 |
+
[-1, 1, Conv, [256, 3, 1]],
|
72 |
+
[-1, 1, Conv, [256, 3, 1]],
|
73 |
+
[-1, 1, Conv, [256, 3, 1]],
|
74 |
+
[-1, 1, Conv, [256, 3, 1]],
|
75 |
+
[-1, 1, Conv, [256, 3, 1]],
|
76 |
+
[-1, 1, Conv, [256, 3, 1]],
|
77 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
78 |
+
[-1, 1, Conv, [1280, 1, 1]], # 58
|
79 |
+
]
|
80 |
+
|
81 |
+
# yolov7x head
|
82 |
+
head:
|
83 |
+
[[-1, 1, SPPCSPC, [640]], # 59
|
84 |
+
|
85 |
+
[-1, 1, Conv, [320, 1, 1]],
|
86 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
87 |
+
[43, 1, Conv, [320, 1, 1]], # route backbone P4
|
88 |
+
[[-1, -2], 1, Concat, [1]],
|
89 |
+
|
90 |
+
[-1, 1, Conv, [256, 1, 1]],
|
91 |
+
[-2, 1, Conv, [256, 1, 1]],
|
92 |
+
[-1, 1, Conv, [256, 3, 1]],
|
93 |
+
[-1, 1, Conv, [256, 3, 1]],
|
94 |
+
[-1, 1, Conv, [256, 3, 1]],
|
95 |
+
[-1, 1, Conv, [256, 3, 1]],
|
96 |
+
[-1, 1, Conv, [256, 3, 1]],
|
97 |
+
[-1, 1, Conv, [256, 3, 1]],
|
98 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
99 |
+
[-1, 1, Conv, [320, 1, 1]], # 73
|
100 |
+
|
101 |
+
[-1, 1, Conv, [160, 1, 1]],
|
102 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
103 |
+
[28, 1, Conv, [160, 1, 1]], # route backbone P3
|
104 |
+
[[-1, -2], 1, Concat, [1]],
|
105 |
+
|
106 |
+
[-1, 1, Conv, [128, 1, 1]],
|
107 |
+
[-2, 1, Conv, [128, 1, 1]],
|
108 |
+
[-1, 1, Conv, [128, 3, 1]],
|
109 |
+
[-1, 1, Conv, [128, 3, 1]],
|
110 |
+
[-1, 1, Conv, [128, 3, 1]],
|
111 |
+
[-1, 1, Conv, [128, 3, 1]],
|
112 |
+
[-1, 1, Conv, [128, 3, 1]],
|
113 |
+
[-1, 1, Conv, [128, 3, 1]],
|
114 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
115 |
+
[-1, 1, Conv, [160, 1, 1]], # 87
|
116 |
+
|
117 |
+
[-1, 1, MP, []],
|
118 |
+
[-1, 1, Conv, [160, 1, 1]],
|
119 |
+
[-3, 1, Conv, [160, 1, 1]],
|
120 |
+
[-1, 1, Conv, [160, 3, 2]],
|
121 |
+
[[-1, -3, 73], 1, Concat, [1]],
|
122 |
+
|
123 |
+
[-1, 1, Conv, [256, 1, 1]],
|
124 |
+
[-2, 1, Conv, [256, 1, 1]],
|
125 |
+
[-1, 1, Conv, [256, 3, 1]],
|
126 |
+
[-1, 1, Conv, [256, 3, 1]],
|
127 |
+
[-1, 1, Conv, [256, 3, 1]],
|
128 |
+
[-1, 1, Conv, [256, 3, 1]],
|
129 |
+
[-1, 1, Conv, [256, 3, 1]],
|
130 |
+
[-1, 1, Conv, [256, 3, 1]],
|
131 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
132 |
+
[-1, 1, Conv, [320, 1, 1]], # 102
|
133 |
+
|
134 |
+
[-1, 1, MP, []],
|
135 |
+
[-1, 1, Conv, [320, 1, 1]],
|
136 |
+
[-3, 1, Conv, [320, 1, 1]],
|
137 |
+
[-1, 1, Conv, [320, 3, 2]],
|
138 |
+
[[-1, -3, 59], 1, Concat, [1]],
|
139 |
+
|
140 |
+
[-1, 1, Conv, [512, 1, 1]],
|
141 |
+
[-2, 1, Conv, [512, 1, 1]],
|
142 |
+
[-1, 1, Conv, [512, 3, 1]],
|
143 |
+
[-1, 1, Conv, [512, 3, 1]],
|
144 |
+
[-1, 1, Conv, [512, 3, 1]],
|
145 |
+
[-1, 1, Conv, [512, 3, 1]],
|
146 |
+
[-1, 1, Conv, [512, 3, 1]],
|
147 |
+
[-1, 1, Conv, [512, 3, 1]],
|
148 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
149 |
+
[-1, 1, Conv, [640, 1, 1]], # 117
|
150 |
+
|
151 |
+
[87, 1, Conv, [320, 3, 1]],
|
152 |
+
[102, 1, Conv, [640, 3, 1]],
|
153 |
+
[117, 1, Conv, [1280, 3, 1]],
|
154 |
+
|
155 |
+
[[118,119,120], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
|
156 |
+
]
|
cfg/training/yolov7-d6.yaml
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args],
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [96, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, DownC, [192]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[-1, 1, Conv, [64, 3, 1]],
|
29 |
+
[-1, 1, Conv, [64, 3, 1]],
|
30 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
31 |
+
[-1, 1, Conv, [192, 1, 1]], # 14
|
32 |
+
|
33 |
+
[-1, 1, DownC, [384]], # 15-P3/8
|
34 |
+
[-1, 1, Conv, [128, 1, 1]],
|
35 |
+
[-2, 1, Conv, [128, 1, 1]],
|
36 |
+
[-1, 1, Conv, [128, 3, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[-1, 1, Conv, [128, 3, 1]],
|
41 |
+
[-1, 1, Conv, [128, 3, 1]],
|
42 |
+
[-1, 1, Conv, [128, 3, 1]],
|
43 |
+
[-1, 1, Conv, [128, 3, 1]],
|
44 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
45 |
+
[-1, 1, Conv, [384, 1, 1]], # 27
|
46 |
+
|
47 |
+
[-1, 1, DownC, [768]], # 28-P4/16
|
48 |
+
[-1, 1, Conv, [256, 1, 1]],
|
49 |
+
[-2, 1, Conv, [256, 1, 1]],
|
50 |
+
[-1, 1, Conv, [256, 3, 1]],
|
51 |
+
[-1, 1, Conv, [256, 3, 1]],
|
52 |
+
[-1, 1, Conv, [256, 3, 1]],
|
53 |
+
[-1, 1, Conv, [256, 3, 1]],
|
54 |
+
[-1, 1, Conv, [256, 3, 1]],
|
55 |
+
[-1, 1, Conv, [256, 3, 1]],
|
56 |
+
[-1, 1, Conv, [256, 3, 1]],
|
57 |
+
[-1, 1, Conv, [256, 3, 1]],
|
58 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
59 |
+
[-1, 1, Conv, [768, 1, 1]], # 40
|
60 |
+
|
61 |
+
[-1, 1, DownC, [1152]], # 41-P5/32
|
62 |
+
[-1, 1, Conv, [384, 1, 1]],
|
63 |
+
[-2, 1, Conv, [384, 1, 1]],
|
64 |
+
[-1, 1, Conv, [384, 3, 1]],
|
65 |
+
[-1, 1, Conv, [384, 3, 1]],
|
66 |
+
[-1, 1, Conv, [384, 3, 1]],
|
67 |
+
[-1, 1, Conv, [384, 3, 1]],
|
68 |
+
[-1, 1, Conv, [384, 3, 1]],
|
69 |
+
[-1, 1, Conv, [384, 3, 1]],
|
70 |
+
[-1, 1, Conv, [384, 3, 1]],
|
71 |
+
[-1, 1, Conv, [384, 3, 1]],
|
72 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
73 |
+
[-1, 1, Conv, [1152, 1, 1]], # 53
|
74 |
+
|
75 |
+
[-1, 1, DownC, [1536]], # 54-P6/64
|
76 |
+
[-1, 1, Conv, [512, 1, 1]],
|
77 |
+
[-2, 1, Conv, [512, 1, 1]],
|
78 |
+
[-1, 1, Conv, [512, 3, 1]],
|
79 |
+
[-1, 1, Conv, [512, 3, 1]],
|
80 |
+
[-1, 1, Conv, [512, 3, 1]],
|
81 |
+
[-1, 1, Conv, [512, 3, 1]],
|
82 |
+
[-1, 1, Conv, [512, 3, 1]],
|
83 |
+
[-1, 1, Conv, [512, 3, 1]],
|
84 |
+
[-1, 1, Conv, [512, 3, 1]],
|
85 |
+
[-1, 1, Conv, [512, 3, 1]],
|
86 |
+
[[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
|
87 |
+
[-1, 1, Conv, [1536, 1, 1]], # 66
|
88 |
+
]
|
89 |
+
|
90 |
+
# yolov7 head
|
91 |
+
head:
|
92 |
+
[[-1, 1, SPPCSPC, [768]], # 67
|
93 |
+
|
94 |
+
[-1, 1, Conv, [576, 1, 1]],
|
95 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
96 |
+
[53, 1, Conv, [576, 1, 1]], # route backbone P5
|
97 |
+
[[-1, -2], 1, Concat, [1]],
|
98 |
+
|
99 |
+
[-1, 1, Conv, [384, 1, 1]],
|
100 |
+
[-2, 1, Conv, [384, 1, 1]],
|
101 |
+
[-1, 1, Conv, [192, 3, 1]],
|
102 |
+
[-1, 1, Conv, [192, 3, 1]],
|
103 |
+
[-1, 1, Conv, [192, 3, 1]],
|
104 |
+
[-1, 1, Conv, [192, 3, 1]],
|
105 |
+
[-1, 1, Conv, [192, 3, 1]],
|
106 |
+
[-1, 1, Conv, [192, 3, 1]],
|
107 |
+
[-1, 1, Conv, [192, 3, 1]],
|
108 |
+
[-1, 1, Conv, [192, 3, 1]],
|
109 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
110 |
+
[-1, 1, Conv, [576, 1, 1]], # 83
|
111 |
+
|
112 |
+
[-1, 1, Conv, [384, 1, 1]],
|
113 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
114 |
+
[40, 1, Conv, [384, 1, 1]], # route backbone P4
|
115 |
+
[[-1, -2], 1, Concat, [1]],
|
116 |
+
|
117 |
+
[-1, 1, Conv, [256, 1, 1]],
|
118 |
+
[-2, 1, Conv, [256, 1, 1]],
|
119 |
+
[-1, 1, Conv, [128, 3, 1]],
|
120 |
+
[-1, 1, Conv, [128, 3, 1]],
|
121 |
+
[-1, 1, Conv, [128, 3, 1]],
|
122 |
+
[-1, 1, Conv, [128, 3, 1]],
|
123 |
+
[-1, 1, Conv, [128, 3, 1]],
|
124 |
+
[-1, 1, Conv, [128, 3, 1]],
|
125 |
+
[-1, 1, Conv, [128, 3, 1]],
|
126 |
+
[-1, 1, Conv, [128, 3, 1]],
|
127 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
128 |
+
[-1, 1, Conv, [384, 1, 1]], # 99
|
129 |
+
|
130 |
+
[-1, 1, Conv, [192, 1, 1]],
|
131 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
132 |
+
[27, 1, Conv, [192, 1, 1]], # route backbone P3
|
133 |
+
[[-1, -2], 1, Concat, [1]],
|
134 |
+
|
135 |
+
[-1, 1, Conv, [128, 1, 1]],
|
136 |
+
[-2, 1, Conv, [128, 1, 1]],
|
137 |
+
[-1, 1, Conv, [64, 3, 1]],
|
138 |
+
[-1, 1, Conv, [64, 3, 1]],
|
139 |
+
[-1, 1, Conv, [64, 3, 1]],
|
140 |
+
[-1, 1, Conv, [64, 3, 1]],
|
141 |
+
[-1, 1, Conv, [64, 3, 1]],
|
142 |
+
[-1, 1, Conv, [64, 3, 1]],
|
143 |
+
[-1, 1, Conv, [64, 3, 1]],
|
144 |
+
[-1, 1, Conv, [64, 3, 1]],
|
145 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
146 |
+
[-1, 1, Conv, [192, 1, 1]], # 115
|
147 |
+
|
148 |
+
[-1, 1, DownC, [384]],
|
149 |
+
[[-1, 99], 1, Concat, [1]],
|
150 |
+
|
151 |
+
[-1, 1, Conv, [256, 1, 1]],
|
152 |
+
[-2, 1, Conv, [256, 1, 1]],
|
153 |
+
[-1, 1, Conv, [128, 3, 1]],
|
154 |
+
[-1, 1, Conv, [128, 3, 1]],
|
155 |
+
[-1, 1, Conv, [128, 3, 1]],
|
156 |
+
[-1, 1, Conv, [128, 3, 1]],
|
157 |
+
[-1, 1, Conv, [128, 3, 1]],
|
158 |
+
[-1, 1, Conv, [128, 3, 1]],
|
159 |
+
[-1, 1, Conv, [128, 3, 1]],
|
160 |
+
[-1, 1, Conv, [128, 3, 1]],
|
161 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
162 |
+
[-1, 1, Conv, [384, 1, 1]], # 129
|
163 |
+
|
164 |
+
[-1, 1, DownC, [576]],
|
165 |
+
[[-1, 83], 1, Concat, [1]],
|
166 |
+
|
167 |
+
[-1, 1, Conv, [384, 1, 1]],
|
168 |
+
[-2, 1, Conv, [384, 1, 1]],
|
169 |
+
[-1, 1, Conv, [192, 3, 1]],
|
170 |
+
[-1, 1, Conv, [192, 3, 1]],
|
171 |
+
[-1, 1, Conv, [192, 3, 1]],
|
172 |
+
[-1, 1, Conv, [192, 3, 1]],
|
173 |
+
[-1, 1, Conv, [192, 3, 1]],
|
174 |
+
[-1, 1, Conv, [192, 3, 1]],
|
175 |
+
[-1, 1, Conv, [192, 3, 1]],
|
176 |
+
[-1, 1, Conv, [192, 3, 1]],
|
177 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
178 |
+
[-1, 1, Conv, [576, 1, 1]], # 143
|
179 |
+
|
180 |
+
[-1, 1, DownC, [768]],
|
181 |
+
[[-1, 67], 1, Concat, [1]],
|
182 |
+
|
183 |
+
[-1, 1, Conv, [512, 1, 1]],
|
184 |
+
[-2, 1, Conv, [512, 1, 1]],
|
185 |
+
[-1, 1, Conv, [256, 3, 1]],
|
186 |
+
[-1, 1, Conv, [256, 3, 1]],
|
187 |
+
[-1, 1, Conv, [256, 3, 1]],
|
188 |
+
[-1, 1, Conv, [256, 3, 1]],
|
189 |
+
[-1, 1, Conv, [256, 3, 1]],
|
190 |
+
[-1, 1, Conv, [256, 3, 1]],
|
191 |
+
[-1, 1, Conv, [256, 3, 1]],
|
192 |
+
[-1, 1, Conv, [256, 3, 1]],
|
193 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
|
194 |
+
[-1, 1, Conv, [768, 1, 1]], # 157
|
195 |
+
|
196 |
+
[115, 1, Conv, [384, 3, 1]],
|
197 |
+
[129, 1, Conv, [768, 3, 1]],
|
198 |
+
[143, 1, Conv, [1152, 3, 1]],
|
199 |
+
[157, 1, Conv, [1536, 3, 1]],
|
200 |
+
|
201 |
+
[115, 1, Conv, [384, 3, 1]],
|
202 |
+
[99, 1, Conv, [768, 3, 1]],
|
203 |
+
[83, 1, Conv, [1152, 3, 1]],
|
204 |
+
[67, 1, Conv, [1536, 3, 1]],
|
205 |
+
|
206 |
+
[[158,159,160,161,162,163,164,165], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
207 |
+
]
|
cfg/training/yolov7-e6.yaml
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args],
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [80, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, DownC, [160]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
29 |
+
[-1, 1, Conv, [160, 1, 1]], # 12
|
30 |
+
|
31 |
+
[-1, 1, DownC, [320]], # 13-P3/8
|
32 |
+
[-1, 1, Conv, [128, 1, 1]],
|
33 |
+
[-2, 1, Conv, [128, 1, 1]],
|
34 |
+
[-1, 1, Conv, [128, 3, 1]],
|
35 |
+
[-1, 1, Conv, [128, 3, 1]],
|
36 |
+
[-1, 1, Conv, [128, 3, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
41 |
+
[-1, 1, Conv, [320, 1, 1]], # 23
|
42 |
+
|
43 |
+
[-1, 1, DownC, [640]], # 24-P4/16
|
44 |
+
[-1, 1, Conv, [256, 1, 1]],
|
45 |
+
[-2, 1, Conv, [256, 1, 1]],
|
46 |
+
[-1, 1, Conv, [256, 3, 1]],
|
47 |
+
[-1, 1, Conv, [256, 3, 1]],
|
48 |
+
[-1, 1, Conv, [256, 3, 1]],
|
49 |
+
[-1, 1, Conv, [256, 3, 1]],
|
50 |
+
[-1, 1, Conv, [256, 3, 1]],
|
51 |
+
[-1, 1, Conv, [256, 3, 1]],
|
52 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
53 |
+
[-1, 1, Conv, [640, 1, 1]], # 34
|
54 |
+
|
55 |
+
[-1, 1, DownC, [960]], # 35-P5/32
|
56 |
+
[-1, 1, Conv, [384, 1, 1]],
|
57 |
+
[-2, 1, Conv, [384, 1, 1]],
|
58 |
+
[-1, 1, Conv, [384, 3, 1]],
|
59 |
+
[-1, 1, Conv, [384, 3, 1]],
|
60 |
+
[-1, 1, Conv, [384, 3, 1]],
|
61 |
+
[-1, 1, Conv, [384, 3, 1]],
|
62 |
+
[-1, 1, Conv, [384, 3, 1]],
|
63 |
+
[-1, 1, Conv, [384, 3, 1]],
|
64 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
65 |
+
[-1, 1, Conv, [960, 1, 1]], # 45
|
66 |
+
|
67 |
+
[-1, 1, DownC, [1280]], # 46-P6/64
|
68 |
+
[-1, 1, Conv, [512, 1, 1]],
|
69 |
+
[-2, 1, Conv, [512, 1, 1]],
|
70 |
+
[-1, 1, Conv, [512, 3, 1]],
|
71 |
+
[-1, 1, Conv, [512, 3, 1]],
|
72 |
+
[-1, 1, Conv, [512, 3, 1]],
|
73 |
+
[-1, 1, Conv, [512, 3, 1]],
|
74 |
+
[-1, 1, Conv, [512, 3, 1]],
|
75 |
+
[-1, 1, Conv, [512, 3, 1]],
|
76 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
77 |
+
[-1, 1, Conv, [1280, 1, 1]], # 56
|
78 |
+
]
|
79 |
+
|
80 |
+
# yolov7 head
|
81 |
+
head:
|
82 |
+
[[-1, 1, SPPCSPC, [640]], # 57
|
83 |
+
|
84 |
+
[-1, 1, Conv, [480, 1, 1]],
|
85 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
86 |
+
[45, 1, Conv, [480, 1, 1]], # route backbone P5
|
87 |
+
[[-1, -2], 1, Concat, [1]],
|
88 |
+
|
89 |
+
[-1, 1, Conv, [384, 1, 1]],
|
90 |
+
[-2, 1, Conv, [384, 1, 1]],
|
91 |
+
[-1, 1, Conv, [192, 3, 1]],
|
92 |
+
[-1, 1, Conv, [192, 3, 1]],
|
93 |
+
[-1, 1, Conv, [192, 3, 1]],
|
94 |
+
[-1, 1, Conv, [192, 3, 1]],
|
95 |
+
[-1, 1, Conv, [192, 3, 1]],
|
96 |
+
[-1, 1, Conv, [192, 3, 1]],
|
97 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
98 |
+
[-1, 1, Conv, [480, 1, 1]], # 71
|
99 |
+
|
100 |
+
[-1, 1, Conv, [320, 1, 1]],
|
101 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
102 |
+
[34, 1, Conv, [320, 1, 1]], # route backbone P4
|
103 |
+
[[-1, -2], 1, Concat, [1]],
|
104 |
+
|
105 |
+
[-1, 1, Conv, [256, 1, 1]],
|
106 |
+
[-2, 1, Conv, [256, 1, 1]],
|
107 |
+
[-1, 1, Conv, [128, 3, 1]],
|
108 |
+
[-1, 1, Conv, [128, 3, 1]],
|
109 |
+
[-1, 1, Conv, [128, 3, 1]],
|
110 |
+
[-1, 1, Conv, [128, 3, 1]],
|
111 |
+
[-1, 1, Conv, [128, 3, 1]],
|
112 |
+
[-1, 1, Conv, [128, 3, 1]],
|
113 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
114 |
+
[-1, 1, Conv, [320, 1, 1]], # 85
|
115 |
+
|
116 |
+
[-1, 1, Conv, [160, 1, 1]],
|
117 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
118 |
+
[23, 1, Conv, [160, 1, 1]], # route backbone P3
|
119 |
+
[[-1, -2], 1, Concat, [1]],
|
120 |
+
|
121 |
+
[-1, 1, Conv, [128, 1, 1]],
|
122 |
+
[-2, 1, Conv, [128, 1, 1]],
|
123 |
+
[-1, 1, Conv, [64, 3, 1]],
|
124 |
+
[-1, 1, Conv, [64, 3, 1]],
|
125 |
+
[-1, 1, Conv, [64, 3, 1]],
|
126 |
+
[-1, 1, Conv, [64, 3, 1]],
|
127 |
+
[-1, 1, Conv, [64, 3, 1]],
|
128 |
+
[-1, 1, Conv, [64, 3, 1]],
|
129 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
130 |
+
[-1, 1, Conv, [160, 1, 1]], # 99
|
131 |
+
|
132 |
+
[-1, 1, DownC, [320]],
|
133 |
+
[[-1, 85], 1, Concat, [1]],
|
134 |
+
|
135 |
+
[-1, 1, Conv, [256, 1, 1]],
|
136 |
+
[-2, 1, Conv, [256, 1, 1]],
|
137 |
+
[-1, 1, Conv, [128, 3, 1]],
|
138 |
+
[-1, 1, Conv, [128, 3, 1]],
|
139 |
+
[-1, 1, Conv, [128, 3, 1]],
|
140 |
+
[-1, 1, Conv, [128, 3, 1]],
|
141 |
+
[-1, 1, Conv, [128, 3, 1]],
|
142 |
+
[-1, 1, Conv, [128, 3, 1]],
|
143 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
144 |
+
[-1, 1, Conv, [320, 1, 1]], # 111
|
145 |
+
|
146 |
+
[-1, 1, DownC, [480]],
|
147 |
+
[[-1, 71], 1, Concat, [1]],
|
148 |
+
|
149 |
+
[-1, 1, Conv, [384, 1, 1]],
|
150 |
+
[-2, 1, Conv, [384, 1, 1]],
|
151 |
+
[-1, 1, Conv, [192, 3, 1]],
|
152 |
+
[-1, 1, Conv, [192, 3, 1]],
|
153 |
+
[-1, 1, Conv, [192, 3, 1]],
|
154 |
+
[-1, 1, Conv, [192, 3, 1]],
|
155 |
+
[-1, 1, Conv, [192, 3, 1]],
|
156 |
+
[-1, 1, Conv, [192, 3, 1]],
|
157 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
158 |
+
[-1, 1, Conv, [480, 1, 1]], # 123
|
159 |
+
|
160 |
+
[-1, 1, DownC, [640]],
|
161 |
+
[[-1, 57], 1, Concat, [1]],
|
162 |
+
|
163 |
+
[-1, 1, Conv, [512, 1, 1]],
|
164 |
+
[-2, 1, Conv, [512, 1, 1]],
|
165 |
+
[-1, 1, Conv, [256, 3, 1]],
|
166 |
+
[-1, 1, Conv, [256, 3, 1]],
|
167 |
+
[-1, 1, Conv, [256, 3, 1]],
|
168 |
+
[-1, 1, Conv, [256, 3, 1]],
|
169 |
+
[-1, 1, Conv, [256, 3, 1]],
|
170 |
+
[-1, 1, Conv, [256, 3, 1]],
|
171 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
172 |
+
[-1, 1, Conv, [640, 1, 1]], # 135
|
173 |
+
|
174 |
+
[99, 1, Conv, [320, 3, 1]],
|
175 |
+
[111, 1, Conv, [640, 3, 1]],
|
176 |
+
[123, 1, Conv, [960, 3, 1]],
|
177 |
+
[135, 1, Conv, [1280, 3, 1]],
|
178 |
+
|
179 |
+
[99, 1, Conv, [320, 3, 1]],
|
180 |
+
[85, 1, Conv, [640, 3, 1]],
|
181 |
+
[71, 1, Conv, [960, 3, 1]],
|
182 |
+
[57, 1, Conv, [1280, 3, 1]],
|
183 |
+
|
184 |
+
[[136,137,138,139,140,141,142,143], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
185 |
+
]
|
cfg/training/yolov7-e6e.yaml
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args],
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [80, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, DownC, [160]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
29 |
+
[-1, 1, Conv, [160, 1, 1]], # 12
|
30 |
+
[-11, 1, Conv, [64, 1, 1]],
|
31 |
+
[-12, 1, Conv, [64, 1, 1]],
|
32 |
+
[-1, 1, Conv, [64, 3, 1]],
|
33 |
+
[-1, 1, Conv, [64, 3, 1]],
|
34 |
+
[-1, 1, Conv, [64, 3, 1]],
|
35 |
+
[-1, 1, Conv, [64, 3, 1]],
|
36 |
+
[-1, 1, Conv, [64, 3, 1]],
|
37 |
+
[-1, 1, Conv, [64, 3, 1]],
|
38 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
39 |
+
[-1, 1, Conv, [160, 1, 1]], # 22
|
40 |
+
[[-1, -11], 1, Shortcut, [1]], # 23
|
41 |
+
|
42 |
+
[-1, 1, DownC, [320]], # 24-P3/8
|
43 |
+
[-1, 1, Conv, [128, 1, 1]],
|
44 |
+
[-2, 1, Conv, [128, 1, 1]],
|
45 |
+
[-1, 1, Conv, [128, 3, 1]],
|
46 |
+
[-1, 1, Conv, [128, 3, 1]],
|
47 |
+
[-1, 1, Conv, [128, 3, 1]],
|
48 |
+
[-1, 1, Conv, [128, 3, 1]],
|
49 |
+
[-1, 1, Conv, [128, 3, 1]],
|
50 |
+
[-1, 1, Conv, [128, 3, 1]],
|
51 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
52 |
+
[-1, 1, Conv, [320, 1, 1]], # 34
|
53 |
+
[-11, 1, Conv, [128, 1, 1]],
|
54 |
+
[-12, 1, Conv, [128, 1, 1]],
|
55 |
+
[-1, 1, Conv, [128, 3, 1]],
|
56 |
+
[-1, 1, Conv, [128, 3, 1]],
|
57 |
+
[-1, 1, Conv, [128, 3, 1]],
|
58 |
+
[-1, 1, Conv, [128, 3, 1]],
|
59 |
+
[-1, 1, Conv, [128, 3, 1]],
|
60 |
+
[-1, 1, Conv, [128, 3, 1]],
|
61 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
62 |
+
[-1, 1, Conv, [320, 1, 1]], # 44
|
63 |
+
[[-1, -11], 1, Shortcut, [1]], # 45
|
64 |
+
|
65 |
+
[-1, 1, DownC, [640]], # 46-P4/16
|
66 |
+
[-1, 1, Conv, [256, 1, 1]],
|
67 |
+
[-2, 1, Conv, [256, 1, 1]],
|
68 |
+
[-1, 1, Conv, [256, 3, 1]],
|
69 |
+
[-1, 1, Conv, [256, 3, 1]],
|
70 |
+
[-1, 1, Conv, [256, 3, 1]],
|
71 |
+
[-1, 1, Conv, [256, 3, 1]],
|
72 |
+
[-1, 1, Conv, [256, 3, 1]],
|
73 |
+
[-1, 1, Conv, [256, 3, 1]],
|
74 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
75 |
+
[-1, 1, Conv, [640, 1, 1]], # 56
|
76 |
+
[-11, 1, Conv, [256, 1, 1]],
|
77 |
+
[-12, 1, Conv, [256, 1, 1]],
|
78 |
+
[-1, 1, Conv, [256, 3, 1]],
|
79 |
+
[-1, 1, Conv, [256, 3, 1]],
|
80 |
+
[-1, 1, Conv, [256, 3, 1]],
|
81 |
+
[-1, 1, Conv, [256, 3, 1]],
|
82 |
+
[-1, 1, Conv, [256, 3, 1]],
|
83 |
+
[-1, 1, Conv, [256, 3, 1]],
|
84 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
85 |
+
[-1, 1, Conv, [640, 1, 1]], # 66
|
86 |
+
[[-1, -11], 1, Shortcut, [1]], # 67
|
87 |
+
|
88 |
+
[-1, 1, DownC, [960]], # 68-P5/32
|
89 |
+
[-1, 1, Conv, [384, 1, 1]],
|
90 |
+
[-2, 1, Conv, [384, 1, 1]],
|
91 |
+
[-1, 1, Conv, [384, 3, 1]],
|
92 |
+
[-1, 1, Conv, [384, 3, 1]],
|
93 |
+
[-1, 1, Conv, [384, 3, 1]],
|
94 |
+
[-1, 1, Conv, [384, 3, 1]],
|
95 |
+
[-1, 1, Conv, [384, 3, 1]],
|
96 |
+
[-1, 1, Conv, [384, 3, 1]],
|
97 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
98 |
+
[-1, 1, Conv, [960, 1, 1]], # 78
|
99 |
+
[-11, 1, Conv, [384, 1, 1]],
|
100 |
+
[-12, 1, Conv, [384, 1, 1]],
|
101 |
+
[-1, 1, Conv, [384, 3, 1]],
|
102 |
+
[-1, 1, Conv, [384, 3, 1]],
|
103 |
+
[-1, 1, Conv, [384, 3, 1]],
|
104 |
+
[-1, 1, Conv, [384, 3, 1]],
|
105 |
+
[-1, 1, Conv, [384, 3, 1]],
|
106 |
+
[-1, 1, Conv, [384, 3, 1]],
|
107 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
108 |
+
[-1, 1, Conv, [960, 1, 1]], # 88
|
109 |
+
[[-1, -11], 1, Shortcut, [1]], # 89
|
110 |
+
|
111 |
+
[-1, 1, DownC, [1280]], # 90-P6/64
|
112 |
+
[-1, 1, Conv, [512, 1, 1]],
|
113 |
+
[-2, 1, Conv, [512, 1, 1]],
|
114 |
+
[-1, 1, Conv, [512, 3, 1]],
|
115 |
+
[-1, 1, Conv, [512, 3, 1]],
|
116 |
+
[-1, 1, Conv, [512, 3, 1]],
|
117 |
+
[-1, 1, Conv, [512, 3, 1]],
|
118 |
+
[-1, 1, Conv, [512, 3, 1]],
|
119 |
+
[-1, 1, Conv, [512, 3, 1]],
|
120 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
121 |
+
[-1, 1, Conv, [1280, 1, 1]], # 100
|
122 |
+
[-11, 1, Conv, [512, 1, 1]],
|
123 |
+
[-12, 1, Conv, [512, 1, 1]],
|
124 |
+
[-1, 1, Conv, [512, 3, 1]],
|
125 |
+
[-1, 1, Conv, [512, 3, 1]],
|
126 |
+
[-1, 1, Conv, [512, 3, 1]],
|
127 |
+
[-1, 1, Conv, [512, 3, 1]],
|
128 |
+
[-1, 1, Conv, [512, 3, 1]],
|
129 |
+
[-1, 1, Conv, [512, 3, 1]],
|
130 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
131 |
+
[-1, 1, Conv, [1280, 1, 1]], # 110
|
132 |
+
[[-1, -11], 1, Shortcut, [1]], # 111
|
133 |
+
]
|
134 |
+
|
135 |
+
# yolov7 head
|
136 |
+
head:
|
137 |
+
[[-1, 1, SPPCSPC, [640]], # 112
|
138 |
+
|
139 |
+
[-1, 1, Conv, [480, 1, 1]],
|
140 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
141 |
+
[89, 1, Conv, [480, 1, 1]], # route backbone P5
|
142 |
+
[[-1, -2], 1, Concat, [1]],
|
143 |
+
|
144 |
+
[-1, 1, Conv, [384, 1, 1]],
|
145 |
+
[-2, 1, Conv, [384, 1, 1]],
|
146 |
+
[-1, 1, Conv, [192, 3, 1]],
|
147 |
+
[-1, 1, Conv, [192, 3, 1]],
|
148 |
+
[-1, 1, Conv, [192, 3, 1]],
|
149 |
+
[-1, 1, Conv, [192, 3, 1]],
|
150 |
+
[-1, 1, Conv, [192, 3, 1]],
|
151 |
+
[-1, 1, Conv, [192, 3, 1]],
|
152 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
153 |
+
[-1, 1, Conv, [480, 1, 1]], # 126
|
154 |
+
[-11, 1, Conv, [384, 1, 1]],
|
155 |
+
[-12, 1, Conv, [384, 1, 1]],
|
156 |
+
[-1, 1, Conv, [192, 3, 1]],
|
157 |
+
[-1, 1, Conv, [192, 3, 1]],
|
158 |
+
[-1, 1, Conv, [192, 3, 1]],
|
159 |
+
[-1, 1, Conv, [192, 3, 1]],
|
160 |
+
[-1, 1, Conv, [192, 3, 1]],
|
161 |
+
[-1, 1, Conv, [192, 3, 1]],
|
162 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
163 |
+
[-1, 1, Conv, [480, 1, 1]], # 136
|
164 |
+
[[-1, -11], 1, Shortcut, [1]], # 137
|
165 |
+
|
166 |
+
[-1, 1, Conv, [320, 1, 1]],
|
167 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
168 |
+
[67, 1, Conv, [320, 1, 1]], # route backbone P4
|
169 |
+
[[-1, -2], 1, Concat, [1]],
|
170 |
+
|
171 |
+
[-1, 1, Conv, [256, 1, 1]],
|
172 |
+
[-2, 1, Conv, [256, 1, 1]],
|
173 |
+
[-1, 1, Conv, [128, 3, 1]],
|
174 |
+
[-1, 1, Conv, [128, 3, 1]],
|
175 |
+
[-1, 1, Conv, [128, 3, 1]],
|
176 |
+
[-1, 1, Conv, [128, 3, 1]],
|
177 |
+
[-1, 1, Conv, [128, 3, 1]],
|
178 |
+
[-1, 1, Conv, [128, 3, 1]],
|
179 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
180 |
+
[-1, 1, Conv, [320, 1, 1]], # 151
|
181 |
+
[-11, 1, Conv, [256, 1, 1]],
|
182 |
+
[-12, 1, Conv, [256, 1, 1]],
|
183 |
+
[-1, 1, Conv, [128, 3, 1]],
|
184 |
+
[-1, 1, Conv, [128, 3, 1]],
|
185 |
+
[-1, 1, Conv, [128, 3, 1]],
|
186 |
+
[-1, 1, Conv, [128, 3, 1]],
|
187 |
+
[-1, 1, Conv, [128, 3, 1]],
|
188 |
+
[-1, 1, Conv, [128, 3, 1]],
|
189 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
190 |
+
[-1, 1, Conv, [320, 1, 1]], # 161
|
191 |
+
[[-1, -11], 1, Shortcut, [1]], # 162
|
192 |
+
|
193 |
+
[-1, 1, Conv, [160, 1, 1]],
|
194 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
195 |
+
[45, 1, Conv, [160, 1, 1]], # route backbone P3
|
196 |
+
[[-1, -2], 1, Concat, [1]],
|
197 |
+
|
198 |
+
[-1, 1, Conv, [128, 1, 1]],
|
199 |
+
[-2, 1, Conv, [128, 1, 1]],
|
200 |
+
[-1, 1, Conv, [64, 3, 1]],
|
201 |
+
[-1, 1, Conv, [64, 3, 1]],
|
202 |
+
[-1, 1, Conv, [64, 3, 1]],
|
203 |
+
[-1, 1, Conv, [64, 3, 1]],
|
204 |
+
[-1, 1, Conv, [64, 3, 1]],
|
205 |
+
[-1, 1, Conv, [64, 3, 1]],
|
206 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
207 |
+
[-1, 1, Conv, [160, 1, 1]], # 176
|
208 |
+
[-11, 1, Conv, [128, 1, 1]],
|
209 |
+
[-12, 1, Conv, [128, 1, 1]],
|
210 |
+
[-1, 1, Conv, [64, 3, 1]],
|
211 |
+
[-1, 1, Conv, [64, 3, 1]],
|
212 |
+
[-1, 1, Conv, [64, 3, 1]],
|
213 |
+
[-1, 1, Conv, [64, 3, 1]],
|
214 |
+
[-1, 1, Conv, [64, 3, 1]],
|
215 |
+
[-1, 1, Conv, [64, 3, 1]],
|
216 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
217 |
+
[-1, 1, Conv, [160, 1, 1]], # 186
|
218 |
+
[[-1, -11], 1, Shortcut, [1]], # 187
|
219 |
+
|
220 |
+
[-1, 1, DownC, [320]],
|
221 |
+
[[-1, 162], 1, Concat, [1]],
|
222 |
+
|
223 |
+
[-1, 1, Conv, [256, 1, 1]],
|
224 |
+
[-2, 1, Conv, [256, 1, 1]],
|
225 |
+
[-1, 1, Conv, [128, 3, 1]],
|
226 |
+
[-1, 1, Conv, [128, 3, 1]],
|
227 |
+
[-1, 1, Conv, [128, 3, 1]],
|
228 |
+
[-1, 1, Conv, [128, 3, 1]],
|
229 |
+
[-1, 1, Conv, [128, 3, 1]],
|
230 |
+
[-1, 1, Conv, [128, 3, 1]],
|
231 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
232 |
+
[-1, 1, Conv, [320, 1, 1]], # 199
|
233 |
+
[-11, 1, Conv, [256, 1, 1]],
|
234 |
+
[-12, 1, Conv, [256, 1, 1]],
|
235 |
+
[-1, 1, Conv, [128, 3, 1]],
|
236 |
+
[-1, 1, Conv, [128, 3, 1]],
|
237 |
+
[-1, 1, Conv, [128, 3, 1]],
|
238 |
+
[-1, 1, Conv, [128, 3, 1]],
|
239 |
+
[-1, 1, Conv, [128, 3, 1]],
|
240 |
+
[-1, 1, Conv, [128, 3, 1]],
|
241 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
242 |
+
[-1, 1, Conv, [320, 1, 1]], # 209
|
243 |
+
[[-1, -11], 1, Shortcut, [1]], # 210
|
244 |
+
|
245 |
+
[-1, 1, DownC, [480]],
|
246 |
+
[[-1, 137], 1, Concat, [1]],
|
247 |
+
|
248 |
+
[-1, 1, Conv, [384, 1, 1]],
|
249 |
+
[-2, 1, Conv, [384, 1, 1]],
|
250 |
+
[-1, 1, Conv, [192, 3, 1]],
|
251 |
+
[-1, 1, Conv, [192, 3, 1]],
|
252 |
+
[-1, 1, Conv, [192, 3, 1]],
|
253 |
+
[-1, 1, Conv, [192, 3, 1]],
|
254 |
+
[-1, 1, Conv, [192, 3, 1]],
|
255 |
+
[-1, 1, Conv, [192, 3, 1]],
|
256 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
257 |
+
[-1, 1, Conv, [480, 1, 1]], # 222
|
258 |
+
[-11, 1, Conv, [384, 1, 1]],
|
259 |
+
[-12, 1, Conv, [384, 1, 1]],
|
260 |
+
[-1, 1, Conv, [192, 3, 1]],
|
261 |
+
[-1, 1, Conv, [192, 3, 1]],
|
262 |
+
[-1, 1, Conv, [192, 3, 1]],
|
263 |
+
[-1, 1, Conv, [192, 3, 1]],
|
264 |
+
[-1, 1, Conv, [192, 3, 1]],
|
265 |
+
[-1, 1, Conv, [192, 3, 1]],
|
266 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
267 |
+
[-1, 1, Conv, [480, 1, 1]], # 232
|
268 |
+
[[-1, -11], 1, Shortcut, [1]], # 233
|
269 |
+
|
270 |
+
[-1, 1, DownC, [640]],
|
271 |
+
[[-1, 112], 1, Concat, [1]],
|
272 |
+
|
273 |
+
[-1, 1, Conv, [512, 1, 1]],
|
274 |
+
[-2, 1, Conv, [512, 1, 1]],
|
275 |
+
[-1, 1, Conv, [256, 3, 1]],
|
276 |
+
[-1, 1, Conv, [256, 3, 1]],
|
277 |
+
[-1, 1, Conv, [256, 3, 1]],
|
278 |
+
[-1, 1, Conv, [256, 3, 1]],
|
279 |
+
[-1, 1, Conv, [256, 3, 1]],
|
280 |
+
[-1, 1, Conv, [256, 3, 1]],
|
281 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
282 |
+
[-1, 1, Conv, [640, 1, 1]], # 245
|
283 |
+
[-11, 1, Conv, [512, 1, 1]],
|
284 |
+
[-12, 1, Conv, [512, 1, 1]],
|
285 |
+
[-1, 1, Conv, [256, 3, 1]],
|
286 |
+
[-1, 1, Conv, [256, 3, 1]],
|
287 |
+
[-1, 1, Conv, [256, 3, 1]],
|
288 |
+
[-1, 1, Conv, [256, 3, 1]],
|
289 |
+
[-1, 1, Conv, [256, 3, 1]],
|
290 |
+
[-1, 1, Conv, [256, 3, 1]],
|
291 |
+
[[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
|
292 |
+
[-1, 1, Conv, [640, 1, 1]], # 255
|
293 |
+
[[-1, -11], 1, Shortcut, [1]], # 256
|
294 |
+
|
295 |
+
[187, 1, Conv, [320, 3, 1]],
|
296 |
+
[210, 1, Conv, [640, 3, 1]],
|
297 |
+
[233, 1, Conv, [960, 3, 1]],
|
298 |
+
[256, 1, Conv, [1280, 3, 1]],
|
299 |
+
|
300 |
+
[186, 1, Conv, [320, 3, 1]],
|
301 |
+
[161, 1, Conv, [640, 3, 1]],
|
302 |
+
[136, 1, Conv, [960, 3, 1]],
|
303 |
+
[112, 1, Conv, [1280, 3, 1]],
|
304 |
+
|
305 |
+
[[257,258,259,260,261,262,263,264], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
306 |
+
]
|
cfg/training/yolov7-tiny.yaml
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [10,13, 16,30, 33,23] # P3/8
|
9 |
+
- [30,61, 62,45, 59,119] # P4/16
|
10 |
+
- [116,90, 156,198, 373,326] # P5/32
|
11 |
+
|
12 |
+
# yolov7-tiny backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args] c2, k=1, s=1, p=None, g=1, act=True
|
15 |
+
[[-1, 1, Conv, [32, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 0-P1/2
|
16 |
+
|
17 |
+
[-1, 1, Conv, [64, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 1-P2/4
|
18 |
+
|
19 |
+
[-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
20 |
+
[-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
21 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
22 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
23 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
24 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 7
|
25 |
+
|
26 |
+
[-1, 1, MP, []], # 8-P3/8
|
27 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
28 |
+
[-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
29 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
30 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
31 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
32 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 14
|
33 |
+
|
34 |
+
[-1, 1, MP, []], # 15-P4/16
|
35 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
36 |
+
[-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
39 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
40 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 21
|
41 |
+
|
42 |
+
[-1, 1, MP, []], # 22-P5/32
|
43 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
44 |
+
[-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
45 |
+
[-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
46 |
+
[-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
47 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
48 |
+
[-1, 1, Conv, [512, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 28
|
49 |
+
]
|
50 |
+
|
51 |
+
# yolov7-tiny head
|
52 |
+
head:
|
53 |
+
[[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
54 |
+
[-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
55 |
+
[-1, 1, SP, [5]],
|
56 |
+
[-2, 1, SP, [9]],
|
57 |
+
[-3, 1, SP, [13]],
|
58 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
59 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
60 |
+
[[-1, -7], 1, Concat, [1]],
|
61 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 37
|
62 |
+
|
63 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
64 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
65 |
+
[21, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P4
|
66 |
+
[[-1, -2], 1, Concat, [1]],
|
67 |
+
|
68 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
69 |
+
[-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
70 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
71 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
72 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
73 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 47
|
74 |
+
|
75 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
76 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
77 |
+
[14, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P3
|
78 |
+
[[-1, -2], 1, Concat, [1]],
|
79 |
+
|
80 |
+
[-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
81 |
+
[-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
82 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
83 |
+
[-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
84 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
85 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 57
|
86 |
+
|
87 |
+
[-1, 1, Conv, [128, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
|
88 |
+
[[-1, 47], 1, Concat, [1]],
|
89 |
+
|
90 |
+
[-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
91 |
+
[-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
92 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
93 |
+
[-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
94 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
95 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 65
|
96 |
+
|
97 |
+
[-1, 1, Conv, [256, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
|
98 |
+
[[-1, 37], 1, Concat, [1]],
|
99 |
+
|
100 |
+
[-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
101 |
+
[-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
|
102 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
103 |
+
[-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
104 |
+
[[-1, -2, -3, -4], 1, Concat, [1]],
|
105 |
+
[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 73
|
106 |
+
|
107 |
+
[57, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
108 |
+
[65, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
109 |
+
[73, 1, Conv, [512, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
|
110 |
+
|
111 |
+
[[74,75,76], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
112 |
+
]
|
cfg/training/yolov7-w6.yaml
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [ 19,27, 44,40, 38,94 ] # P3/8
|
9 |
+
- [ 96,68, 86,152, 180,137 ] # P4/16
|
10 |
+
- [ 140,301, 303,264, 238,542 ] # P5/32
|
11 |
+
- [ 436,615, 739,380, 925,792 ] # P6/64
|
12 |
+
|
13 |
+
# yolov7 backbone
|
14 |
+
backbone:
|
15 |
+
# [from, number, module, args]
|
16 |
+
[[-1, 1, ReOrg, []], # 0
|
17 |
+
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
|
18 |
+
|
19 |
+
[-1, 1, Conv, [128, 3, 2]], # 2-P2/4
|
20 |
+
[-1, 1, Conv, [64, 1, 1]],
|
21 |
+
[-2, 1, Conv, [64, 1, 1]],
|
22 |
+
[-1, 1, Conv, [64, 3, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
27 |
+
[-1, 1, Conv, [128, 1, 1]], # 10
|
28 |
+
|
29 |
+
[-1, 1, Conv, [256, 3, 2]], # 11-P3/8
|
30 |
+
[-1, 1, Conv, [128, 1, 1]],
|
31 |
+
[-2, 1, Conv, [128, 1, 1]],
|
32 |
+
[-1, 1, Conv, [128, 3, 1]],
|
33 |
+
[-1, 1, Conv, [128, 3, 1]],
|
34 |
+
[-1, 1, Conv, [128, 3, 1]],
|
35 |
+
[-1, 1, Conv, [128, 3, 1]],
|
36 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
37 |
+
[-1, 1, Conv, [256, 1, 1]], # 19
|
38 |
+
|
39 |
+
[-1, 1, Conv, [512, 3, 2]], # 20-P4/16
|
40 |
+
[-1, 1, Conv, [256, 1, 1]],
|
41 |
+
[-2, 1, Conv, [256, 1, 1]],
|
42 |
+
[-1, 1, Conv, [256, 3, 1]],
|
43 |
+
[-1, 1, Conv, [256, 3, 1]],
|
44 |
+
[-1, 1, Conv, [256, 3, 1]],
|
45 |
+
[-1, 1, Conv, [256, 3, 1]],
|
46 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
47 |
+
[-1, 1, Conv, [512, 1, 1]], # 28
|
48 |
+
|
49 |
+
[-1, 1, Conv, [768, 3, 2]], # 29-P5/32
|
50 |
+
[-1, 1, Conv, [384, 1, 1]],
|
51 |
+
[-2, 1, Conv, [384, 1, 1]],
|
52 |
+
[-1, 1, Conv, [384, 3, 1]],
|
53 |
+
[-1, 1, Conv, [384, 3, 1]],
|
54 |
+
[-1, 1, Conv, [384, 3, 1]],
|
55 |
+
[-1, 1, Conv, [384, 3, 1]],
|
56 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
57 |
+
[-1, 1, Conv, [768, 1, 1]], # 37
|
58 |
+
|
59 |
+
[-1, 1, Conv, [1024, 3, 2]], # 38-P6/64
|
60 |
+
[-1, 1, Conv, [512, 1, 1]],
|
61 |
+
[-2, 1, Conv, [512, 1, 1]],
|
62 |
+
[-1, 1, Conv, [512, 3, 1]],
|
63 |
+
[-1, 1, Conv, [512, 3, 1]],
|
64 |
+
[-1, 1, Conv, [512, 3, 1]],
|
65 |
+
[-1, 1, Conv, [512, 3, 1]],
|
66 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
67 |
+
[-1, 1, Conv, [1024, 1, 1]], # 46
|
68 |
+
]
|
69 |
+
|
70 |
+
# yolov7 head
|
71 |
+
head:
|
72 |
+
[[-1, 1, SPPCSPC, [512]], # 47
|
73 |
+
|
74 |
+
[-1, 1, Conv, [384, 1, 1]],
|
75 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
76 |
+
[37, 1, Conv, [384, 1, 1]], # route backbone P5
|
77 |
+
[[-1, -2], 1, Concat, [1]],
|
78 |
+
|
79 |
+
[-1, 1, Conv, [384, 1, 1]],
|
80 |
+
[-2, 1, Conv, [384, 1, 1]],
|
81 |
+
[-1, 1, Conv, [192, 3, 1]],
|
82 |
+
[-1, 1, Conv, [192, 3, 1]],
|
83 |
+
[-1, 1, Conv, [192, 3, 1]],
|
84 |
+
[-1, 1, Conv, [192, 3, 1]],
|
85 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
86 |
+
[-1, 1, Conv, [384, 1, 1]], # 59
|
87 |
+
|
88 |
+
[-1, 1, Conv, [256, 1, 1]],
|
89 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
90 |
+
[28, 1, Conv, [256, 1, 1]], # route backbone P4
|
91 |
+
[[-1, -2], 1, Concat, [1]],
|
92 |
+
|
93 |
+
[-1, 1, Conv, [256, 1, 1]],
|
94 |
+
[-2, 1, Conv, [256, 1, 1]],
|
95 |
+
[-1, 1, Conv, [128, 3, 1]],
|
96 |
+
[-1, 1, Conv, [128, 3, 1]],
|
97 |
+
[-1, 1, Conv, [128, 3, 1]],
|
98 |
+
[-1, 1, Conv, [128, 3, 1]],
|
99 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
100 |
+
[-1, 1, Conv, [256, 1, 1]], # 71
|
101 |
+
|
102 |
+
[-1, 1, Conv, [128, 1, 1]],
|
103 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
104 |
+
[19, 1, Conv, [128, 1, 1]], # route backbone P3
|
105 |
+
[[-1, -2], 1, Concat, [1]],
|
106 |
+
|
107 |
+
[-1, 1, Conv, [128, 1, 1]],
|
108 |
+
[-2, 1, Conv, [128, 1, 1]],
|
109 |
+
[-1, 1, Conv, [64, 3, 1]],
|
110 |
+
[-1, 1, Conv, [64, 3, 1]],
|
111 |
+
[-1, 1, Conv, [64, 3, 1]],
|
112 |
+
[-1, 1, Conv, [64, 3, 1]],
|
113 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
114 |
+
[-1, 1, Conv, [128, 1, 1]], # 83
|
115 |
+
|
116 |
+
[-1, 1, Conv, [256, 3, 2]],
|
117 |
+
[[-1, 71], 1, Concat, [1]], # cat
|
118 |
+
|
119 |
+
[-1, 1, Conv, [256, 1, 1]],
|
120 |
+
[-2, 1, Conv, [256, 1, 1]],
|
121 |
+
[-1, 1, Conv, [128, 3, 1]],
|
122 |
+
[-1, 1, Conv, [128, 3, 1]],
|
123 |
+
[-1, 1, Conv, [128, 3, 1]],
|
124 |
+
[-1, 1, Conv, [128, 3, 1]],
|
125 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
126 |
+
[-1, 1, Conv, [256, 1, 1]], # 93
|
127 |
+
|
128 |
+
[-1, 1, Conv, [384, 3, 2]],
|
129 |
+
[[-1, 59], 1, Concat, [1]], # cat
|
130 |
+
|
131 |
+
[-1, 1, Conv, [384, 1, 1]],
|
132 |
+
[-2, 1, Conv, [384, 1, 1]],
|
133 |
+
[-1, 1, Conv, [192, 3, 1]],
|
134 |
+
[-1, 1, Conv, [192, 3, 1]],
|
135 |
+
[-1, 1, Conv, [192, 3, 1]],
|
136 |
+
[-1, 1, Conv, [192, 3, 1]],
|
137 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
138 |
+
[-1, 1, Conv, [384, 1, 1]], # 103
|
139 |
+
|
140 |
+
[-1, 1, Conv, [512, 3, 2]],
|
141 |
+
[[-1, 47], 1, Concat, [1]], # cat
|
142 |
+
|
143 |
+
[-1, 1, Conv, [512, 1, 1]],
|
144 |
+
[-2, 1, Conv, [512, 1, 1]],
|
145 |
+
[-1, 1, Conv, [256, 3, 1]],
|
146 |
+
[-1, 1, Conv, [256, 3, 1]],
|
147 |
+
[-1, 1, Conv, [256, 3, 1]],
|
148 |
+
[-1, 1, Conv, [256, 3, 1]],
|
149 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
150 |
+
[-1, 1, Conv, [512, 1, 1]], # 113
|
151 |
+
|
152 |
+
[83, 1, Conv, [256, 3, 1]],
|
153 |
+
[93, 1, Conv, [512, 3, 1]],
|
154 |
+
[103, 1, Conv, [768, 3, 1]],
|
155 |
+
[113, 1, Conv, [1024, 3, 1]],
|
156 |
+
|
157 |
+
[83, 1, Conv, [320, 3, 1]],
|
158 |
+
[71, 1, Conv, [640, 3, 1]],
|
159 |
+
[59, 1, Conv, [960, 3, 1]],
|
160 |
+
[47, 1, Conv, [1280, 3, 1]],
|
161 |
+
|
162 |
+
[[114,115,116,117,118,119,120,121], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
|
163 |
+
]
|
cfg/training/yolov7.yaml
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# yolov7 backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [32, 3, 1]], # 0
|
16 |
+
|
17 |
+
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
|
18 |
+
[-1, 1, Conv, [64, 3, 1]],
|
19 |
+
|
20 |
+
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
|
21 |
+
[-1, 1, Conv, [64, 1, 1]],
|
22 |
+
[-2, 1, Conv, [64, 1, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
28 |
+
[-1, 1, Conv, [256, 1, 1]], # 11
|
29 |
+
|
30 |
+
[-1, 1, MP, []],
|
31 |
+
[-1, 1, Conv, [128, 1, 1]],
|
32 |
+
[-3, 1, Conv, [128, 1, 1]],
|
33 |
+
[-1, 1, Conv, [128, 3, 2]],
|
34 |
+
[[-1, -3], 1, Concat, [1]], # 16-P3/8
|
35 |
+
[-1, 1, Conv, [128, 1, 1]],
|
36 |
+
[-2, 1, Conv, [128, 1, 1]],
|
37 |
+
[-1, 1, Conv, [128, 3, 1]],
|
38 |
+
[-1, 1, Conv, [128, 3, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[-1, 1, Conv, [128, 3, 1]],
|
41 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
42 |
+
[-1, 1, Conv, [512, 1, 1]], # 24
|
43 |
+
|
44 |
+
[-1, 1, MP, []],
|
45 |
+
[-1, 1, Conv, [256, 1, 1]],
|
46 |
+
[-3, 1, Conv, [256, 1, 1]],
|
47 |
+
[-1, 1, Conv, [256, 3, 2]],
|
48 |
+
[[-1, -3], 1, Concat, [1]], # 29-P4/16
|
49 |
+
[-1, 1, Conv, [256, 1, 1]],
|
50 |
+
[-2, 1, Conv, [256, 1, 1]],
|
51 |
+
[-1, 1, Conv, [256, 3, 1]],
|
52 |
+
[-1, 1, Conv, [256, 3, 1]],
|
53 |
+
[-1, 1, Conv, [256, 3, 1]],
|
54 |
+
[-1, 1, Conv, [256, 3, 1]],
|
55 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
56 |
+
[-1, 1, Conv, [1024, 1, 1]], # 37
|
57 |
+
|
58 |
+
[-1, 1, MP, []],
|
59 |
+
[-1, 1, Conv, [512, 1, 1]],
|
60 |
+
[-3, 1, Conv, [512, 1, 1]],
|
61 |
+
[-1, 1, Conv, [512, 3, 2]],
|
62 |
+
[[-1, -3], 1, Concat, [1]], # 42-P5/32
|
63 |
+
[-1, 1, Conv, [256, 1, 1]],
|
64 |
+
[-2, 1, Conv, [256, 1, 1]],
|
65 |
+
[-1, 1, Conv, [256, 3, 1]],
|
66 |
+
[-1, 1, Conv, [256, 3, 1]],
|
67 |
+
[-1, 1, Conv, [256, 3, 1]],
|
68 |
+
[-1, 1, Conv, [256, 3, 1]],
|
69 |
+
[[-1, -3, -5, -6], 1, Concat, [1]],
|
70 |
+
[-1, 1, Conv, [1024, 1, 1]], # 50
|
71 |
+
]
|
72 |
+
|
73 |
+
# yolov7 head
|
74 |
+
head:
|
75 |
+
[[-1, 1, SPPCSPC, [512]], # 51
|
76 |
+
|
77 |
+
[-1, 1, Conv, [256, 1, 1]],
|
78 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
79 |
+
[37, 1, Conv, [256, 1, 1]], # route backbone P4
|
80 |
+
[[-1, -2], 1, Concat, [1]],
|
81 |
+
|
82 |
+
[-1, 1, Conv, [256, 1, 1]],
|
83 |
+
[-2, 1, Conv, [256, 1, 1]],
|
84 |
+
[-1, 1, Conv, [128, 3, 1]],
|
85 |
+
[-1, 1, Conv, [128, 3, 1]],
|
86 |
+
[-1, 1, Conv, [128, 3, 1]],
|
87 |
+
[-1, 1, Conv, [128, 3, 1]],
|
88 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
89 |
+
[-1, 1, Conv, [256, 1, 1]], # 63
|
90 |
+
|
91 |
+
[-1, 1, Conv, [128, 1, 1]],
|
92 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
93 |
+
[24, 1, Conv, [128, 1, 1]], # route backbone P3
|
94 |
+
[[-1, -2], 1, Concat, [1]],
|
95 |
+
|
96 |
+
[-1, 1, Conv, [128, 1, 1]],
|
97 |
+
[-2, 1, Conv, [128, 1, 1]],
|
98 |
+
[-1, 1, Conv, [64, 3, 1]],
|
99 |
+
[-1, 1, Conv, [64, 3, 1]],
|
100 |
+
[-1, 1, Conv, [64, 3, 1]],
|
101 |
+
[-1, 1, Conv, [64, 3, 1]],
|
102 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
103 |
+
[-1, 1, Conv, [128, 1, 1]], # 75
|
104 |
+
|
105 |
+
[-1, 1, MP, []],
|
106 |
+
[-1, 1, Conv, [128, 1, 1]],
|
107 |
+
[-3, 1, Conv, [128, 1, 1]],
|
108 |
+
[-1, 1, Conv, [128, 3, 2]],
|
109 |
+
[[-1, -3, 63], 1, Concat, [1]],
|
110 |
+
|
111 |
+
[-1, 1, Conv, [256, 1, 1]],
|
112 |
+
[-2, 1, Conv, [256, 1, 1]],
|
113 |
+
[-1, 1, Conv, [128, 3, 1]],
|
114 |
+
[-1, 1, Conv, [128, 3, 1]],
|
115 |
+
[-1, 1, Conv, [128, 3, 1]],
|
116 |
+
[-1, 1, Conv, [128, 3, 1]],
|
117 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
118 |
+
[-1, 1, Conv, [256, 1, 1]], # 88
|
119 |
+
|
120 |
+
[-1, 1, MP, []],
|
121 |
+
[-1, 1, Conv, [256, 1, 1]],
|
122 |
+
[-3, 1, Conv, [256, 1, 1]],
|
123 |
+
[-1, 1, Conv, [256, 3, 2]],
|
124 |
+
[[-1, -3, 51], 1, Concat, [1]],
|
125 |
+
|
126 |
+
[-1, 1, Conv, [512, 1, 1]],
|
127 |
+
[-2, 1, Conv, [512, 1, 1]],
|
128 |
+
[-1, 1, Conv, [256, 3, 1]],
|
129 |
+
[-1, 1, Conv, [256, 3, 1]],
|
130 |
+
[-1, 1, Conv, [256, 3, 1]],
|
131 |
+
[-1, 1, Conv, [256, 3, 1]],
|
132 |
+
[[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
|
133 |
+
[-1, 1, Conv, [512, 1, 1]], # 101
|
134 |
+
|
135 |
+
[75, 1, RepConv, [256, 3, 1]],
|
136 |
+
[88, 1, RepConv, [512, 3, 1]],
|
137 |
+
[101, 1, RepConv, [1024, 3, 1]],
|
138 |
+
|
139 |
+
[[102,103,104], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
140 |
+
]
|
cfg/training/yolov7x.yaml
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
6 |
+
# anchors
|
7 |
+
anchors:
|
8 |
+
- [12,16, 19,36, 40,28] # P3/8
|
9 |
+
- [36,75, 76,55, 72,146] # P4/16
|
10 |
+
- [142,110, 192,243, 459,401] # P5/32
|
11 |
+
|
12 |
+
# yolov7 backbone
|
13 |
+
backbone:
|
14 |
+
# [from, number, module, args]
|
15 |
+
[[-1, 1, Conv, [40, 3, 1]], # 0
|
16 |
+
|
17 |
+
[-1, 1, Conv, [80, 3, 2]], # 1-P1/2
|
18 |
+
[-1, 1, Conv, [80, 3, 1]],
|
19 |
+
|
20 |
+
[-1, 1, Conv, [160, 3, 2]], # 3-P2/4
|
21 |
+
[-1, 1, Conv, [64, 1, 1]],
|
22 |
+
[-2, 1, Conv, [64, 1, 1]],
|
23 |
+
[-1, 1, Conv, [64, 3, 1]],
|
24 |
+
[-1, 1, Conv, [64, 3, 1]],
|
25 |
+
[-1, 1, Conv, [64, 3, 1]],
|
26 |
+
[-1, 1, Conv, [64, 3, 1]],
|
27 |
+
[-1, 1, Conv, [64, 3, 1]],
|
28 |
+
[-1, 1, Conv, [64, 3, 1]],
|
29 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
30 |
+
[-1, 1, Conv, [320, 1, 1]], # 13
|
31 |
+
|
32 |
+
[-1, 1, MP, []],
|
33 |
+
[-1, 1, Conv, [160, 1, 1]],
|
34 |
+
[-3, 1, Conv, [160, 1, 1]],
|
35 |
+
[-1, 1, Conv, [160, 3, 2]],
|
36 |
+
[[-1, -3], 1, Concat, [1]], # 18-P3/8
|
37 |
+
[-1, 1, Conv, [128, 1, 1]],
|
38 |
+
[-2, 1, Conv, [128, 1, 1]],
|
39 |
+
[-1, 1, Conv, [128, 3, 1]],
|
40 |
+
[-1, 1, Conv, [128, 3, 1]],
|
41 |
+
[-1, 1, Conv, [128, 3, 1]],
|
42 |
+
[-1, 1, Conv, [128, 3, 1]],
|
43 |
+
[-1, 1, Conv, [128, 3, 1]],
|
44 |
+
[-1, 1, Conv, [128, 3, 1]],
|
45 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
46 |
+
[-1, 1, Conv, [640, 1, 1]], # 28
|
47 |
+
|
48 |
+
[-1, 1, MP, []],
|
49 |
+
[-1, 1, Conv, [320, 1, 1]],
|
50 |
+
[-3, 1, Conv, [320, 1, 1]],
|
51 |
+
[-1, 1, Conv, [320, 3, 2]],
|
52 |
+
[[-1, -3], 1, Concat, [1]], # 33-P4/16
|
53 |
+
[-1, 1, Conv, [256, 1, 1]],
|
54 |
+
[-2, 1, Conv, [256, 1, 1]],
|
55 |
+
[-1, 1, Conv, [256, 3, 1]],
|
56 |
+
[-1, 1, Conv, [256, 3, 1]],
|
57 |
+
[-1, 1, Conv, [256, 3, 1]],
|
58 |
+
[-1, 1, Conv, [256, 3, 1]],
|
59 |
+
[-1, 1, Conv, [256, 3, 1]],
|
60 |
+
[-1, 1, Conv, [256, 3, 1]],
|
61 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
62 |
+
[-1, 1, Conv, [1280, 1, 1]], # 43
|
63 |
+
|
64 |
+
[-1, 1, MP, []],
|
65 |
+
[-1, 1, Conv, [640, 1, 1]],
|
66 |
+
[-3, 1, Conv, [640, 1, 1]],
|
67 |
+
[-1, 1, Conv, [640, 3, 2]],
|
68 |
+
[[-1, -3], 1, Concat, [1]], # 48-P5/32
|
69 |
+
[-1, 1, Conv, [256, 1, 1]],
|
70 |
+
[-2, 1, Conv, [256, 1, 1]],
|
71 |
+
[-1, 1, Conv, [256, 3, 1]],
|
72 |
+
[-1, 1, Conv, [256, 3, 1]],
|
73 |
+
[-1, 1, Conv, [256, 3, 1]],
|
74 |
+
[-1, 1, Conv, [256, 3, 1]],
|
75 |
+
[-1, 1, Conv, [256, 3, 1]],
|
76 |
+
[-1, 1, Conv, [256, 3, 1]],
|
77 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
78 |
+
[-1, 1, Conv, [1280, 1, 1]], # 58
|
79 |
+
]
|
80 |
+
|
81 |
+
# yolov7 head
|
82 |
+
head:
|
83 |
+
[[-1, 1, SPPCSPC, [640]], # 59
|
84 |
+
|
85 |
+
[-1, 1, Conv, [320, 1, 1]],
|
86 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
87 |
+
[43, 1, Conv, [320, 1, 1]], # route backbone P4
|
88 |
+
[[-1, -2], 1, Concat, [1]],
|
89 |
+
|
90 |
+
[-1, 1, Conv, [256, 1, 1]],
|
91 |
+
[-2, 1, Conv, [256, 1, 1]],
|
92 |
+
[-1, 1, Conv, [256, 3, 1]],
|
93 |
+
[-1, 1, Conv, [256, 3, 1]],
|
94 |
+
[-1, 1, Conv, [256, 3, 1]],
|
95 |
+
[-1, 1, Conv, [256, 3, 1]],
|
96 |
+
[-1, 1, Conv, [256, 3, 1]],
|
97 |
+
[-1, 1, Conv, [256, 3, 1]],
|
98 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
99 |
+
[-1, 1, Conv, [320, 1, 1]], # 73
|
100 |
+
|
101 |
+
[-1, 1, Conv, [160, 1, 1]],
|
102 |
+
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
|
103 |
+
[28, 1, Conv, [160, 1, 1]], # route backbone P3
|
104 |
+
[[-1, -2], 1, Concat, [1]],
|
105 |
+
|
106 |
+
[-1, 1, Conv, [128, 1, 1]],
|
107 |
+
[-2, 1, Conv, [128, 1, 1]],
|
108 |
+
[-1, 1, Conv, [128, 3, 1]],
|
109 |
+
[-1, 1, Conv, [128, 3, 1]],
|
110 |
+
[-1, 1, Conv, [128, 3, 1]],
|
111 |
+
[-1, 1, Conv, [128, 3, 1]],
|
112 |
+
[-1, 1, Conv, [128, 3, 1]],
|
113 |
+
[-1, 1, Conv, [128, 3, 1]],
|
114 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
115 |
+
[-1, 1, Conv, [160, 1, 1]], # 87
|
116 |
+
|
117 |
+
[-1, 1, MP, []],
|
118 |
+
[-1, 1, Conv, [160, 1, 1]],
|
119 |
+
[-3, 1, Conv, [160, 1, 1]],
|
120 |
+
[-1, 1, Conv, [160, 3, 2]],
|
121 |
+
[[-1, -3, 73], 1, Concat, [1]],
|
122 |
+
|
123 |
+
[-1, 1, Conv, [256, 1, 1]],
|
124 |
+
[-2, 1, Conv, [256, 1, 1]],
|
125 |
+
[-1, 1, Conv, [256, 3, 1]],
|
126 |
+
[-1, 1, Conv, [256, 3, 1]],
|
127 |
+
[-1, 1, Conv, [256, 3, 1]],
|
128 |
+
[-1, 1, Conv, [256, 3, 1]],
|
129 |
+
[-1, 1, Conv, [256, 3, 1]],
|
130 |
+
[-1, 1, Conv, [256, 3, 1]],
|
131 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
132 |
+
[-1, 1, Conv, [320, 1, 1]], # 102
|
133 |
+
|
134 |
+
[-1, 1, MP, []],
|
135 |
+
[-1, 1, Conv, [320, 1, 1]],
|
136 |
+
[-3, 1, Conv, [320, 1, 1]],
|
137 |
+
[-1, 1, Conv, [320, 3, 2]],
|
138 |
+
[[-1, -3, 59], 1, Concat, [1]],
|
139 |
+
|
140 |
+
[-1, 1, Conv, [512, 1, 1]],
|
141 |
+
[-2, 1, Conv, [512, 1, 1]],
|
142 |
+
[-1, 1, Conv, [512, 3, 1]],
|
143 |
+
[-1, 1, Conv, [512, 3, 1]],
|
144 |
+
[-1, 1, Conv, [512, 3, 1]],
|
145 |
+
[-1, 1, Conv, [512, 3, 1]],
|
146 |
+
[-1, 1, Conv, [512, 3, 1]],
|
147 |
+
[-1, 1, Conv, [512, 3, 1]],
|
148 |
+
[[-1, -3, -5, -7, -8], 1, Concat, [1]],
|
149 |
+
[-1, 1, Conv, [640, 1, 1]], # 117
|
150 |
+
|
151 |
+
[87, 1, Conv, [320, 3, 1]],
|
152 |
+
[102, 1, Conv, [640, 3, 1]],
|
153 |
+
[117, 1, Conv, [1280, 3, 1]],
|
154 |
+
|
155 |
+
[[118,119,120], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
|
156 |
+
]
|