Skip to content

Commit

Permalink
update viz save
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianxff committed May 3, 2024
1 parent 91e628d commit 735c1bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/droid_core/droid.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def terminate(self, stream=None):

torch.cuda.empty_cache()
print("#" * 32)
self.backend(12)
self.backend(20)

camera_trajectory = self.traj_filler(stream)
camera_trajectory = camera_trajectory.inv().data.cpu().numpy()
Expand Down
8 changes: 6 additions & 2 deletions modules/droid_core/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,16 @@ def animation_callback(vis):
vis.run()

# save traj ply for visualization
if vis_save is None:
if vis_save is not None:
print('saving visualization scene')
vis_save = Path(vis_save)
import os
os.makedirs(vis_save, exist_ok=True)

pcd = o3d.geometry.PointCloud()
for actor in droid_visualization.points.values():
pcd += actor
o3d.io.write_point_cloud(str(vis_save / 'scene.plt'), pcd)
o3d.io.write_point_cloud(str(vis_save / 'scene.ply'), pcd)

# save traj
lineset = o3d.geometry.LineSet()
Expand Down

0 comments on commit 735c1bf

Please sign in to comment.