Skip to content

Commit

Permalink
Adding hubconf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ranftlr committed Jun 5, 2020
1 parent ad9c260 commit 1edac34
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hubconf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dependencies = ['torch']

from models.midas_est import MidasNet

def MiDaS(pretrained=True, **kwargs):
""" # This docstring shows up in hub.help()
MiDaS model for monocular depth estimation
pretrained (bool): load pretrained weights into model
"""

model = MidasNet()

if pretrained:
checkpoint = "https://drive.google.com/file/d/1nqW_Hwj86kslfsXR7EnXpEWdO2csz1cC"
state_dict = torch.hub.load_state_dict_from_url(checkpoint, progress=True)
model.load_state_dict(state_dict)

return model

0 comments on commit 1edac34

Please sign in to comment.