eclfe commited on
Commit
a396f75
·
verified ·
1 Parent(s): be3f70e

Upload 2 files

Browse files
Files changed (2) hide show
  1. app2.py +11 -0
  2. model.pkl +3 -0
app2.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import*
3
+
4
+ learn = load_learner('model.pkl')
5
+ labels = learn.dls.vocab
6
+ def predict(img):
7
+ img = PILImage.create(img)
8
+ pred,pred_idx,probs = learn.predict(img)
9
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
10
+ gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3)).launch(share=True)
11
+
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e621fb1625231c9f4b3321dcb67c09bbcf39b88f3b533524458d59abe03db79a
3
+ size 47064894