File size: 523 Bytes
808bac7
48e0717
808bac7
 
 
 
48e0717
808bac7
 
 
 
 
 
 
 
 
 
48e0717
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from fastai.vision.all import *

#Windows fix
import pathlib
temp = pathlib.PosixPath
pathlib.PosixPath = pathlib.WindowsPath

    
learn = load_learner('SaudiLandmarkClassifier.pkl') 

def predict(input):
    # image = gr.Image(height=224,type="pil",image_obj=input)
    image = PILImage.create(input).resize((224,224))
    results = learn.predict(image)[0]
    return results

iface = gr.Interface(fn=predict, inputs="image", outputs="text", examples=['Examples\A.png', 'Examples\B.png', 'Examples\C.png'])
iface.launch()