From f37a66bf6fca3dc750deb26039951952c535a745 Mon Sep 17 00:00:00 2001 From: wuyefeilin <30919197+wuyefeilin@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:54:07 +0800 Subject: [PATCH] [Matting] Update human_matting.py (#1732) --- contrib/Matting/model/human_matting.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/contrib/Matting/model/human_matting.py b/contrib/Matting/model/human_matting.py index d16207dfd8..31a8930610 100644 --- a/contrib/Matting/model/human_matting.py +++ b/contrib/Matting/model/human_matting.py @@ -374,9 +374,15 @@ def forward(self, src, pha, err, hid, tri): x = paddle.concat([hid, pha, tri], axis=1) x = F.interpolate( - x, (h_half, w_half), mode='bilinear', align_corners=False) + x, + paddle.concat((h_half, w_half)), + mode='bilinear', + align_corners=False) y = F.interpolate( - src, (h_half, w_half), mode='bilinear', align_corners=False) + src, + paddle.concat((h_half, w_half)), + mode='bilinear', + align_corners=False) if self.kernel_size == 3: x = F.pad(x, [3, 3, 3, 3]) @@ -386,10 +392,11 @@ def forward(self, src, pha, err, hid, tri): x = self.conv2(x) if self.kernel_size == 3: - x = F.interpolate(x, (h_full + 4, w_full + 4)) + x = F.interpolate(x, paddle.concat((h_full + 4, w_full + 4))) y = F.pad(src, [2, 2, 2, 2]) else: - x = F.interpolate(x, (h_full, w_full), mode='nearest') + x = F.interpolate( + x, paddle.concat((h_full, w_full)), mode='nearest') y = src x = self.conv3(paddle.concat([x, y], axis=1))