MCPcopy Create free account
hub / github.com/Sin3DM/Sin3DM / sample_feature_plane2D

Method sample_feature_plane2D

src/encoding/networks.py:79–87  ·  view source on GitHub ↗

Sample feature map at given coordinates

(self, feat_map, x)

Source from the content-addressed store, hash-verified

77 return [xy_feat, xz_feat, yz_feat]
78
79 def sample_feature_plane2D(self, feat_map, x):
80 """Sample feature map at given coordinates"""
81 # feat_map: [1, C, H, W]
82 # x: [N, 2]
83 N = x.shape[0]
84 sample_coords = x.view(1, 1, N, 2)
85 feat = F.grid_sample(feat_map, sample_coords.flip(-1),
86 align_corners=False, padding_mode='border')[0, :, 0, :].transpose(0, 1)
87 return feat
88
89 def decode(self, x, feat_maps, aabb=None):
90 # x [N, 3]

Callers 1

decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected