wade001 commited on
Commit
6f67759
1 Parent(s): d138bcb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+ learn = load_learner('model.pkl')
4
+ categories=('active','drowsy')
5
+ def classify(image):
6
+ pred,idx,probs=learn.predict(image)
7
+ return dict(zip(categories,map(float,probs)))
8
+ inter=gr.Interface(fn=classify, inputs='image', outputs='text')
9
+ inter.launch()