|
@@ -77,9 +77,12 @@ class HRNet(object):
|
|
|
st4 = self.backbone(image)
|
|
st4 = self.backbone(image)
|
|
|
# upsample
|
|
# upsample
|
|
|
shape = fluid.layers.shape(st4[0])[-2:]
|
|
shape = fluid.layers.shape(st4[0])[-2:]
|
|
|
- st4[1] = fluid.layers.resize_bilinear(st4[1], out_shape=shape)
|
|
|
|
|
- st4[2] = fluid.layers.resize_bilinear(st4[2], out_shape=shape)
|
|
|
|
|
- st4[3] = fluid.layers.resize_bilinear(st4[3], out_shape=shape)
|
|
|
|
|
|
|
+ st4[1] = fluid.layers.resize_bilinear(
|
|
|
|
|
+ st4[1], out_shape=shape, align_corners=False, align_mode=1)
|
|
|
|
|
+ st4[2] = fluid.layers.resize_bilinear(
|
|
|
|
|
+ st4[2], out_shape=shape, align_corners=False, align_mode=1)
|
|
|
|
|
+ st4[3] = fluid.layers.resize_bilinear(
|
|
|
|
|
+ st4[3], out_shape=shape, align_corners=False, align_mode=1)
|
|
|
|
|
|
|
|
out = fluid.layers.concat(st4, axis=1)
|
|
out = fluid.layers.concat(st4, axis=1)
|
|
|
last_channels = sum(self.backbone.channels[str(self.backbone.width)][
|
|
last_channels = sum(self.backbone.channels[str(self.backbone.width)][
|
|
@@ -104,7 +107,8 @@ class HRNet(object):
|
|
|
bias_attr=False)
|
|
bias_attr=False)
|
|
|
|
|
|
|
|
input_shape = fluid.layers.shape(image)[-2:]
|
|
input_shape = fluid.layers.shape(image)[-2:]
|
|
|
- logit = fluid.layers.resize_bilinear(out, input_shape)
|
|
|
|
|
|
|
+ logit = fluid.layers.resize_bilinear(
|
|
|
|
|
+ out, input_shape, align_corners=False, align_mode=1)
|
|
|
|
|
|
|
|
if self.num_classes == 1:
|
|
if self.num_classes == 1:
|
|
|
out = sigmoid_to_softmax(logit)
|
|
out = sigmoid_to_softmax(logit)
|