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

Method decode_grid

src/encoding/model.py:336–349  ·  view source on GitHub ↗

decode feature volume at grid points

(self, triplane_feat, reso, batch_size=2 ** 14, aabb=None)

Source from the content-addressed store, hash-verified

334
335 @torch.no_grad()
336 def decode_grid(self, triplane_feat, reso, batch_size=2 ** 14, aabb=None):
337 """decode feature volume at grid points"""
338 self.net.eval()
339
340 # coords = sample_uniform(reso, sdim=3, device=self.device) # (H, W, D, 3)
341 if aabb is None:
342 aabb = self.aabb
343 coords = sample_grid_points_aabb(aabb, reso) # (H, W, D, 3)
344 H, W, D, _ = coords.shape
345 coords_list = coords.view(-1, 3) # (H*W*D, 3)
346
347 preds = self.decode_batch(triplane_feat, coords_list, batch_size=batch_size, aabb=aabb)
348 preds = preds.view(H, W, D, -1)
349 return preds
350
351 def _resize_aabb(self, featmap_size):
352 if featmap_size[0] != self.featmap_size[0] or featmap_size[1] != self.featmap_size[1] or featmap_size[2] != self.featmap_size[2]:

Callers 2

decode_texmeshMethod · 0.95
decode_voxelMethod · 0.95

Calls 2

decode_batchMethod · 0.95
sample_grid_points_aabbFunction · 0.70

Tested by

no test coverage detected