Skip to content

Commit

Permalink
Send client-specific background instead of broadcasting
Browse files Browse the repository at this point in the history
  • Loading branch information
hangg7 committed Mar 29, 2023
1 parent 11e666d commit 3f49b8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/8_nerfacc/visualize_ngp_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ def render_image_from_camera(camera: viser.CameraState) -> None:
def camera_update(client: viser.ClientHandle) -> None:
camera = client.get_camera()
print("New camera", camera)
server.set_background_image(render_image_from_camera(camera))
client.set_background_image(render_image_from_camera(camera))

# Show the client ID in the GUI.
client.add_gui_text("Info", initial_value=f"Client {id}", disabled=True)

camera = client.get_camera()
server.set_background_image(render_image_from_camera(camera))
client.set_background_image(render_image_from_camera(camera))
print(f"Camera pose for client {id}")
print(f"\twxyz: {camera.wxyz}")
print(f"\tposition: {camera.position}")
Expand Down
7 changes: 2 additions & 5 deletions examples/8_nerfacc/visualize_ngp_nerf_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ def quat_from_mat3(
)


__import__("ipdb").set_trace()


@torch.inference_mode()
def render_image_from_camera(camera: viser.CameraState) -> None:
# TODO(hangg): Hard-code for now. Should expose it to GUI and/or deternine
Expand Down Expand Up @@ -304,13 +301,13 @@ def render_image_from_camera(camera: viser.CameraState) -> None:
def camera_update(client: viser.ClientHandle) -> None:
camera = client.get_camera()
print("New camera", camera)
server.set_background_image(render_image_from_camera(camera))
client.set_background_image(render_image_from_camera(camera))

# Show the client ID in the GUI.
client.add_gui_text("Info", initial_value=f"Client {id}", disabled=True)

camera = client.get_camera()
server.set_background_image(render_image_from_camera(camera))
client.set_background_image(render_image_from_camera(camera))
print(f"Camera pose for client {id}")
print(f"\twxyz: {camera.wxyz}")
print(f"\tposition: {camera.position}")
Expand Down

0 comments on commit 3f49b8c

Please sign in to comment.