Skip to content

Commit

Permalink
Yolov7-components
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-OvO committed Aug 21, 2022
1 parent 0325e7e commit 34485b5
Show file tree
Hide file tree
Showing 90 changed files with 107,506 additions and 0 deletions.
49 changes: 49 additions & 0 deletions cfg/baseline/r50-csp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# parameters
nc: 80 # number of classes
depth_multiple: 1.0 # model depth multiple
width_multiple: 1.0 # layer channel multiple

# anchors
anchors:
- [12,16, 19,36, 40,28] # P3/8
- [36,75, 76,55, 72,146] # P4/16
- [142,110, 192,243, 459,401] # P5/32

# CSP-ResNet backbone
backbone:
# [from, number, module, args]
[[-1, 1, Stem, [128]], # 0-P1/2
[-1, 3, ResCSPC, [128]],
[-1, 1, Conv, [256, 3, 2]], # 2-P3/8
[-1, 4, ResCSPC, [256]],
[-1, 1, Conv, [512, 3, 2]], # 4-P3/8
[-1, 6, ResCSPC, [512]],
[-1, 1, Conv, [1024, 3, 2]], # 6-P3/8
[-1, 3, ResCSPC, [1024]], # 7
]

# CSP-Res-PAN head
head:
[[-1, 1, SPPCSPC, [512]], # 8
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[5, 1, Conv, [256, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 2, ResCSPB, [256]], # 13
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[3, 1, Conv, [128, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 2, ResCSPB, [128]], # 18
[-1, 1, Conv, [256, 3, 1]],
[-2, 1, Conv, [256, 3, 2]],
[[-1, 13], 1, Concat, [1]], # cat
[-1, 2, ResCSPB, [256]], # 22
[-1, 1, Conv, [512, 3, 1]],
[-2, 1, Conv, [512, 3, 2]],
[[-1, 8], 1, Concat, [1]], # cat
[-1, 2, ResCSPB, [512]], # 26
[-1, 1, Conv, [1024, 3, 1]],

[[19,23,27], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
]
49 changes: 49 additions & 0 deletions cfg/baseline/x50-csp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# parameters
nc: 80 # number of classes
depth_multiple: 1.0 # model depth multiple
width_multiple: 1.0 # layer channel multiple

# anchors
anchors:
- [12,16, 19,36, 40,28] # P3/8
- [36,75, 76,55, 72,146] # P4/16
- [142,110, 192,243, 459,401] # P5/32

# CSP-ResNeXt backbone
backbone:
# [from, number, module, args]
[[-1, 1, Stem, [128]], # 0-P1/2
[-1, 3, ResXCSPC, [128]],
[-1, 1, Conv, [256, 3, 2]], # 2-P3/8
[-1, 4, ResXCSPC, [256]],
[-1, 1, Conv, [512, 3, 2]], # 4-P3/8
[-1, 6, ResXCSPC, [512]],
[-1, 1, Conv, [1024, 3, 2]], # 6-P3/8
[-1, 3, ResXCSPC, [1024]], # 7
]

# CSP-ResX-PAN head
head:
[[-1, 1, SPPCSPC, [512]], # 8
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[5, 1, Conv, [256, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 2, ResXCSPB, [256]], # 13
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[3, 1, Conv, [128, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 2, ResXCSPB, [128]], # 18
[-1, 1, Conv, [256, 3, 1]],
[-2, 1, Conv, [256, 3, 2]],
[[-1, 13], 1, Concat, [1]], # cat
[-1, 2, ResXCSPB, [256]], # 22
[-1, 1, Conv, [512, 3, 1]],
[-2, 1, Conv, [512, 3, 2]],
[[-1, 8], 1, Concat, [1]], # cat
[-1, 2, ResXCSPB, [512]], # 26
[-1, 1, Conv, [1024, 3, 1]],

[[19,23,27], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
]
52 changes: 52 additions & 0 deletions cfg/baseline/yolor-csp-x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# parameters
nc: 80 # number of classes
depth_multiple: 1.33 # model depth multiple
width_multiple: 1.25 # layer channel multiple

# anchors
anchors:
- [12,16, 19,36, 40,28] # P3/8
- [36,75, 76,55, 72,146] # P4/16
- [142,110, 192,243, 459,401] # P5/32

# CSP-Darknet backbone
backbone:
# [from, number, module, args]
[[-1, 1, Conv, [32, 3, 1]], # 0
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
[-1, 1, Bottleneck, [64]],
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
[-1, 2, BottleneckCSPC, [128]],
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
[-1, 8, BottleneckCSPC, [256]],
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
[-1, 8, BottleneckCSPC, [512]],
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
[-1, 4, BottleneckCSPC, [1024]], # 10
]

# CSP-Dark-PAN head
head:
[[-1, 1, SPPCSPC, [512]], # 11
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[8, 1, Conv, [256, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 2, BottleneckCSPB, [256]], # 16
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[6, 1, Conv, [128, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 2, BottleneckCSPB, [128]], # 21
[-1, 1, Conv, [256, 3, 1]],
[-2, 1, Conv, [256, 3, 2]],
[[-1, 16], 1, Concat, [1]], # cat
[-1, 2, BottleneckCSPB, [256]], # 25
[-1, 1, Conv, [512, 3, 1]],
[-2, 1, Conv, [512, 3, 2]],
[[-1, 11], 1, Concat, [1]], # cat
[-1, 2, BottleneckCSPB, [512]], # 29
[-1, 1, Conv, [1024, 3, 1]],

[[22,26,30], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
]
52 changes: 52 additions & 0 deletions cfg/baseline/yolor-csp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# parameters
nc: 80 # number of classes
depth_multiple: 1.0 # model depth multiple
width_multiple: 1.0 # layer channel multiple

# anchors
anchors:
- [12,16, 19,36, 40,28] # P3/8
- [36,75, 76,55, 72,146] # P4/16
- [142,110, 192,243, 459,401] # P5/32

# CSP-Darknet backbone
backbone:
# [from, number, module, args]
[[-1, 1, Conv, [32, 3, 1]], # 0
[-1, 1, Conv, [64, 3, 2]], # 1-P1/2
[-1, 1, Bottleneck, [64]],
[-1, 1, Conv, [128, 3, 2]], # 3-P2/4
[-1, 2, BottleneckCSPC, [128]],
[-1, 1, Conv, [256, 3, 2]], # 5-P3/8
[-1, 8, BottleneckCSPC, [256]],
[-1, 1, Conv, [512, 3, 2]], # 7-P4/16
[-1, 8, BottleneckCSPC, [512]],
[-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
[-1, 4, BottleneckCSPC, [1024]], # 10
]

# CSP-Dark-PAN head
head:
[[-1, 1, SPPCSPC, [512]], # 11
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[8, 1, Conv, [256, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 2, BottleneckCSPB, [256]], # 16
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[6, 1, Conv, [128, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 2, BottleneckCSPB, [128]], # 21
[-1, 1, Conv, [256, 3, 1]],
[-2, 1, Conv, [256, 3, 2]],
[[-1, 16], 1, Concat, [1]], # cat
[-1, 2, BottleneckCSPB, [256]], # 25
[-1, 1, Conv, [512, 3, 1]],
[-2, 1, Conv, [512, 3, 2]],
[[-1, 11], 1, Concat, [1]], # cat
[-1, 2, BottleneckCSPB, [512]], # 29
[-1, 1, Conv, [1024, 3, 1]],

[[22,26,30], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
]
63 changes: 63 additions & 0 deletions cfg/baseline/yolor-d6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# parameters
nc: 80 # number of classes
depth_multiple: 1.0 # expand model depth
width_multiple: 1.25 # expand layer channels

# anchors
anchors:
- [ 19,27, 44,40, 38,94 ] # P3/8
- [ 96,68, 86,152, 180,137 ] # P4/16
- [ 140,301, 303,264, 238,542 ] # P5/32
- [ 436,615, 739,380, 925,792 ] # P6/64

# CSP-Darknet backbone
backbone:
# [from, number, module, args]
[[-1, 1, ReOrg, []], # 0
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
[-1, 1, DownC, [128]], # 2-P2/4
[-1, 3, BottleneckCSPA, [128]],
[-1, 1, DownC, [256]], # 4-P3/8
[-1, 15, BottleneckCSPA, [256]],
[-1, 1, DownC, [512]], # 6-P4/16
[-1, 15, BottleneckCSPA, [512]],
[-1, 1, DownC, [768]], # 8-P5/32
[-1, 7, BottleneckCSPA, [768]],
[-1, 1, DownC, [1024]], # 10-P6/64
[-1, 7, BottleneckCSPA, [1024]], # 11
]

# CSP-Dark-PAN head
head:
[[-1, 1, SPPCSPC, [512]], # 12
[-1, 1, Conv, [384, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[-6, 1, Conv, [384, 1, 1]], # route backbone P5
[[-1, -2], 1, Concat, [1]],
[-1, 3, BottleneckCSPB, [384]], # 17
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[-13, 1, Conv, [256, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 3, BottleneckCSPB, [256]], # 22
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[-20, 1, Conv, [128, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 3, BottleneckCSPB, [128]], # 27
[-1, 1, Conv, [256, 3, 1]],
[-2, 1, DownC, [256]],
[[-1, 22], 1, Concat, [1]], # cat
[-1, 3, BottleneckCSPB, [256]], # 31
[-1, 1, Conv, [512, 3, 1]],
[-2, 1, DownC, [384]],
[[-1, 17], 1, Concat, [1]], # cat
[-1, 3, BottleneckCSPB, [384]], # 35
[-1, 1, Conv, [768, 3, 1]],
[-2, 1, DownC, [512]],
[[-1, 12], 1, Concat, [1]], # cat
[-1, 3, BottleneckCSPB, [512]], # 39
[-1, 1, Conv, [1024, 3, 1]],

[[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
]
63 changes: 63 additions & 0 deletions cfg/baseline/yolor-e6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# parameters
nc: 80 # number of classes
depth_multiple: 1.0 # expand model depth
width_multiple: 1.25 # expand layer channels

# anchors
anchors:
- [ 19,27, 44,40, 38,94 ] # P3/8
- [ 96,68, 86,152, 180,137 ] # P4/16
- [ 140,301, 303,264, 238,542 ] # P5/32
- [ 436,615, 739,380, 925,792 ] # P6/64

# CSP-Darknet backbone
backbone:
# [from, number, module, args]
[[-1, 1, ReOrg, []], # 0
[-1, 1, Conv, [64, 3, 1]], # 1-P1/2
[-1, 1, DownC, [128]], # 2-P2/4
[-1, 3, BottleneckCSPA, [128]],
[-1, 1, DownC, [256]], # 4-P3/8
[-1, 7, BottleneckCSPA, [256]],
[-1, 1, DownC, [512]], # 6-P4/16
[-1, 7, BottleneckCSPA, [512]],
[-1, 1, DownC, [768]], # 8-P5/32
[-1, 3, BottleneckCSPA, [768]],
[-1, 1, DownC, [1024]], # 10-P6/64
[-1, 3, BottleneckCSPA, [1024]], # 11
]

# CSP-Dark-PAN head
head:
[[-1, 1, SPPCSPC, [512]], # 12
[-1, 1, Conv, [384, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[-6, 1, Conv, [384, 1, 1]], # route backbone P5
[[-1, -2], 1, Concat, [1]],
[-1, 3, BottleneckCSPB, [384]], # 17
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[-13, 1, Conv, [256, 1, 1]], # route backbone P4
[[-1, -2], 1, Concat, [1]],
[-1, 3, BottleneckCSPB, [256]], # 22
[-1, 1, Conv, [128, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[-20, 1, Conv, [128, 1, 1]], # route backbone P3
[[-1, -2], 1, Concat, [1]],
[-1, 3, BottleneckCSPB, [128]], # 27
[-1, 1, Conv, [256, 3, 1]],
[-2, 1, DownC, [256]],
[[-1, 22], 1, Concat, [1]], # cat
[-1, 3, BottleneckCSPB, [256]], # 31
[-1, 1, Conv, [512, 3, 1]],
[-2, 1, DownC, [384]],
[[-1, 17], 1, Concat, [1]], # cat
[-1, 3, BottleneckCSPB, [384]], # 35
[-1, 1, Conv, [768, 3, 1]],
[-2, 1, DownC, [512]],
[[-1, 12], 1, Concat, [1]], # cat
[-1, 3, BottleneckCSPB, [512]], # 39
[-1, 1, Conv, [1024, 3, 1]],

[[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
]
Loading

0 comments on commit 34485b5

Please sign in to comment.