Sample feature map at given coordinates
(self, feat_map, x)
| 180 | return [xy_feat, xz_feat, yz_feat] |
| 181 | |
| 182 | def sample_feature_plane2D(self, feat_map, x): |
| 183 | """Sample feature map at given coordinates""" |
| 184 | # feat_map: [1, C, H, W] |
| 185 | # x: [N, 2] |
| 186 | N = x.shape[0] |
| 187 | sample_coords = x.view(1, 1, N, 2) |
| 188 | feat = F.grid_sample(feat_map, sample_coords.flip(-1), |
| 189 | align_corners=False, padding_mode='border')[0, :, 0, :].transpose(0, 1) |
| 190 | return feat |
| 191 | |
| 192 | def decode(self, x, feat_maps, aabb=None): |
| 193 | # x [N, 3] |