Mohammed Albrayh
edit py file
4963a25
raw
history blame
490 Bytes
import gradio as gr
import pickle
from fastai.vision.all import *
learn = load_learner('model.pkl')
def predict(input):
image = PILImage.create(input).resize((182, 268))
# Use your model to make predictions on the input data
results = learn.predict(image)[0]
results = ', '.join(results)
return results
demo = gr.Interface(fn=predict, inputs="image",examples=['examples/Gun.jpg','examples/mario movie.jpg','examples/lalaLand.jpg'] ,outputs="text")
demo.launch()