File size: 538 Bytes
b59e813
 
 
 
 
 
 
 
 
 
 
 
 
07e3301
 
b59e813
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from huggingface_hub import hf_hub_download
from fastai.vision.all import *
from fastai.learner import load_learner
import os
import os.path as op
import pickle


HOME_DIR = os.getcwd()
DATA_DIR =  op.join(HOME_DIR, 'data')
MODELS_DIR = op.join(HOME_DIR,'models')


def load_model():   
    learn = load_learner(op.join(MODELS_DIR, "vit_tiny_patch16_224_2.pkl"))
    return learn

# learn = load_learner(op.join(MODELS_DIR, "vit_tiny_patch16_224_2.pkl"))
def load_image(image_name):
    img = op.join(DATA_DIR, image_name)
    return img