Add camera_type dropdown in new viewer (#2525)

* Add camera_type dropdown in new viewer

Added a gui dropdown menu for selecting the camera type. Currently, the render view doesn't update to preview the equirectangular or fisheye render.

* Updating the image url of nerfstudio logo images for the viewer

Changing the image urls to restore the nerfstudio logo in the viewer

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
This commit is contained in:
Cyrus VachhaandBrent Yi authored and GitHub committed 2023-10-14 21:46:53 -07:00
1 parent e9a3bae859
commit 8e58021a47
2 files changed
+10 -3

No files matched your search

+8 -1
View File
@@ -297,6 +297,13 @@ def populate_render_tab(
"""Update the aspect ratio for all cameras when the resolution changes.""" """Update the aspect ratio for all cameras when the resolution changes."""
camera_path.update_aspect(resolution.value[0] / resolution.value[1]) camera_path.update_aspect(resolution.value[0] / resolution.value[1])
camera_type = server.add_gui_dropdown(
"Camera Type",
("Perspective", "Fisheye", "Equirectangular"),
initial_value="Perspective",
hint="Camera model to render with.",
)
add_button = server.add_gui_button( add_button = server.add_gui_button(
"Add keyframe", "Add keyframe",
icon=viser.Icon.PLUS, icon=viser.Icon.PLUS,
@@ -584,7 +591,7 @@ def populate_render_tab(
} }
) )
json_data["keyframes"] = keyframes json_data["keyframes"] = keyframes
json_data["camera_type"] = "perspective" json_data["camera_type"] = camera_type.value.lower()
json_data["render_height"] = resolution.value[1] json_data["render_height"] = resolution.value[1]
json_data["render_width"] = resolution.value[0] json_data["render_width"] = resolution.value[0]
json_data["fps"] = framerate_slider.value json_data["fps"] = framerate_slider.value
+2 -2
View File
@@ -124,8 +124,8 @@ class Viewer:
), ),
) )
image = viser.theme.TitlebarImage( image = viser.theme.TitlebarImage(
image_url_light="https://docs.nerf.studio/en/latest/_static/imgs/logo.png", image_url_light="https://docs.nerf.studio/_static/imgs/logo.png",
image_url_dark="https://docs.nerf.studio/en/latest/_static/imgs/logo-dark.png", image_url_dark="https://docs.nerf.studio/_static/imgs/logo-dark.png",
image_alt="NerfStudio Logo", image_alt="NerfStudio Logo",
href="https://docs.nerf.studio/", href="https://docs.nerf.studio/",
) )