Skip to content

Commit 930f218

Browse files
committed
Match gridbatch and grid API
Signed-off-by: Francis Williams <francis@fwilliams.info>
1 parent bd15de3 commit 930f218

File tree

11 files changed

+252
-256
lines changed

11 files changed

+252
-256
lines changed

examples/wip/structure_prediction_net.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44

55
import os
66

7+
import fvdb.nn as fvnn
78
import numpy as np
9+
import point_cloud_utils as pcu
10+
import polyscope as ps
811
import torch
912
import torch.nn as nn
1013
import torch.nn.functional as F
11-
12-
import point_cloud_utils as pcu
13-
import polyscope as ps
14-
1514
import torch_cudamanaged
1615

1716
import fvdb
18-
import fvdb.nn as fvnn
1917

2018
torch.backends.cudnn.deterministic = True
2119
np.random.seed(42)
@@ -125,7 +123,7 @@ def normalize_pts(xyz: np.ndarray):
125123

126124
def visualize_grid(grid: fvdb.GridBatch):
127125
ps.init()
128-
xyz = grid.grid_to_world(grid.ijk.float())
126+
xyz = grid.voxel_to_world(grid.ijk.float())
129127
for batch_idx in range(grid.grid_count):
130128
pts = xyz[batch_idx].jdata.cpu().numpy()
131129
ps.register_point_cloud(f"grid_{batch_idx}", pts, radius=0.0025)

fvdb/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,8 @@ def _parse_device_string(device_or_device_string: str | torch.device) -> torch.d
7575
jempty,
7676
)
7777

78-
# Import GridBatch and gridbatch_from_* functions from grid_batch.py
79-
from .grid_batch import (
80-
GridBatch,
81-
load_gridbatch,
82-
save_gridbatch,
83-
)
84-
85-
78+
# Import GridBatch and Grid
79+
from .grid_batch import GridBatch
8680
from .grid import Grid
8781

8882

0 commit comments

Comments
 (0)