skcoirz commited on
Commit
19529d0
Β·
1 Parent(s): 1156a91

add examples

Browse files
Files changed (4) hide show
  1. .DS_Store +0 -0
  2. app.py +3 -1
  3. cat.jpg +0 -0
  4. dog.jpg +0 -0
.DS_Store ADDED
Binary file (6.15 kB). View file
 
app.py CHANGED
@@ -1,6 +1,7 @@
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
 
4
  def is_cat(x): return x[0].isupper()
5
  learner = load_learner('model.pkl')
6
  categories = ("Dog", "Cat")
@@ -11,6 +12,7 @@ def infer(img):
11
 
12
  image = gr.inputs.Image(shape = (192, 192))
13
  label = gr.outputs.Label()
 
14
 
15
- iface = gr.Interface(fn=infer, inputs=image, outputs=label)
16
  iface.launch()
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
4
+ # why do we need this?
5
  def is_cat(x): return x[0].isupper()
6
  learner = load_learner('model.pkl')
7
  categories = ("Dog", "Cat")
 
12
 
13
  image = gr.inputs.Image(shape = (192, 192))
14
  label = gr.outputs.Label()
15
+ examples = ['cat.jpg', 'dog.jpg']
16
 
17
+ iface = gr.Interface(fn=infer, inputs=image, outputs=label, examples=examples)
18
  iface.launch()
cat.jpg ADDED
dog.jpg ADDED