change render button to run ns-render directly

This commit is contained in:
Gina Wu committed 2024-06-03 20:48:57 -07:00
1 parent 5491df92d9
commit b48fa2f16a
1 file changed
+14 -4
+14 -4
View File
@@ -31,6 +31,7 @@ import viser.transforms as tf
from scipy import interpolate from scipy import interpolate
from nerfstudio.viewer.control_panel import ControlPanel from nerfstudio.viewer.control_panel import ControlPanel
from nerfstudio.utils.scripts import run_command
@dataclasses.dataclass @dataclasses.dataclass
@@ -1019,13 +1020,21 @@ def populate_render_tab(
initial_value=now.strftime("%Y-%m-%d-%H-%M-%S"), initial_value=now.strftime("%Y-%m-%d-%H-%M-%S"),
hint="Name of the render", hint="Name of the render",
) )
render_button = server.add_gui_button( render_button = server.add_gui_button(
"Generate Command", "Render",
color="green", color="green",
icon=viser.Icon.FILE_EXPORT, icon=viser.Icon.FILE_EXPORT,
hint="Generate the ns-render command for rendering the camera path.", hint="Render the camera path and save video as mp4 file.",
) )
# generate_render_button = server.add_gui_button(
# "Generate Command",
# color="green",
# icon=viser.Icon.FILE_EXPORT,
# hint="Generate the ns-render command for rendering the camera path.",
# )
reset_up_button = server.add_gui_button( reset_up_button = server.add_gui_button(
"Reset Up Direction", "Reset Up Direction",
icon=viser.Icon.ARROW_BIG_UP_LINES, icon=viser.Icon.ARROW_BIG_UP_LINES,
@@ -1148,14 +1157,15 @@ def populate_render_tab(
event.client.add_gui_markdown( event.client.add_gui_markdown(
"\n".join( "\n".join(
[ [
"To render the trajectory, run the following from the command line:", "Rendering trajectory and saving file as",
"", "",
"```", "```",
command, f"renders/{dataname}/{render_name_text.value}.mp4",
"```", "```",
] ]
) )
) )
run_command(command, verbose=False)
close_button = event.client.add_gui_button("Close") close_button = event.client.add_gui_button("Close")
@close_button.on_click @close_button.on_click