Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions unidepth/models/unidepthv2/unidepthv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def get_paddings(original_shape, aspect_ratio_range):

if orig_aspect_ratio > target_aspect_ratio: # Too wide
W_new = W_ori
H_new = int(W_ori / target_aspect_ratio)
H_new = max(int(W_ori / target_aspect_ratio), H_ori)
pad_top = (H_new - H_ori) // 2
pad_bottom = H_new - H_ori - pad_top
pad_left, pad_right = 0, 0
else: # Too tall
H_new = H_ori
W_new = int(H_ori * target_aspect_ratio)
W_new = max(int(H_ori * target_aspect_ratio), W_ori)
pad_left = (W_new - W_ori) // 2
pad_right = W_new - W_ori - pad_left
pad_top, pad_bottom = 0, 0
Expand Down