File size: 497 Bytes
4a4cd49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import urllib.request
from pathlib import Path
import os
from fastai.vision import load_learner

def download_model(url: str, filename: str):
    urllib.request.urlretrieve(url, filename)

def load_model(model_path: str):
    path = Path(".")
    learn = load_learner(path, model_path)
    return learn

if __name__ == "__main__":
    MODEL_URL = "https://www.dropbox.com/s/04suaimdpru76h3/ArtLine_920.pkl?dl=1"
    MODEL_FILENAME = "ArtLine_920.pkl"
    download_model(MODEL_URL, MODEL_FILENAME)