Skip to content

Commit

Permalink
easyvolcap: exporting full precision pointsplat
Browse files Browse the repository at this point in the history
  • Loading branch information
dendenxu committed Jan 20, 2024
1 parent e92f7e7 commit 569d678
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion easyvolcap/runners/volumetric_video_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def set_bg_brightness(val: float): self.model.sampler.bg_brightness = val # a t
self.static.mesh_class = Mesh
if imgui.button('Add point splat from file'):
self.static.add_mesh_dialog = pfd.open_file('Select file', filters=['PLY Files', '*.ply'])
self.static.mesh_class = PointSplat
self.static.mesh_class = Splat
if imgui.button('Add gaussian splat from file'):
self.static.add_mesh_dialog = pfd.open_file('Select file', filters=['3DGS Files', '*.ply *.npz *.pt *.pth'])
self.static.mesh_class = Gaussian
Expand Down
8 changes: 4 additions & 4 deletions easyvolcap/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,12 @@ def load_pts(filename: str):
r = np.asarray(cloud.points['red'])
g = np.asarray(cloud.points['green'])
b = np.asarray(cloud.points['blue'])
colors = np.stack([r, g, b], axis=-1) / 255
colors = (np.stack([r, g, b], axis=-1) / 255).astype(np.float32)
elif 'r' in cloud.points and 'g' in cloud.points and 'b' in cloud.points:
r = np.asarray(cloud.points['r'])
g = np.asarray(cloud.points['g'])
b = np.asarray(cloud.points['b'])
colors = np.stack([r, g, b], axis=-1) / 255
colors = (np.stack([r, g, b], axis=-1) / 255).astype(np.float32)
else:
colors = None

Expand All @@ -522,8 +522,8 @@ def load_pts(filename: str):
else:
norms = None

if 'alpha' in cloud.points:
cloud.points['alpha'] = cloud.points['alpha'] / 255
# if 'alpha' in cloud.points:
# cloud.points['alpha'] = cloud.points['alpha'] / 255

reserved = ['x', 'y', 'z', 'red', 'green', 'blue', 'r', 'g', 'b', 'nx', 'ny', 'nz']
scalars = dotdict({k: np.asarray(cloud.points[k])[..., None] for k in cloud.points if k not in reserved}) # one extra dimension at the back added
Expand Down
1 change: 1 addition & 0 deletions easyvolcap/utils/gl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ def render(self, camera: Camera):
xyz = self.pts
occ = self.occ
rad = self.rad

rgb, acc, dpt = self.render_radius(*add_batch([xyz, sh0, rad, occ]), batch)

if self.view_depth:
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/volume_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def fuse(runner: "VolumetricVideoRunner", args: argparse.Namespace):
dirs = torch.stack([image_to_size(i.permute(2, 0, 1), (H, W)).permute(1, 2, 0) for i in dirs]) # V, H, W, 3
rgbs = torch.stack([image_to_size(i.permute(2, 0, 1), (H, W)).permute(1, 2, 0) for i in rgbs]) # V, H, W, 3
occs = torch.stack([image_to_size(i.permute(2, 0, 1), (H, W)).permute(1, 2, 0) for i in occs]) # V, H, W, 1
rads = torch.stack([image_to_size(i.permute(2, 0, 1), (H, W)).permute(1, 2, 0) for i in occs]) # V, H, W, 1
rads = torch.stack([image_to_size(i.permute(2, 0, 1), (H, W)).permute(1, 2, 0) for i in rads]) # V, H, W, 1

ptss_out = []
rgbs_out = []
Expand Down

0 comments on commit 569d678

Please sign in to comment.