Skip to content

Commit

Permalink
rotating the value map if the map has also been rotated
Browse files Browse the repository at this point in the history
  • Loading branch information
naokiyokoyamabd committed Aug 11, 2023
1 parent d1069e5 commit d528e64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zsos/utils/habitat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def collect_data(
cost_map = crop_white_border(cost_map)
# Make the image at least 150 pixels tall or wide
cost_map = pad_larger_dim(cost_map, 150)
# Rotate the image if the corresponding map is taller than it is wide
map = infos[0]["top_down_map"]["map"]
if map.shape[0] > map.shape[1]:
cost_map = np.rot90(cost_map, 1)
# Pad the shorter dimension to be the same size as the longer
cost_map = pad_to_square(cost_map, extra_pad=50)
# Pad the image border with some white space
Expand Down

0 comments on commit d528e64

Please sign in to comment.