Skip to content

Commit 0d579dd

Browse files
committed
Zoedepth compatibility fixes
1 parent cdbc642 commit 0d579dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dzoedepth/models/base_models/midas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def get_size(self, width, height):
170170

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

175175
class PrepForMidas(object):
176176
def __init__(self, resize_mode="minimal", keep_aspect_ratio=True, img_size=384, do_resize=True):

dzoedepth/models/model_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def load_state_dict(model, state_dict):
4646

4747
state[k] = v
4848

49-
model.load_state_dict(state)
49+
model.load_state_dict(state, strict=False)
5050
print("Loaded successfully")
5151
return model
5252

0 commit comments

Comments
 (0)