NVlabs / PWC-Net

PWC-Net: CNNs for Optical Flow Using Pyramid, Warping, and Cost Volume, CVPR 2018 (Oral)
Other
1.63k stars 357 forks source link

output*mask in warp #99

Open cxy7tv opened 4 years ago

cxy7tv commented 4 years ago

Hi, I have no idea why mask is needed following code in PWC-Net/PyTorch/models/PWCNet.py mask = torch.autograd.Variable(torch.ones(x.size())).cuda() mask = nn.functional.grid_sample(mask, vgrid)

    # if W==128:
        # np.save('mask.npy', mask.cpu().data.numpy())
        # np.save('warp.npy', output.cpu().data.numpy())

    mask[mask<0.9999] = 0
    mask[mask>0] = 1

    return output*mask
poppinjie commented 3 years ago

It seems that getting rid of it has the same effect.