@@ -197,6 +197,9 @@ def _render_trajectory_video(
197
197
outputs = pipeline .model .get_outputs_for_camera (
198
198
cameras [camera_idx : camera_idx + 1 ], obb_box = obb_box
199
199
)
200
+ if rendered_output_names is not None and "rgba" in rendered_output_names :
201
+ rgba = pipeline .model .get_rgba_image (outputs = outputs , output_name = "rgb" )
202
+ outputs ["rgba" ] = rgba
200
203
201
204
render_image = []
202
205
for rendered_output_name in rendered_output_names :
@@ -221,6 +224,8 @@ def _render_trajectory_video(
221
224
.cpu ()
222
225
.numpy ()
223
226
)
227
+ elif rendered_output_name == "rgba" :
228
+ output_image = output_image .detach ().cpu ().numpy ()
224
229
else :
225
230
output_image = (
226
231
colormaps .apply_colormap (
@@ -790,6 +795,9 @@ def update_config(config: TrainerConfig) -> TrainerConfig:
790
795
for camera_idx , (camera , batch ) in enumerate (progress .track (dataloader , total = len (dataset ))):
791
796
with torch .no_grad ():
792
797
outputs = pipeline .model .get_outputs_for_camera (camera )
798
+ if self .rendered_output_names is not None and "rgba" in self .rendered_output_names :
799
+ rgba = pipeline .model .get_rgba_image (outputs = outputs , output_name = "rgb" )
800
+ outputs ["rgba" ] = rgba
793
801
794
802
gt_batch = batch .copy ()
795
803
gt_batch ["rgb" ] = gt_batch .pop ("image" )
@@ -841,11 +849,12 @@ def update_config(config: TrainerConfig) -> TrainerConfig:
841
849
output_image = gt_batch [output_name ]
842
850
else :
843
851
output_image = outputs [output_name ]
844
- del output_name
845
852
846
853
# Map to color spaces / numpy
847
854
if is_raw :
848
855
output_image = output_image .cpu ().numpy ()
856
+ elif output_name == "rgba" :
857
+ output_image = output_image .detach ().cpu ().numpy ()
849
858
elif is_depth :
850
859
output_image = (
851
860
colormaps .apply_depth_colormap (
0 commit comments