From 849bc5adb8ca32cf0fa509bf492c160c7fb33ec5 Mon Sep 17 00:00:00 2001 From: Gean Date: Thu, 4 Apr 2024 17:36:17 +0100 Subject: [PATCH] fix: support fix from test --- nerfstudio/scripts/render.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nerfstudio/scripts/render.py b/nerfstudio/scripts/render.py index 6ffa7465908..f5ed187b0fd 100644 --- a/nerfstudio/scripts/render.py +++ b/nerfstudio/scripts/render.py @@ -166,14 +166,16 @@ def _render_trajectory_video( .numpy() ) render_image.append(output_image) - render_image = np.concatenate(render_image, axis=1) - if output_format == "images": - if image_format == "png": - media.write_image(output_image_dir / f"{camera_idx:05d}.png", render_image, fmt="png") - if image_format == "jpeg": - media.write_image( - output_image_dir / f"{camera_idx:05d}.jpg", render_image, fmt="jpeg", quality=jpeg_quality - ) + if not is_depth: + render_image = np.concatenate(render_image, axis=1) + + if output_format == "images": + if image_format == "png": + media.write_image(output_image_dir / f"{camera_idx:05d}.png", render_image, fmt="png") + if image_format == "jpeg": + media.write_image( + output_image_dir / f"{camera_idx:05d}.jpg", render_image, fmt="jpeg", quality=jpeg_quality + ) if output_format == "video": if writer is None: render_width = int(render_image.shape[1])