Skip to content

Commit b37eae5

Browse files
authored
save renders to a folder and bump viewer version (#733)
save data to renders folder. bump viewer
1 parent 26a4192 commit b37eae5

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,8 @@ outputs/
168168
events.out.*
169169

170170
# Data
171-
data/
172-
data_*/
173-
!nerfstudio/data
174-
!docs/tutorials/data/
171+
data
172+
!*/data
175173

176174
# Misc
177175
old/

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ After your model has trained, you can headlessly render out a video of the scene
176176

177177
```bash
178178
# assuming previously ran `ns-train nerfacto`
179-
ns-render --load-config=outputs/data-nerfstudio-poster/nerfacto/{TIMESTAMP}/config.yml --traj=spiral --output-path=output.mp4
179+
ns-render --load-config=outputs/data-nerfstudio-poster/nerfacto/{TIMESTAMP}/config.yml --traj=spiral --output-path=renders/output.mp4
180180
```
181181

182182
# Learn More

docs/quickstart/first_nerf.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ For slower methods where the viewer is not recommended, we default to [Wandb](ht
120120
We also provide options to render out the scene of a trained model with a custom trajectory and save the output to a video.
121121

122122
```bash
123-
ns-render --load-config={PATH_TO_CONFIG} --traj=spiral --output-path=output.mp4
123+
ns-render --load-config={PATH_TO_CONFIG} --traj=spiral --output-path=renders/output.mp4
124124
```
125125

126126
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}`.

nerfstudio/viewer/app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "viewer",
33
"homepage": ".",
4-
"version": "22-10-02-0",
4+
"version": "22-10-07-0",
55
"private": true,
66
"dependencies": {
77
"@emotion/react": "^11.10.4",

nerfstudio/viewer/app/src/modules/SidePanel/CameraPanel/CameraPanel.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export default function CameraPanel(props) {
469469
// Copy the text inside the text field
470470
const config_filename = `${config_base_dir}/config.yml`;
471471
const camera_path_filename = `${config_base_dir}/camera_path.json`;
472-
const cmd = `ns-render --load-config ${config_filename} --traj filename --camera-path-filename ${camera_path_filename} --output-path output.mp4`;
472+
const cmd = `ns-render --load-config ${config_filename} --traj filename --camera-path-filename ${camera_path_filename} --output-path renders/output.mp4`;
473473
navigator.clipboard.writeText(cmd);
474474

475475
const camera_path_payload = {

scripts/render.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def _render_trajectory_video(
8080
images.append(image)
8181

8282
fps = len(images) / seconds
83+
# make the folder if it doesn't exist
84+
output_filename.parent.mkdir(parents=True, exist_ok=True)
8385
with console.status("[yellow]Saving video", spinner="bouncingBall"):
8486
media.write_video(output_filename, images, fps=fps)
8587
console.rule("[green] :tada: :tada: :tada: Success :tada: :tada: :tada:")
@@ -101,7 +103,7 @@ class RenderTrajectory:
101103
# Filename of the camera path to render.
102104
camera_path_filename: Path = Path("camera_path.json")
103105
# Name of the output file.
104-
output_path: Path = Path("output.mp4")
106+
output_path: Path = Path("renders/output.mp4")
105107
# How long the video should be.
106108
seconds: float = 5.0
107109
# A hack to double the number of samples for the nerfacto method.

0 commit comments

Comments
 (0)