Vangmay Sachan
Upload interface
252400c
raw
history blame
493 Bytes
from fastai.vision.all import *
import gradio as gr
def classify_image(img):
prediction,idx,probs = learn.predict(img)
return prediction
learn = load_learner("model.pkl")
image = gr.inputs.Image(shape=(192,192))
label = gr.outputs.Label()
examples = ["./testImages/Jim.jpg", "./testImages/Pam.jpg", "./testImages/Ryan.jpg", "./testImages/Scott.jpg", "./testImages/Stanley.jpg"]
intf = gr.Interface(fn = classify_image, inputs=image, outputs=label, examples=examples)
intf.launch()