Paperbag commited on
Commit
b5d9c3b
·
1 Parent(s): e9409e1
Files changed (2) hide show
  1. app.py +2 -3
  2. requirements.txt +1 -1
app.py CHANGED
@@ -4,17 +4,16 @@ import gradio as gr
4
  # def greet(name):
5
  # return "Hello " + name + "!!"
6
 
7
- def is_cat(x): return x[0].isupper()
8
-
9
  learn = load_learner('model.pkl')
10
 
11
  def classify_image(img):
12
  pred, idx, probs = learn.predict(img)
13
  return dict(zip(learn.dls.vocab, map(float, probs)))
14
 
15
- image = gr.inputs.Image(shape=(192, 192))
16
  label = gr.outputs.Label()
17
  examples = ['dog.jpg', 'cat.jpg','dunno.jpg']
18
 
 
19
  demo = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
20
  demo.launch()
 
4
  # def greet(name):
5
  # return "Hello " + name + "!!"
6
 
 
 
7
  learn = load_learner('model.pkl')
8
 
9
  def classify_image(img):
10
  pred, idx, probs = learn.predict(img)
11
  return dict(zip(learn.dls.vocab, map(float, probs)))
12
 
13
+ image = gr.Image(shape=(192, 192))
14
  label = gr.outputs.Label()
15
  examples = ['dog.jpg', 'cat.jpg','dunno.jpg']
16
 
17
+
18
  demo = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
19
  demo.launch()
requirements.txt CHANGED
@@ -6,4 +6,4 @@ nbdev>=0.2.12
6
  pandas
7
  scikit_learn
8
  azure-cognitiveservices-search-imagesearch
9
- sentencepiece
 
6
  pandas
7
  scikit_learn
8
  azure-cognitiveservices-search-imagesearch
9
+ sentencepiece