wade / app.py
wade001's picture
Update app.py
492c6e8
raw
history blame contribute delete
No virus
357 Bytes
import gradio as gr
import fastai as fastai
from fastcore.all import *
from fastai.vision.all import *
learn = load_learner('model.pkl')
categories=('active','drowsy')
def classify(image):
pred,idx,probs=learn.predict(image)
return dict(zip(categories,map(float,probs)))
inter=gr.Interface(fn=classify, inputs='image', outputs='text')
inter.launch()