ranjith commited on
Commit
f4dadef
·
2 Parent(s): 1f14b70 2a2f560

updated sd

Browse files
Files changed (2) hide show
  1. app.py +14 -4
  2. rocks-2.pkl +3 -0
app.py CHANGED
@@ -1,7 +1,17 @@
1
  import gradio as gr
 
 
 
2
 
3
- def greet(name):
4
- return "Hello ranjith+es" + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from fastai.vision.all import *
3
+ import skimage
4
+ import re
5
 
 
 
6
 
7
+
8
+ learn = load_learner('export.pkl')
9
+
10
+ labels = learn.dls.vocab
11
+ def predict(img):
12
+ img = PILImage.create(img)
13
+ pred,pred_idx,probs = learn.predict(img)
14
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
15
+
16
+ title = "rock classifier"
17
+ gr.Interface(fn=predict, inputs=gr.Image(), outputs=gr.Label(num_top_classes=7)).launch(share=True)
rocks-2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:116936a74e2c91ce82127bf9a23c947c0f682de1e85f836f4a9d7a60a5e57464
3
+ size 47015954