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'] intf = gr.Interface(fn = classify_images, inputs = image, outputs=label, examples=examples) intf.launch(inline=False)