Skip to content

Commit

Permalink
更新特征层大小的说明
Browse files Browse the repository at this point in the history
  • Loading branch information
Egret-dev committed Feb 17, 2023
1 parent 511cb53 commit d75036f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions nets/backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,24 @@ def __init__(self, transition_channels, block_channels, n, pretrained=False):
# 输入图片是640, 640, 3
#-----------------------------------------------#
ids = [-1, -2, -3, -4]

# 640, 640, 3 => 320, 320, 64
self.stem = Conv(3, transition_channels * 2, 3, 2)

# 320, 320, 64 => 160, 160, 128 => 160, 160, 128
self.dark2 = nn.Sequential(
Conv(transition_channels * 2, transition_channels * 4, 3, 2),
Multi_Concat_Block(transition_channels * 4, block_channels * 2, transition_channels * 4, n=n, ids=ids),
)
# 160, 160, 128 => 80, 80, 128 => 80, 80, 256
self.dark3 = nn.Sequential(
MP(),
Multi_Concat_Block(transition_channels * 4, block_channels * 4, transition_channels * 8, n=n, ids=ids),
)
# 80, 80, 256 => 40, 40, 256 => 40, 40, 512
self.dark4 = nn.Sequential(
MP(),
Multi_Concat_Block(transition_channels * 8, block_channels * 8, transition_channels * 16, n=n, ids=ids),
)
# 40, 40, 512 => 20, 20, 512 => 20, 20, 1024
self.dark5 = nn.Sequential(
MP(),
Multi_Concat_Block(transition_channels * 16, block_channels * 16, transition_channels * 32, n=n, ids=ids),
Expand Down
6 changes: 3 additions & 3 deletions nets/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ def forward(self, x):
P5 = self.rep_conv_3(P5)
#---------------------------------------------------#
# 第三个特征层
# y3=(batch_size, 75, 80, 80)
# y3=(batch_size, 78, 80, 80)
#---------------------------------------------------#
out2 = self.yolo_head_P3(P3)
#---------------------------------------------------#
# 第二个特征层
# y2=(batch_size, 75, 40, 40)
# y2=(batch_size, 78, 40, 40)
#---------------------------------------------------#
out1 = self.yolo_head_P4(P4)
#---------------------------------------------------#
# 第一个特征层
# y1=(batch_size, 75, 20, 20)
# y1=(batch_size, 78, 20, 20)
#---------------------------------------------------#
out0 = self.yolo_head_P5(P5)

Expand Down

0 comments on commit d75036f

Please sign in to comment.