akaigraham commited on
Commit
edc75fa
·
1 Parent(s): b7e9d79

add requirements.txt

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -9,10 +9,12 @@ def is_cat(x): return x[0].isupper()
9
  learn = from_pretrained_fastai('akaigraham/cat-classifier')
10
  categories = ('Dog', 'Cat')
11
 
 
12
  def classify_image(img):
13
  pred,idx,probs = learn.predict(img)
14
  return dict(zip(categories, map(float, probs)))
15
 
 
16
  image = gr.inputs.Image(shape=(192,192))
17
  label = gr.outputs.Label()
18
  examples = ['dog.jpg', 'cat.jpg']
 
9
  learn = from_pretrained_fastai('akaigraham/cat-classifier')
10
  categories = ('Dog', 'Cat')
11
 
12
+ # classify image function
13
  def classify_image(img):
14
  pred,idx,probs = learn.predict(img)
15
  return dict(zip(categories, map(float, probs)))
16
 
17
+ ## set up gradio
18
  image = gr.inputs.Image(shape=(192,192))
19
  label = gr.outputs.Label()
20
  examples = ['dog.jpg', 'cat.jpg']