Skip to content

Commit

Permalink
fix int
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbds committed Nov 1, 2023
1 parent c6e49fa commit 620ca71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion annotator/zoe/zoedepth/models/base_models/midas.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,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
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 620ca71

Please sign in to comment.