-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhubconf.py
More file actions
18 lines (17 loc) · 794 Bytes
/
hubconf.py
File metadata and controls
18 lines (17 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dependencies = ['torch','fastai']
import torch
import os.path
import tempfile
import fastai.learner
# b0_transversal_5_5 is the name of entrypoint
def b0_transversal_5_5(**kwargs):
""" # This docstring shows up in hub.help()
Initial model trained on 138 transversal images via transfer learning on the base model chfc-cmi/cmr-seg-tl : cmr_seg_base with fastai v2
"""
# Call the model, load pretrained weights
url = "https://github.com/chfc-cmi/transversal-cmr-seg/releases/download/0.2.0/b0_transversal_5_5_v2.pth"
dst = torch.hub.get_dir() + '/chfc-cmi_transversal-cmr-seg_master/' + 'b0_transversal_5_5_v2.pth'
if not os.path.isfile(dst):
torch.hub.download_url_to_file(url,dst,progress=True)
model = fastai.learner.load_learner(dst)
return model