-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render cameras with render times for dynamic nerfs #1199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Can you add the --dynamic
to the render command when it is used -
const cmd = `ns-render --load-config ${config_filename} --traj filename --camera-path-filename ${camera_path_filename} --output-path renders/${filename}.mp4`; |
Also I think we should clamp the time to 0-1, as some models may require that.
nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/CameraPanel.jsx
Outdated
Show resolved
Hide resolved
Added the |
Just fixed a bug with clamping in the previous commit - should be good now. |
Thinking a little more about it, does it make sense not to include the time in the json if time isn't used. Then the export script can render with time only if it is present? That would remove the requirement for the user to specify |
Makes sense, actually I initially thought this too but since it was my first time with React, I was just going with what seemed simplest at the time. But I've changed it now to work as you described and it actually makes the overall PR and changes much simpler. Thus now in I re-tested with both a dnerf and nerfacto (non-dynamic) model and the exported .json is either with/without the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for making those changes. Sorry for not mentioning it earlier.
No worries! Thanks! |
…t#1199) * Render cameras with render times for dynamic nerfs * Add --dynamic flag to cmd. Clamp render times. * Fix for issues with clamping renderTime * Only add render_time to camera path if dynamic nerf * change DEFAULT_TIME to DEFAULT_RENDER_TIME Co-authored-by: Liam Schoneveld <[email protected]>
…t#1199) * Render cameras with render times for dynamic nerfs * Add --dynamic flag to cmd. Clamp render times. * Fix for issues with clamping renderTime * Only add render_time to camera path if dynamic nerf * change DEFAULT_TIME to DEFAULT_RENDER_TIME Co-authored-by: Liam Schoneveld <[email protected]>
…t#1199) * Render cameras with render times for dynamic nerfs * Add --dynamic flag to cmd. Clamp render times. * Fix for issues with clamping renderTime * Only add render_time to camera path if dynamic nerf * change DEFAULT_TIME to DEFAULT_RENDER_TIME Co-authored-by: Liam Schoneveld <[email protected]>
See #1178
Add a
--dynamic
flag tons-render
. If this is provided, theget_path_from_json
will look for the fieldrender_time
in each camera of thecamera_path
(which comes from UI-exported .json file). If these fields are present, then when constructing theCameras
, theserender_time
s are used. This allows for varying timestamps when rendering from a dynamic nerf.On the viewer side, like with the "Render Timestep" control on the Controls tab, if the
/model/has_temporal_distortion
msg is true, then controls for the Render cameras' timesteps will be visible. Using these additional controls, one can now set therender_time
s that are exported to the camera path .json. This is acheived basically by copying the setup for FOV. Like FOV, therender_time
can either be the same for all cameras, or specified per-camera. As per FOV, smoothness is applied to the per-camerarender_time
s.Have tested this PR on a private dataset and it works as expected. If needed I could put together a toy dataset as a test.
Potential (minor) issues or nitpicks with this PR:
render_time
s can be <0.0 or >1.0. This is probably not a huge deal and the exported values shouldn't go too far beyond this range, but perhaps we want to clip the values.camera_path
.json
s will contain thisrender_time
field, even if the path was exported from a non-dynamic nerf. This shouldn't be a problem however as they will be ignored byns-render
if the--dynamic
flag is not passed.