phoughton's picture
fix georgian file name
5b556cb
raw
history blame contribute delete
570 Bytes
from fastai.vision.all import *
import gradio as gr
def classify(the_image):
prediction, index, probs = learn.predict(the_image)
probs_floats = map(float, probs)
cat_probs = zip(categories, probs_floats)
return dict(cat_probs)
learn = load_learner('architecture_model.pkl')
categories = learn.dls.vocab
image = gr.Image(type='pil')
label = gr.Label()
examples = ['tudor_cottage.jpg', 'georgian_terrace.jpg']
intf = gr.Interface(fn=classify, inputs=image, outputs=label, examples=examples, title="Architecture Classifier")
intf.launch(inline=False)