geodowd commited on
Commit
7fcabcf
·
1 Parent(s): 18be26f

feat: adding model

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