AIorNOT / app.py
Prateek Sharma
App.py
c8f6f0c
Raw
History Blame Contribute Delete
365 Bytes
from fastai.vision.all import *
import gradio as gr
learn = load_learner('aiornot_model.pkl')
categories = ("AI", "Natural")
def classify_image(img):
pred,idx,probs = learn.predict(img)
return dict(zip(categories, map(float,probs)))
image = gr.Image()
label = gr.Label()
gr.Interface(fn=classify_image, inputs=image, outputs=label).launch(share=True)