Skip to content

Commit 8afdca3

Browse files
authored
Batch-dimension fix for demo_match.py (#146)
1 parent b90820c commit 8afdca3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/demo_match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
x2 = (torch.tensor(np.array(im2)) / 255).to(device).permute(2, 0, 1)
4040

4141
im2_transfer_rgb = F.grid_sample(
42-
x2[None], warp[:,:W, 2:][None], mode="bilinear", align_corners=False
42+
x2[None], warp[:, :, :W, 2:], mode="bilinear", align_corners=False
4343
)[0]
4444
im1_transfer_rgb = F.grid_sample(
45-
x1[None], warp[:, W:, :2][None], mode="bilinear", align_corners=False
45+
x1[None], warp[:, :, W:, :2], mode="bilinear", align_corners=False
4646
)[0]
4747
warp_im = torch.cat((im2_transfer_rgb,im1_transfer_rgb),dim=2)
4848
white_im = torch.ones((H,2*W),device=device)

0 commit comments

Comments
 (0)