You need to sign in or sign up before continuing.
未验证 提交 bd5d4697 编写于 作者: K Kaipeng Deng 提交者: GitHub

remove useless is_test in yolo_head.py (#1251)

上级 d99a2efb
...@@ -154,7 +154,6 @@ class YOLOv3Head(object): ...@@ -154,7 +154,6 @@ class YOLOv3Head(object):
stride, stride,
padding, padding,
act='leaky', act='leaky',
is_test=True,
name=None): name=None):
conv = fluid.layers.conv2d( conv = fluid.layers.conv2d(
input=input, input=input,
...@@ -174,7 +173,6 @@ class YOLOv3Head(object): ...@@ -174,7 +173,6 @@ class YOLOv3Head(object):
out = fluid.layers.batch_norm( out = fluid.layers.batch_norm(
input=conv, input=conv,
act=None, act=None,
is_test=is_test,
param_attr=bn_param_attr, param_attr=bn_param_attr,
bias_attr=bn_bias_attr, bias_attr=bn_bias_attr,
moving_mean_name=bn_name + '.mean', moving_mean_name=bn_name + '.mean',
...@@ -184,7 +182,7 @@ class YOLOv3Head(object): ...@@ -184,7 +182,7 @@ class YOLOv3Head(object):
out = fluid.layers.leaky_relu(x=out, alpha=0.1) out = fluid.layers.leaky_relu(x=out, alpha=0.1)
return out return out
def _spp_module(self, input, is_test=True, name=""): def _spp_module(self, input, name=""):
output1 = input output1 = input
output2 = fluid.layers.pool2d( output2 = fluid.layers.pool2d(
input=output1, input=output1,
...@@ -231,17 +229,15 @@ class YOLOv3Head(object): ...@@ -231,17 +229,15 @@ class YOLOv3Head(object):
filter_size=1, filter_size=1,
stride=1, stride=1,
padding=0, padding=0,
is_test=is_test,
name='{}.{}.0'.format(name, j)) name='{}.{}.0'.format(name, j))
if self.use_spp and is_first and j == 1: if self.use_spp and is_first and j == 1:
conv = self._spp_module(conv, is_test=is_test, name="spp") conv = self._spp_module(conv, name="spp")
conv = self._conv_bn( conv = self._conv_bn(
conv, conv,
512, 512,
filter_size=1, filter_size=1,
stride=1, stride=1,
padding=0, padding=0,
is_test=is_test,
name='{}.{}.spp.conv'.format(name, j)) name='{}.{}.spp.conv'.format(name, j))
conv = self._conv_bn( conv = self._conv_bn(
conv, conv,
...@@ -249,7 +245,6 @@ class YOLOv3Head(object): ...@@ -249,7 +245,6 @@ class YOLOv3Head(object):
filter_size=3, filter_size=3,
stride=1, stride=1,
padding=1, padding=1,
is_test=is_test,
name='{}.{}.1'.format(name, j)) name='{}.{}.1'.format(name, j))
if self.drop_block and j == 0 and not is_first: if self.drop_block and j == 0 and not is_first:
conv = DropBlock( conv = DropBlock(
...@@ -271,7 +266,6 @@ class YOLOv3Head(object): ...@@ -271,7 +266,6 @@ class YOLOv3Head(object):
filter_size=1, filter_size=1,
stride=1, stride=1,
padding=0, padding=0,
is_test=is_test,
name='{}.2'.format(name)) name='{}.2'.format(name))
new_route = self._add_coord(route, is_test=is_test) new_route = self._add_coord(route, is_test=is_test)
tip = self._conv_bn( tip = self._conv_bn(
...@@ -280,7 +274,6 @@ class YOLOv3Head(object): ...@@ -280,7 +274,6 @@ class YOLOv3Head(object):
filter_size=3, filter_size=3,
stride=1, stride=1,
padding=1, padding=1,
is_test=is_test,
name='{}.tip'.format(name)) name='{}.tip'.format(name))
return route, tip return route, tip
...@@ -371,7 +364,6 @@ class YOLOv3Head(object): ...@@ -371,7 +364,6 @@ class YOLOv3Head(object):
filter_size=1, filter_size=1,
stride=1, stride=1,
padding=0, padding=0,
is_test=(not is_train),
name=self.prefix_name + "yolo_transition.{}".format(i)) name=self.prefix_name + "yolo_transition.{}".format(i))
# upsample # upsample
route = self._upsample(route) route = self._upsample(route)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册