decode feature volume at grid points
(self, triplane_feat, reso, batch_size=2 ** 14, aabb=None)
| 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]: |
no test coverage detected