diff --git a/.gitignore b/.gitignore index 85c2ca4e5..84ed2e9ce 100644 --- a/.gitignore +++ b/.gitignore @@ -168,10 +168,8 @@ outputs/ events.out.* # Data -data/ -data_*/ -!nerfstudio/data -!docs/tutorials/data/ +data +!*/data # Misc old/ diff --git a/README.md b/README.md index 0b994a611..2d8c8bbf7 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ After your model has trained, you can headlessly render out a video of the scene ```bash # assuming previously ran `ns-train nerfacto` -ns-render --load-config=outputs/data-nerfstudio-poster/nerfacto/{TIMESTAMP}/config.yml --traj=spiral --output-path=output.mp4 +ns-render --load-config=outputs/data-nerfstudio-poster/nerfacto/{TIMESTAMP}/config.yml --traj=spiral --output-path=renders/output.mp4 ``` # Learn More diff --git a/docs/quickstart/first_nerf.md b/docs/quickstart/first_nerf.md index 9bc9979d7..6575b9144 100644 --- a/docs/quickstart/first_nerf.md +++ b/docs/quickstart/first_nerf.md @@ -120,7 +120,7 @@ For slower methods where the viewer is not recommended, we default to [Wandb](ht We also provide options to render out the scene of a trained model with a custom trajectory and save the output to a video. ```bash -ns-render --load-config={PATH_TO_CONFIG} --traj=spiral --output-path=output.mp4 +ns-render --load-config={PATH_TO_CONFIG} --traj=spiral --output-path=renders/output.mp4 ``` While we provide pre-specified trajectory options, `--traj={spiral, interp, filename}` we can also specify a custom trajectory if we specify `--traj=filename --camera-path-filename {PATH}`. diff --git a/nerfstudio/viewer/app/package.json b/nerfstudio/viewer/app/package.json index a41ca97eb..de8ca23e8 100644 --- a/nerfstudio/viewer/app/package.json +++ b/nerfstudio/viewer/app/package.json @@ -1,7 +1,7 @@ { "name": "viewer", "homepage": ".", - "version": "22-10-02-0", + "version": "22-10-07-0", "private": true, "dependencies": { "@emotion/react": "^11.10.4", diff --git a/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/CameraPanel.jsx b/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/CameraPanel.jsx index e70b1b7cd..836cd8248 100644 --- a/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/CameraPanel.jsx +++ b/nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/CameraPanel.jsx @@ -469,7 +469,7 @@ export default function CameraPanel(props) { // Copy the text inside the text field const config_filename = `${config_base_dir}/config.yml`; const camera_path_filename = `${config_base_dir}/camera_path.json`; - const cmd = `ns-render --load-config ${config_filename} --traj filename --camera-path-filename ${camera_path_filename} --output-path output.mp4`; + const cmd = `ns-render --load-config ${config_filename} --traj filename --camera-path-filename ${camera_path_filename} --output-path renders/output.mp4`; navigator.clipboard.writeText(cmd); const camera_path_payload = { diff --git a/scripts/render.py b/scripts/render.py index 7db0ea87d..e785c2ffd 100644 --- a/scripts/render.py +++ b/scripts/render.py @@ -80,6 +80,8 @@ def _render_trajectory_video( images.append(image) fps = len(images) / seconds + # make the folder if it doesn't exist + output_filename.parent.mkdir(parents=True, exist_ok=True) with console.status("[yellow]Saving video", spinner="bouncingBall"): media.write_video(output_filename, images, fps=fps) console.rule("[green] :tada: :tada: :tada: Success :tada: :tada: :tada:") @@ -101,7 +103,7 @@ class RenderTrajectory: # Filename of the camera path to render. camera_path_filename: Path = Path("camera_path.json") # Name of the output file. - output_path: Path = Path("output.mp4") + output_path: Path = Path("renders/output.mp4") # How long the video should be. seconds: float = 5.0 # A hack to double the number of samples for the nerfacto method.