Skip to content

Commit 1edac34

Browse files
committed
Adding hubconf.py
1 parent ad9c260 commit 1edac34

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

hubconf.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dependencies = ['torch']
2+
3+
from models.midas_est import MidasNet
4+
5+
def MiDaS(pretrained=True, **kwargs):
6+
""" # This docstring shows up in hub.help()
7+
MiDaS model for monocular depth estimation
8+
pretrained (bool): load pretrained weights into model
9+
"""
10+
11+
model = MidasNet()
12+
13+
if pretrained:
14+
checkpoint = "https://drive.google.com/file/d/1nqW_Hwj86kslfsXR7EnXpEWdO2csz1cC"
15+
state_dict = torch.hub.load_state_dict_from_url(checkpoint, progress=True)
16+
model.load_state_dict(state_dict)
17+
18+
return model

0 commit comments

Comments
 (0)