Skip to content

Commit

Permalink
fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
matt3o committed Oct 13, 2023
1 parent 532ed8c commit 7755961
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_size(self, width, height):

def __call__(self, x):
width, height = self.get_size(*x.shape[-2:][::-1])
return nn.functional.interpolate(x, (height, width), mode='bilinear', align_corners=True)
return nn.functional.interpolate(x, (int(height), int(width)), mode='bilinear', align_corners=True)

class PrepForMidas(object):
def __init__(self, resize_mode="minimal", keep_aspect_ratio=True, img_size=384, do_resize=True):
Expand Down
2 changes: 1 addition & 1 deletion src/custom_midas_repo/midas/backbones/beit.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _get_rel_pos_bias(self, window_size):
old_sub_table = old_relative_position_bias_table[:old_num_relative_distance - 3]

old_sub_table = old_sub_table.reshape(1, old_width, old_height, -1).permute(0, 3, 1, 2)
new_sub_table = F.interpolate(old_sub_table, size=(new_height, new_width), mode="bilinear")
new_sub_table = F.interpolate(old_sub_table, size=(int(new_height), int(new_width)), mode="bilinear")
new_sub_table = new_sub_table.permute(0, 2, 3, 1).reshape(new_num_relative_distance - 3, -1)

new_relative_position_bias_table = torch.cat(
Expand Down

0 comments on commit 7755961

Please sign in to comment.