muccy commited on
Commit
fe605c4
1 Parent(s): a0acbc2

Add from dr tanishq abraham article

Browse files
Files changed (2) hide show
  1. README.md +2 -1
  2. app.py +9 -4
README.md CHANGED
@@ -1,5 +1,6 @@
1
  ---
2
- title: Fastai2
 
3
  emoji: 💻
4
  colorFrom: pink
5
  colorTo: purple
 
1
  ---
2
+ title: Spraggy vs Tonkap classifier
3
+ description: This model can identify between the two pro poker players Benjamin 'Spraggy' Spragg and Parker 'tonkap' Talbot
4
  emoji: 💻
5
  colorFrom: pink
6
  colorTo: purple
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
 
 
3
 
4
+ learn = gr.load_learner('export.pkl')
5
+
6
+ labels = learn.dls.vocab
7
+ def predict(img):
8
+ img = gr.PILImage.create(img)
9
+ pred,pred_idx,probs = learn.predict(img)
10
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
11
+
12
+ gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3)).launch(share=True)