zhang-tao-whu/e2ec

question about get_gcn_feature function

Closed this issue · 0 comments

Thanks very much for your work, I have some questions about get_gcn_feature function. In this function, we have input 'cnn_feature','img_poly' . Our main focus is to extract the features of img_polys‘ points from the feature map, is this correct? If so, we need to use torch.nn.functional.grid_sample to finish this task. So why in your code, you didn't normalize img_polys between [-1,1] to target the location in cnn_feature instead
img_poly[..., 0] = img_poly[..., 0] / (w / 2.) - 1
img_poly[..., 1] = img_poly[..., 1] / (h / 2.) - 1

I dont understand how this works, I hope you can help me out.

In torch.nn.functional.grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corners=None)
grid specifies the sampling pixel locations normalized by the input spatial dimensions. Therefore, it should have most values in the range of [-1, 1]