Open Swaraj-72 opened 3 years ago
The coordinates of all centers are a constraint, by default, within [-1, 1]. This means the length of the side of each grid is [1 - (-1)]/N = 2/N where N is the number of grids in each direction. Thus, the shortest distance between the center of each grid to its border (radius, r) = (2/N)/2 = 2 / N / 2
I believe flip is required for properly indexing x and y coordinates.
The documentation for grid_sample()
states that,
...the size-2 vector grid[n, h, w] specifies input pixel locations x and y... .
As the coord
variable is basically a meshgride in (y, x) coordinate format (here), flip is required.
For later readers, note that in grid_sample(), the x-axis is along the width of an image and the y-axis is along its height.
I believe flip is required for properly indexing x and y coordinates. The documentation for
grid_sample()
states that,...the size-2 vector grid[n, h, w] specifies input pixel locations x and y... .
As the
coord
variable is basically a meshgride in (y, x) coordinate format (here), flip is required.
Hi, I have found it difficult to understand the purpose of rx, ry in the code below. Kindly let me know the same. Also why should we perform the flip operation (coord.flip(-1)) on the "coord" variable when we have received the actual coordinates.Thank you.