Pixel2Mesh icon indicating copy to clipboard operation
Pixel2Mesh copied to clipboard

Question on F.grid_sample for mesh to pixel

Open YiruS opened this issue 5 years ago • 1 comments

Hi there,

Thanks for providing the code for pixel2mesh, nice work!

I have one question for computing the 2D image features by computing the correspondence between pixel and vertex in mesh. In models/layers/gprojection.py line 86787, why do you divide the w and h by half of image dimension? Is that to align the coordinate system in PyTorch in order to use F.grid_sample? Some details would be highly appreciated!

Thanks!

YiruS avatar Dec 17 '20 07:12 YiruS

For example, you need to map [0, 800] to [-1, 1]. You need to do this:

  1. minus 800
  2. divide by 400 (which is 800/2).

ultmaster avatar Apr 17 '22 01:04 ultmaster