Skip to content

Commit

Permalink
[Matting] Update human_matting.py (#1732)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyefeilin committed Jan 19, 2022
1 parent 627f5c0 commit f37a66b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions contrib/Matting/model/human_matting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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))
Expand Down

0 comments on commit f37a66b

Please sign in to comment.