satish860 commited on
Commit
14a241f
·
1 Parent(s): a730f1f

Initial checkin with example

Browse files
Files changed (8) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +0 -0
  2. Arborio.jpg +0 -0
  3. Basmati.jpg +0 -0
  4. Ipsala.jpg +0 -0
  5. Jasmine.jpg +0 -0
  6. Karacadag.jpg +0 -0
  7. app.py +18 -0
  8. model.pkl +3 -0
.ipynb_checkpoints/app-checkpoint.py ADDED
File without changes
Arborio.jpg ADDED
Basmati.jpg ADDED
Ipsala.jpg ADDED
Jasmine.jpg ADDED
Karacadag.jpg ADDED
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ learner = load_learner('model.pkl')
5
+ categories = learn.dls.vocab
6
+
7
+ def predict(img):
8
+ preds,idx,probs = learner.predict(img)
9
+ return dict(zip(categories,map(float,probs)))
10
+
11
+ examples = ['Arborio.jpg','Basmati.jpg','Ipsala.jpg','Jasmine.jpg']
12
+
13
+
14
+ demo = gr.Interface(fn=predict,
15
+ inputs=gr.inputs.Image(shape=(224, 224)),
16
+ outputs= gr.outputs.Label()
17
+ )
18
+ demo.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5f79ee9d7c7a82a1bf2d05f9c885ebcd2991f8a5348902fff91cd958639e142
3
+ size 48213547