glenn-jocher commited on
Commit
81b3182
1 Parent(s): bd88e7f

Models `*.yaml` reformat (#3875)

Browse files
models/hub/yolov3-spp.yaml CHANGED
@@ -1,51 +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
- - [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
  ]
 
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
  anchors:
6
+ - [ 10,13, 16,30, 33,23 ] # P3/8
7
+ - [ 30,61, 62,45, 59,119 ] # P4/16
8
+ - [ 116,90, 156,198, 373,326 ] # P5/32
9
 
10
  # darknet53 backbone
11
  backbone:
12
  # [from, number, module, args]
13
+ [ [ -1, 1, Conv, [ 32, 3, 1 ] ], # 0
14
+ [ -1, 1, Conv, [ 64, 3, 2 ] ], # 1-P1/2
15
+ [ -1, 1, Bottleneck, [ 64 ] ],
16
+ [ -1, 1, Conv, [ 128, 3, 2 ] ], # 3-P2/4
17
+ [ -1, 2, Bottleneck, [ 128 ] ],
18
+ [ -1, 1, Conv, [ 256, 3, 2 ] ], # 5-P3/8
19
+ [ -1, 8, Bottleneck, [ 256 ] ],
20
+ [ -1, 1, Conv, [ 512, 3, 2 ] ], # 7-P4/16
21
+ [ -1, 8, Bottleneck, [ 512 ] ],
22
+ [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 9-P5/32
23
+ [ -1, 4, Bottleneck, [ 1024 ] ], # 10
24
  ]
25
 
26
  # YOLOv3-SPP head
27
  head:
28
+ [ [ -1, 1, Bottleneck, [ 1024, False ] ],
29
+ [ -1, 1, SPP, [ 512, [ 5, 9, 13 ] ] ],
30
+ [ -1, 1, Conv, [ 1024, 3, 1 ] ],
31
+ [ -1, 1, Conv, [ 512, 1, 1 ] ],
32
+ [ -1, 1, Conv, [ 1024, 3, 1 ] ], # 15 (P5/32-large)
33
 
34
+ [ -2, 1, Conv, [ 256, 1, 1 ] ],
35
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
36
+ [ [ -1, 8 ], 1, Concat, [ 1 ] ], # cat backbone P4
37
+ [ -1, 1, Bottleneck, [ 512, False ] ],
38
+ [ -1, 1, Bottleneck, [ 512, False ] ],
39
+ [ -1, 1, Conv, [ 256, 1, 1 ] ],
40
+ [ -1, 1, Conv, [ 512, 3, 1 ] ], # 22 (P4/16-medium)
41
 
42
+ [ -2, 1, Conv, [ 128, 1, 1 ] ],
43
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
44
+ [ [ -1, 6 ], 1, Concat, [ 1 ] ], # cat backbone P3
45
+ [ -1, 1, Bottleneck, [ 256, False ] ],
46
+ [ -1, 2, Bottleneck, [ 256, False ] ], # 27 (P3/8-small)
47
 
48
+ [ [ 27, 22, 15 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5)
49
  ]
models/hub/yolov3-tiny.yaml CHANGED
@@ -1,41 +1,39 @@
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,14, 23,27, 37,58] # P4/16
9
- - [81,82, 135,169, 344,319] # P5/32
10
 
11
  # YOLOv3-tiny backbone
12
  backbone:
13
  # [from, number, module, args]
14
- [[-1, 1, Conv, [16, 3, 1]], # 0
15
- [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 1-P1/2
16
- [-1, 1, Conv, [32, 3, 1]],
17
- [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 3-P2/4
18
- [-1, 1, Conv, [64, 3, 1]],
19
- [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 5-P3/8
20
- [-1, 1, Conv, [128, 3, 1]],
21
- [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 7-P4/16
22
- [-1, 1, Conv, [256, 3, 1]],
23
- [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 9-P5/32
24
- [-1, 1, Conv, [512, 3, 1]],
25
- [-1, 1, nn.ZeroPad2d, [[0, 1, 0, 1]]], # 11
26
- [-1, 1, nn.MaxPool2d, [2, 1, 0]], # 12
27
  ]
28
 
29
  # YOLOv3-tiny head
30
  head:
31
- [[-1, 1, Conv, [1024, 3, 1]],
32
- [-1, 1, Conv, [256, 1, 1]],
33
- [-1, 1, Conv, [512, 3, 1]], # 15 (P5/32-large)
34
 
35
- [-2, 1, Conv, [128, 1, 1]],
36
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
37
- [[-1, 8], 1, Concat, [1]], # cat backbone P4
38
- [-1, 1, Conv, [256, 3, 1]], # 19 (P4/16-medium)
39
 
40
- [[19, 15], 1, Detect, [nc, anchors]], # Detect(P4, P5)
41
  ]
 
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
  anchors:
6
+ - [ 10,14, 23,27, 37,58 ] # P4/16
7
+ - [ 81,82, 135,169, 344,319 ] # P5/32
8
 
9
  # YOLOv3-tiny backbone
10
  backbone:
11
  # [from, number, module, args]
12
+ [ [ -1, 1, Conv, [ 16, 3, 1 ] ], # 0
13
+ [ -1, 1, nn.MaxPool2d, [ 2, 2, 0 ] ], # 1-P1/2
14
+ [ -1, 1, Conv, [ 32, 3, 1 ] ],
15
+ [ -1, 1, nn.MaxPool2d, [ 2, 2, 0 ] ], # 3-P2/4
16
+ [ -1, 1, Conv, [ 64, 3, 1 ] ],
17
+ [ -1, 1, nn.MaxPool2d, [ 2, 2, 0 ] ], # 5-P3/8
18
+ [ -1, 1, Conv, [ 128, 3, 1 ] ],
19
+ [ -1, 1, nn.MaxPool2d, [ 2, 2, 0 ] ], # 7-P4/16
20
+ [ -1, 1, Conv, [ 256, 3, 1 ] ],
21
+ [ -1, 1, nn.MaxPool2d, [ 2, 2, 0 ] ], # 9-P5/32
22
+ [ -1, 1, Conv, [ 512, 3, 1 ] ],
23
+ [ -1, 1, nn.ZeroPad2d, [ [ 0, 1, 0, 1 ] ] ], # 11
24
+ [ -1, 1, nn.MaxPool2d, [ 2, 1, 0 ] ], # 12
25
  ]
26
 
27
  # YOLOv3-tiny head
28
  head:
29
+ [ [ -1, 1, Conv, [ 1024, 3, 1 ] ],
30
+ [ -1, 1, Conv, [ 256, 1, 1 ] ],
31
+ [ -1, 1, Conv, [ 512, 3, 1 ] ], # 15 (P5/32-large)
32
 
33
+ [ -2, 1, Conv, [ 128, 1, 1 ] ],
34
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
35
+ [ [ -1, 8 ], 1, Concat, [ 1 ] ], # cat backbone P4
36
+ [ -1, 1, Conv, [ 256, 3, 1 ] ], # 19 (P4/16-medium)
37
 
38
+ [ [ 19, 15 ], 1, Detect, [ nc, anchors ] ], # Detect(P4, P5)
39
  ]
models/hub/yolov3.yaml CHANGED
@@ -1,51 +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
- - [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
  ]
 
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
  anchors:
6
+ - [ 10,13, 16,30, 33,23 ] # P3/8
7
+ - [ 30,61, 62,45, 59,119 ] # P4/16
8
+ - [ 116,90, 156,198, 373,326 ] # P5/32
9
 
10
  # darknet53 backbone
11
  backbone:
12
  # [from, number, module, args]
13
+ [ [ -1, 1, Conv, [ 32, 3, 1 ] ], # 0
14
+ [ -1, 1, Conv, [ 64, 3, 2 ] ], # 1-P1/2
15
+ [ -1, 1, Bottleneck, [ 64 ] ],
16
+ [ -1, 1, Conv, [ 128, 3, 2 ] ], # 3-P2/4
17
+ [ -1, 2, Bottleneck, [ 128 ] ],
18
+ [ -1, 1, Conv, [ 256, 3, 2 ] ], # 5-P3/8
19
+ [ -1, 8, Bottleneck, [ 256 ] ],
20
+ [ -1, 1, Conv, [ 512, 3, 2 ] ], # 7-P4/16
21
+ [ -1, 8, Bottleneck, [ 512 ] ],
22
+ [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 9-P5/32
23
+ [ -1, 4, Bottleneck, [ 1024 ] ], # 10
24
  ]
25
 
26
  # YOLOv3 head
27
  head:
28
+ [ [ -1, 1, Bottleneck, [ 1024, False ] ],
29
+ [ -1, 1, Conv, [ 512, [ 1, 1 ] ] ],
30
+ [ -1, 1, Conv, [ 1024, 3, 1 ] ],
31
+ [ -1, 1, Conv, [ 512, 1, 1 ] ],
32
+ [ -1, 1, Conv, [ 1024, 3, 1 ] ], # 15 (P5/32-large)
33
 
34
+ [ -2, 1, Conv, [ 256, 1, 1 ] ],
35
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
36
+ [ [ -1, 8 ], 1, Concat, [ 1 ] ], # cat backbone P4
37
+ [ -1, 1, Bottleneck, [ 512, False ] ],
38
+ [ -1, 1, Bottleneck, [ 512, False ] ],
39
+ [ -1, 1, Conv, [ 256, 1, 1 ] ],
40
+ [ -1, 1, Conv, [ 512, 3, 1 ] ], # 22 (P4/16-medium)
41
 
42
+ [ -2, 1, Conv, [ 128, 1, 1 ] ],
43
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
44
+ [ [ -1, 6 ], 1, Concat, [ 1 ] ], # cat backbone P3
45
+ [ -1, 1, Bottleneck, [ 256, False ] ],
46
+ [ -1, 2, Bottleneck, [ 256, False ] ], # 27 (P3/8-small)
47
 
48
+ [ [ 27, 22, 15 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5)
49
  ]
models/hub/yolov5-fpn.yaml CHANGED
@@ -1,42 +1,40 @@
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
  # YOLOv5 backbone
13
  backbone:
14
  # [from, number, module, args]
15
- [[-1, 1, Focus, [64, 3]], # 0-P1/2
16
- [-1, 1, Conv, [128, 3, 2]], # 1-P2/4
17
- [-1, 3, Bottleneck, [128]],
18
- [-1, 1, Conv, [256, 3, 2]], # 3-P3/8
19
- [-1, 9, BottleneckCSP, [256]],
20
- [-1, 1, Conv, [512, 3, 2]], # 5-P4/16
21
- [-1, 9, BottleneckCSP, [512]],
22
- [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
23
- [-1, 1, SPP, [1024, [5, 9, 13]]],
24
- [-1, 6, BottleneckCSP, [1024]], # 9
25
  ]
26
 
27
  # YOLOv5 FPN head
28
  head:
29
- [[-1, 3, BottleneckCSP, [1024, False]], # 10 (P5/32-large)
30
 
31
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
32
- [[-1, 6], 1, Concat, [1]], # cat backbone P4
33
- [-1, 1, Conv, [512, 1, 1]],
34
- [-1, 3, BottleneckCSP, [512, False]], # 14 (P4/16-medium)
35
 
36
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
37
- [[-1, 4], 1, Concat, [1]], # cat backbone P3
38
- [-1, 1, Conv, [256, 1, 1]],
39
- [-1, 3, BottleneckCSP, [256, False]], # 18 (P3/8-small)
40
 
41
- [[18, 14, 10], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
42
  ]
 
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
  anchors:
6
+ - [ 10,13, 16,30, 33,23 ] # P3/8
7
+ - [ 30,61, 62,45, 59,119 ] # P4/16
8
+ - [ 116,90, 156,198, 373,326 ] # P5/32
9
 
10
  # YOLOv5 backbone
11
  backbone:
12
  # [from, number, module, args]
13
+ [ [ -1, 1, Focus, [ 64, 3 ] ], # 0-P1/2
14
+ [ -1, 1, Conv, [ 128, 3, 2 ] ], # 1-P2/4
15
+ [ -1, 3, Bottleneck, [ 128 ] ],
16
+ [ -1, 1, Conv, [ 256, 3, 2 ] ], # 3-P3/8
17
+ [ -1, 9, BottleneckCSP, [ 256 ] ],
18
+ [ -1, 1, Conv, [ 512, 3, 2 ] ], # 5-P4/16
19
+ [ -1, 9, BottleneckCSP, [ 512 ] ],
20
+ [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 7-P5/32
21
+ [ -1, 1, SPP, [ 1024, [ 5, 9, 13 ] ] ],
22
+ [ -1, 6, BottleneckCSP, [ 1024 ] ], # 9
23
  ]
24
 
25
  # YOLOv5 FPN head
26
  head:
27
+ [ [ -1, 3, BottleneckCSP, [ 1024, False ] ], # 10 (P5/32-large)
28
 
29
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
30
+ [ [ -1, 6 ], 1, Concat, [ 1 ] ], # cat backbone P4
31
+ [ -1, 1, Conv, [ 512, 1, 1 ] ],
32
+ [ -1, 3, BottleneckCSP, [ 512, False ] ], # 14 (P4/16-medium)
33
 
34
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
35
+ [ [ -1, 4 ], 1, Concat, [ 1 ] ], # cat backbone P3
36
+ [ -1, 1, Conv, [ 256, 1, 1 ] ],
37
+ [ -1, 3, BottleneckCSP, [ 256, False ] ], # 18 (P3/8-small)
38
 
39
+ [ [ 18, 14, 10 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5)
40
  ]
models/hub/yolov5-p2.yaml CHANGED
@@ -1,9 +1,7 @@
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: 3
8
 
9
  # YOLOv5 backbone
 
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
  anchors: 3
6
 
7
  # YOLOv5 backbone
models/hub/yolov5-p6.yaml CHANGED
@@ -1,9 +1,7 @@
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: 3
8
 
9
  # YOLOv5 backbone
 
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
  anchors: 3
6
 
7
  # YOLOv5 backbone
models/hub/yolov5-p7.yaml CHANGED
@@ -1,9 +1,7 @@
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: 3
8
 
9
  # YOLOv5 backbone
 
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
  anchors: 3
6
 
7
  # YOLOv5 backbone
models/hub/yolov5-panet.yaml CHANGED
@@ -1,48 +1,46 @@
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
  # YOLOv5 backbone
13
  backbone:
14
  # [from, number, module, args]
15
- [[-1, 1, Focus, [64, 3]], # 0-P1/2
16
- [-1, 1, Conv, [128, 3, 2]], # 1-P2/4
17
- [-1, 3, BottleneckCSP, [128]],
18
- [-1, 1, Conv, [256, 3, 2]], # 3-P3/8
19
- [-1, 9, BottleneckCSP, [256]],
20
- [-1, 1, Conv, [512, 3, 2]], # 5-P4/16
21
- [-1, 9, BottleneckCSP, [512]],
22
- [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
23
- [-1, 1, SPP, [1024, [5, 9, 13]]],
24
- [-1, 3, BottleneckCSP, [1024, False]], # 9
25
  ]
26
 
27
  # YOLOv5 PANet head
28
  head:
29
- [[-1, 1, Conv, [512, 1, 1]],
30
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
31
- [[-1, 6], 1, Concat, [1]], # cat backbone P4
32
- [-1, 3, BottleneckCSP, [512, False]], # 13
33
 
34
- [-1, 1, Conv, [256, 1, 1]],
35
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
36
- [[-1, 4], 1, Concat, [1]], # cat backbone P3
37
- [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small)
38
 
39
- [-1, 1, Conv, [256, 3, 2]],
40
- [[-1, 14], 1, Concat, [1]], # cat head P4
41
- [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium)
42
 
43
- [-1, 1, Conv, [512, 3, 2]],
44
- [[-1, 10], 1, Concat, [1]], # cat head P5
45
- [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large)
46
 
47
- [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
48
  ]
 
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
  anchors:
6
+ - [ 10,13, 16,30, 33,23 ] # P3/8
7
+ - [ 30,61, 62,45, 59,119 ] # P4/16
8
+ - [ 116,90, 156,198, 373,326 ] # P5/32
9
 
10
  # YOLOv5 backbone
11
  backbone:
12
  # [from, number, module, args]
13
+ [ [ -1, 1, Focus, [ 64, 3 ] ], # 0-P1/2
14
+ [ -1, 1, Conv, [ 128, 3, 2 ] ], # 1-P2/4
15
+ [ -1, 3, BottleneckCSP, [ 128 ] ],
16
+ [ -1, 1, Conv, [ 256, 3, 2 ] ], # 3-P3/8
17
+ [ -1, 9, BottleneckCSP, [ 256 ] ],
18
+ [ -1, 1, Conv, [ 512, 3, 2 ] ], # 5-P4/16
19
+ [ -1, 9, BottleneckCSP, [ 512 ] ],
20
+ [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 7-P5/32
21
+ [ -1, 1, SPP, [ 1024, [ 5, 9, 13 ] ] ],
22
+ [ -1, 3, BottleneckCSP, [ 1024, False ] ], # 9
23
  ]
24
 
25
  # YOLOv5 PANet head
26
  head:
27
+ [ [ -1, 1, Conv, [ 512, 1, 1 ] ],
28
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
29
+ [ [ -1, 6 ], 1, Concat, [ 1 ] ], # cat backbone P4
30
+ [ -1, 3, BottleneckCSP, [ 512, False ] ], # 13
31
 
32
+ [ -1, 1, Conv, [ 256, 1, 1 ] ],
33
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
34
+ [ [ -1, 4 ], 1, Concat, [ 1 ] ], # cat backbone P3
35
+ [ -1, 3, BottleneckCSP, [ 256, False ] ], # 17 (P3/8-small)
36
 
37
+ [ -1, 1, Conv, [ 256, 3, 2 ] ],
38
+ [ [ -1, 14 ], 1, Concat, [ 1 ] ], # cat head P4
39
+ [ -1, 3, BottleneckCSP, [ 512, False ] ], # 20 (P4/16-medium)
40
 
41
+ [ -1, 1, Conv, [ 512, 3, 2 ] ],
42
+ [ [ -1, 10 ], 1, Concat, [ 1 ] ], # cat head P5
43
+ [ -1, 3, BottleneckCSP, [ 1024, False ] ], # 23 (P5/32-large)
44
 
45
+ [ [ 17, 20, 23 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5)
46
  ]
models/hub/yolov5l6.yaml CHANGED
@@ -1,9 +1,7 @@
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
 
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
  anchors:
6
  - [ 19,27, 44,40, 38,94 ] # P3/8
7
  - [ 96,68, 86,152, 180,137 ] # P4/16
models/hub/yolov5m6.yaml CHANGED
@@ -1,9 +1,7 @@
1
- # parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.67 # model depth multiple
4
  width_multiple: 0.75 # 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
 
1
+ # Parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.67 # model depth multiple
4
  width_multiple: 0.75 # layer channel multiple
 
 
5
  anchors:
6
  - [ 19,27, 44,40, 38,94 ] # P3/8
7
  - [ 96,68, 86,152, 180,137 ] # P4/16
models/hub/yolov5s-transformer.yaml CHANGED
@@ -1,48 +1,46 @@
1
- # parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.33 # model depth multiple
4
  width_multiple: 0.50 # 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
  # YOLOv5 backbone
13
  backbone:
14
  # [from, number, module, args]
15
- [[-1, 1, Focus, [64, 3]], # 0-P1/2
16
- [-1, 1, Conv, [128, 3, 2]], # 1-P2/4
17
- [-1, 3, C3, [128]],
18
- [-1, 1, Conv, [256, 3, 2]], # 3-P3/8
19
- [-1, 9, C3, [256]],
20
- [-1, 1, Conv, [512, 3, 2]], # 5-P4/16
21
- [-1, 9, C3, [512]],
22
- [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32
23
- [-1, 1, SPP, [1024, [5, 9, 13]]],
24
- [-1, 3, C3TR, [1024, False]], # 9 <-------- C3TR() Transformer module
25
  ]
26
 
27
  # YOLOv5 head
28
  head:
29
- [[-1, 1, Conv, [512, 1, 1]],
30
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
31
- [[-1, 6], 1, Concat, [1]], # cat backbone P4
32
- [-1, 3, C3, [512, False]], # 13
33
 
34
- [-1, 1, Conv, [256, 1, 1]],
35
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
36
- [[-1, 4], 1, Concat, [1]], # cat backbone P3
37
- [-1, 3, C3, [256, False]], # 17 (P3/8-small)
38
 
39
- [-1, 1, Conv, [256, 3, 2]],
40
- [[-1, 14], 1, Concat, [1]], # cat head P4
41
- [-1, 3, C3, [512, False]], # 20 (P4/16-medium)
42
 
43
- [-1, 1, Conv, [512, 3, 2]],
44
- [[-1, 10], 1, Concat, [1]], # cat head P5
45
- [-1, 3, C3, [1024, False]], # 23 (P5/32-large)
46
 
47
- [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
48
  ]
 
1
+ # Parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.33 # model depth multiple
4
  width_multiple: 0.50 # layer channel multiple
 
 
5
  anchors:
6
+ - [ 10,13, 16,30, 33,23 ] # P3/8
7
+ - [ 30,61, 62,45, 59,119 ] # P4/16
8
+ - [ 116,90, 156,198, 373,326 ] # P5/32
9
 
10
  # YOLOv5 backbone
11
  backbone:
12
  # [from, number, module, args]
13
+ [ [ -1, 1, Focus, [ 64, 3 ] ], # 0-P1/2
14
+ [ -1, 1, Conv, [ 128, 3, 2 ] ], # 1-P2/4
15
+ [ -1, 3, C3, [ 128 ] ],
16
+ [ -1, 1, Conv, [ 256, 3, 2 ] ], # 3-P3/8
17
+ [ -1, 9, C3, [ 256 ] ],
18
+ [ -1, 1, Conv, [ 512, 3, 2 ] ], # 5-P4/16
19
+ [ -1, 9, C3, [ 512 ] ],
20
+ [ -1, 1, Conv, [ 1024, 3, 2 ] ], # 7-P5/32
21
+ [ -1, 1, SPP, [ 1024, [ 5, 9, 13 ] ] ],
22
+ [ -1, 3, C3TR, [ 1024, False ] ], # 9 <-------- C3TR() Transformer module
23
  ]
24
 
25
  # YOLOv5 head
26
  head:
27
+ [ [ -1, 1, Conv, [ 512, 1, 1 ] ],
28
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
29
+ [ [ -1, 6 ], 1, Concat, [ 1 ] ], # cat backbone P4
30
+ [ -1, 3, C3, [ 512, False ] ], # 13
31
 
32
+ [ -1, 1, Conv, [ 256, 1, 1 ] ],
33
+ [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
34
+ [ [ -1, 4 ], 1, Concat, [ 1 ] ], # cat backbone P3
35
+ [ -1, 3, C3, [ 256, False ] ], # 17 (P3/8-small)
36
 
37
+ [ -1, 1, Conv, [ 256, 3, 2 ] ],
38
+ [ [ -1, 14 ], 1, Concat, [ 1 ] ], # cat head P4
39
+ [ -1, 3, C3, [ 512, False ] ], # 20 (P4/16-medium)
40
 
41
+ [ -1, 1, Conv, [ 512, 3, 2 ] ],
42
+ [ [ -1, 10 ], 1, Concat, [ 1 ] ], # cat head P5
43
+ [ -1, 3, C3, [ 1024, False ] ], # 23 (P5/32-large)
44
 
45
+ [ [ 17, 20, 23 ], 1, Detect, [ nc, anchors ] ], # Detect(P3, P4, P5)
46
  ]
models/hub/yolov5s6.yaml CHANGED
@@ -1,9 +1,7 @@
1
- # parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.33 # model depth multiple
4
  width_multiple: 0.50 # 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
 
1
+ # Parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.33 # model depth multiple
4
  width_multiple: 0.50 # layer channel multiple
 
 
5
  anchors:
6
  - [ 19,27, 44,40, 38,94 ] # P3/8
7
  - [ 96,68, 86,152, 180,137 ] # P4/16
models/hub/yolov5x6.yaml CHANGED
@@ -1,9 +1,7 @@
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
  - [ 19,27, 44,40, 38,94 ] # P3/8
9
  - [ 96,68, 86,152, 180,137 ] # P4/16
 
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
  anchors:
6
  - [ 19,27, 44,40, 38,94 ] # P3/8
7
  - [ 96,68, 86,152, 180,137 ] # P4/16
models/yolo.py CHANGED
@@ -154,7 +154,7 @@ class Model(nn.Module):
154
 
155
  x = m(x) # run
156
  y.append(x if m.i in self.save else None) # save output
157
-
158
  if feature_vis and m.type == 'models.common.SPP':
159
  feature_visualization(x, m.type, m.i)
160
 
 
154
 
155
  x = m(x) # run
156
  y.append(x if m.i in self.save else None) # save output
157
+
158
  if feature_vis and m.type == 'models.common.SPP':
159
  feature_visualization(x, m.type, m.i)
160
 
models/yolov5l.yaml CHANGED
@@ -1,9 +1,7 @@
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
 
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
  anchors:
6
  - [10,13, 16,30, 33,23] # P3/8
7
  - [30,61, 62,45, 59,119] # P4/16
models/yolov5m.yaml CHANGED
@@ -1,9 +1,7 @@
1
- # parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.67 # model depth multiple
4
  width_multiple: 0.75 # 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
 
1
+ # Parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.67 # model depth multiple
4
  width_multiple: 0.75 # layer channel multiple
 
 
5
  anchors:
6
  - [10,13, 16,30, 33,23] # P3/8
7
  - [30,61, 62,45, 59,119] # P4/16
models/yolov5s.yaml CHANGED
@@ -1,9 +1,7 @@
1
- # parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.33 # model depth multiple
4
  width_multiple: 0.50 # 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
 
1
+ # Parameters
2
  nc: 80 # number of classes
3
  depth_multiple: 0.33 # model depth multiple
4
  width_multiple: 0.50 # layer channel multiple
 
 
5
  anchors:
6
  - [10,13, 16,30, 33,23] # P3/8
7
  - [30,61, 62,45, 59,119] # P4/16
models/yolov5x.yaml CHANGED
@@ -1,9 +1,7 @@
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
  - [10,13, 16,30, 33,23] # P3/8
9
  - [30,61, 62,45, 59,119] # P4/16
 
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
  anchors:
6
  - [10,13, 16,30, 33,23] # P3/8
7
  - [30,61, 62,45, 59,119] # P4/16