Gowtham M
Uploading Images
8f62f6a
raw
history blame
471 Bytes
from fastai.vision.all import *
import gradio as gr
learn = load_learner('export.pkl')
actors = learn.dls.vocab
def classify_images(img):
pred, idx, prob = learn.predict(img)
return dict(zip(actors, map(float, prob)))
image = gr.Image(height=192, width= 192)
label = gr.Label()
examples = ['rajini.jpg', 'vijay.jpg', 'raka.jpeg', 'ajith.jpeg']
intf = gr.Interface(fn = classify_images, inputs = image, outputs=label, examples=examples)
intf.launch(inline=False)