Skip to content

Commit

Permalink
FIX-CAP: solved the mosaic video merger for evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Petingo committed Sep 20, 2023
1 parent 9d27931 commit de63f02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eval/script/io_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,10 @@ def dump_animation(est_pos,
graph_frame = os.path.join(vid_graph_temp_path, f"{idx+1}.png")
out_frame = os.path.join(vidgraph_dir, f"{idx+1}.png")

# put the two image side by side with the same height of 500px and save it to out_frame
os.system(f"convert {vid_frame} {graph_frame} +append -resize x500 {out_frame}")
# put the two image side by side with the same height of 500px and save it to out_frame but leave 20 px margin
os.system(f"convert {vid_frame} -resize x500 -bordercolor white -border 80x80 {vid_frame}")
os.system(f"convert {vid_frame} {graph_frame} +append -resize x500 -bordercolor white -gravity center -border 20x20 {out_frame}")
os.system(f"convert {out_frame} -crop +40+0 {out_frame}") # reduce the size of the image by 40px only on the left

plt.close(fig)
gc.collect() # for collecting buffer memory
Expand Down

0 comments on commit de63f02

Please sign in to comment.