未验证 提交 29a5c2fa 编写于 作者: W Wenyu 提交者: GitHub

use bias (#6234)

上级 8693e1d0
......@@ -37,7 +37,8 @@ class HRFPN(nn.Layer):
out_channel=256,
share_conv=False,
extra_stage=1,
spatial_scales=[1. / 4, 1. / 8, 1. / 16, 1. / 32]):
spatial_scales=[1. / 4, 1. / 8, 1. / 16, 1. / 32],
use_bias=False):
super(HRFPN, self).__init__()
in_channel = sum(in_channels)
self.in_channel = in_channel
......@@ -47,12 +48,14 @@ class HRFPN(nn.Layer):
spatial_scales = spatial_scales + [spatial_scales[-1] / 2.]
self.spatial_scales = spatial_scales
self.num_out = len(self.spatial_scales)
self.use_bias = use_bias
bias_attr = False if use_bias is False else None
self.reduction = nn.Conv2D(
in_channels=in_channel,
out_channels=out_channel,
kernel_size=1,
bias_attr=False)
bias_attr=bias_attr)
if share_conv:
self.fpn_conv = nn.Conv2D(
......@@ -60,7 +63,7 @@ class HRFPN(nn.Layer):
out_channels=out_channel,
kernel_size=3,
padding=1,
bias_attr=False)
bias_attr=bias_attr)
else:
self.fpn_conv = []
for i in range(self.num_out):
......@@ -72,7 +75,7 @@ class HRFPN(nn.Layer):
out_channels=out_channel,
kernel_size=3,
padding=1,
bias_attr=False))
bias_attr=bias_attr))
self.fpn_conv.append(conv)
def forward(self, body_feats):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册