Skip to content

Commit

Permalink
save renders to a folder and bump viewer version (nerfstudio-project#733
Browse files Browse the repository at this point in the history
)

save data to renders folder. bump viewer
  • Loading branch information
ethanweber authored Oct 7, 2022
1 parent eb81d1b commit 527481e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,8 @@ outputs/
events.out.*

# Data
data/
data_*/
!nerfstudio/data
!docs/tutorials/data/
data
!*/data

# Misc
old/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/first_nerf.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`.
Expand Down
2 changes: 1 addition & 1 deletion nerfstudio/viewer/app/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 3 additions & 1 deletion scripts/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand All @@ -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.
Expand Down

0 comments on commit 527481e

Please sign in to comment.