Bugfixes in render_flyaround

Summary: Fixes bugs in render_flyaround

Reviewed By: bottler

Differential Revision: D39271932

fbshipit-source-id: 07e6c9ee07ba91feb437b725af0a8942fd98db0b
This commit is contained in:
David Novotny
2022-09-06 05:45:31 -07:00
committed by Facebook GitHub Bot
parent c79c954dea
commit f6d43eaa62
2 changed files with 38 additions and 30 deletions

View File

@@ -190,6 +190,7 @@ def render_flyaround(
sequence_name=batch.sequence_name[0],
viz=viz,
viz_env=visdom_environment,
predicted_keys=visualize_preds_keys,
)
logger.info(f"Exporting videos for sequence {sequence_name} ...")
@@ -202,6 +203,7 @@ def render_flyaround(
video_path=output_video_path,
resize=video_resize,
video_frames_dir=output_video_frames_dir,
predicted_keys=visualize_preds_keys,
)
@@ -338,10 +340,15 @@ def _generate_prediction_videos(
# init a video writer for each predicted key
vws = {}
for k in predicted_keys:
cache_dir = (
None
if video_frames_dir is None
else os.path.join(video_frames_dir, f"{sequence_name}_{k}")
)
vws[k] = VideoWriter(
fps=fps,
out_path=f"{video_path}_{sequence_name}_{k}.mp4",
cache_dir=os.path.join(video_frames_dir, f"{sequence_name}_{k}"),
cache_dir=cache_dir,
)
for rendered_pred in tqdm(preds):