4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00

work around mismatch to allow rgb depth side-by-side output (#1156)

* use max resolution when not moving or training

* work around mismatch to allow rgb depth side-by-side output

* Update render.py

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
This commit is contained in:
machenmusik 2022-12-21 22:13:20 -05:00 committed by GitHub
parent 0e1ea37308
commit 8d4a82ef0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,11 @@ def _render_trajectory_video(
with ExitStack() as stack:
writer = (
stack.enter_context(media.VideoWriter(path=output_filename, shape=(render_height, render_width), fps=fps))
stack.enter_context(
media.VideoWriter(
path=output_filename, shape=(render_height, render_width * len(rendered_output_names)), fps=fps
)
)
if output_format == "video"
else None
)
@ -109,6 +113,8 @@ def _render_trajectory_video(
)
sys.exit(1)
output_image = outputs[rendered_output_name].cpu().numpy()
if output_image.shape[-1] == 1:
output_image = np.concatenate((output_image,) * 3, axis=-1)
render_image.append(output_image)
render_image = np.concatenate(render_image, axis=1)
if output_format == "images":