Skip to content

Commit

Permalink
Update render.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hardikdava authored Jul 15, 2024
1 parent fbababa commit 920697e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nerfstudio/scripts/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def _render_trajectory_video(
outputs = pipeline.model.get_outputs_for_camera(
cameras[camera_idx : camera_idx + 1], obb_box=obb_box
)
if "rgba" in rendered_output_names:
rgba = pipeline.model.get_rgba_image(outputs=outputs, output_name="rgb")
outputs["rgba"] = rgba

render_image = []
for rendered_output_name in rendered_output_names:
Expand All @@ -221,6 +224,8 @@ def _render_trajectory_video(
.cpu()
.numpy()
)
elif rendered_output_name == "rgba":
output_image = output_image.detach().cpu().numpy()
else:
output_image = (
colormaps.apply_colormap(
Expand Down Expand Up @@ -833,12 +838,11 @@ def update_config(config: TrainerConfig) -> TrainerConfig:
output_image = gt_batch[output_name]
else:
output_image = outputs[output_name]
del output_name

# Map to color spaces / numpy
if is_raw:
output_image = output_image.cpu().numpy()
elif rendered_output_name == "rgba": # for RGBA image just do simple numpy conversion
elif output_name == "rgba": # for RGBA image just do simple numpy conversion
output_image = output_image.detach().cpu().numpy()
elif is_depth:
output_image = (
Expand Down

0 comments on commit 920697e

Please sign in to comment.