Skip to content

Commit

Permalink
visualize seed points if present
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanhle committed Aug 13, 2024
1 parent df76cb5 commit 07aca40
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions nerfstudio/viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ def nested_folder_install(folder_labels: List[str], prev_labels: List[str], elem
self.toggle_pause_button()
self._toggle_training_state(None)

# if self.pipeline.model.seed_points[0] is not None:
# self.viser_server.add_point_cloud(
# "/seed_points",
# points=pipeline.model.seed_points[0].numpy(force=True) * VISER_NERFSTUDIO_SCALE_RATIO,
# colors=pipeline.model.seed_points[1].numpy(force=True),
# point_size=0.1,
# point_shape="circle",
# visible=False, # Hidden by default.
# )
if hasattr(self.pipeline.model, "seed_points") and self.pipeline.model.seed_points[0] is not None:
self.viser_server.add_point_cloud(
"/seed_points",
points=self.pipeline.model.seed_points[0].numpy(force=True) * VISER_NERFSTUDIO_SCALE_RATIO,
colors=self.pipeline.model.seed_points[1].numpy(force=True),
point_size=0.1,
point_shape="circle",
visible=False,
)

scene_box = pipeline.model.scene_box
aabb = scene_box.aabb.detach().cpu().numpy() * VISER_NERFSTUDIO_SCALE_RATIO
Expand Down Expand Up @@ -430,8 +430,6 @@ def update_scene_box(self):
self.pipeline.model.render_aabb = SceneBox(aabb=new_aabb)
self.pipeline.model.populate_modules()

print(f"Updated AABB device: {new_aabb.device}")

def toggle_pause_button(self) -> None:
self.pause_train.visible = not self.pause_train.visible
self.resume_train.visible = not self.resume_train.visible
Expand Down

0 comments on commit 07aca40

Please sign in to comment.