Sample feature map at given coordinates
(self, feat_map, x)
| 287 | return [xy_feat, xz_feat, yz_feat] |
| 288 | |
| 289 | def sample_feature_plane2D(self, feat_map, x): |
| 290 | """Sample feature map at given coordinates""" |
| 291 | # feat_map: [1, C, H, W] |
| 292 | # x: [N, 2] |
| 293 | N = x.shape[0] |
| 294 | sample_coords = x.view(1, 1, N, 2) |
| 295 | feat = F.grid_sample(feat_map, sample_coords.flip(-1), |
| 296 | align_corners=False, padding_mode='border')[0, :, 0, :].transpose(0, 1) |
| 297 | return feat |
| 298 | |
| 299 | def decode(self, x, feat_maps, aabb=None): |
| 300 | # x [N, 3] |