Skip to content

Commit f37a66b

Browse files
authored
[Matting] Update human_matting.py (#1732)
1 parent 627f5c0 commit f37a66b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

contrib/Matting/model/human_matting.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,15 @@ def forward(self, src, pha, err, hid, tri):
374374

375375
x = paddle.concat([hid, pha, tri], axis=1)
376376
x = F.interpolate(
377-
x, (h_half, w_half), mode='bilinear', align_corners=False)
377+
x,
378+
paddle.concat((h_half, w_half)),
379+
mode='bilinear',
380+
align_corners=False)
378381
y = F.interpolate(
379-
src, (h_half, w_half), mode='bilinear', align_corners=False)
382+
src,
383+
paddle.concat((h_half, w_half)),
384+
mode='bilinear',
385+
align_corners=False)
380386

381387
if self.kernel_size == 3:
382388
x = F.pad(x, [3, 3, 3, 3])
@@ -386,10 +392,11 @@ def forward(self, src, pha, err, hid, tri):
386392
x = self.conv2(x)
387393

388394
if self.kernel_size == 3:
389-
x = F.interpolate(x, (h_full + 4, w_full + 4))
395+
x = F.interpolate(x, paddle.concat((h_full + 4, w_full + 4)))
390396
y = F.pad(src, [2, 2, 2, 2])
391397
else:
392-
x = F.interpolate(x, (h_full, w_full), mode='nearest')
398+
x = F.interpolate(
399+
x, paddle.concat((h_full, w_full)), mode='nearest')
393400
y = src
394401

395402
x = self.conv3(paddle.concat([x, y], axis=1))

0 commit comments

Comments
 (0)