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

Function load_voxgrid

evaluation/patch_utils.py:21–27  ·  view source on GitHub ↗
(path, resolution=128, device="cpu")

Source from the content-addressed store, hash-verified

19
20
21def load_voxgrid(path, resolution=128, device="cpu"):
22 voxgrid = np.load(path)["vox_grid"][:]
23 voxgrid = torch.from_numpy(voxgrid).bool().to(device)
24 if max(voxgrid.shape) != resolution:
25 new_shape = [int(x * resolution / max(voxgrid.shape)) for x in voxgrid.shape]
26 voxgrid = F.adaptive_max_pool3d(voxgrid[None, None].float(), new_shape)[0, 0].bool()
27 return voxgrid
28
29
30def pairwise_IoU_dist(data_list: list):

Callers 3

eval_SSFID_given_pathsFunction · 0.90
eval_LP_given_pathsFunction · 0.85
eval_Div_given_pathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected