raahimsal commited on
Commit
6b3bad6
1 Parent(s): cdf1691
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,17 +2,17 @@ import gradio as gr
2
  from fastai.vision.widgets import *
3
  from fastbook import *
4
 
5
- learn = load_learner(r"fastbook/export.pkl")
6
 
7
- categories = ('Grizzly','Black','Teddy')
8
 
9
  def classify_images(img):
10
  pred,idx,probs = learn.predict(img)
11
  return dict(zip(categories, map(float, probs)))
12
 
13
- image = gr.inputs.Image(shape=(192,192))
14
- label = gr.outputs.Label()
15
- examples = ['fastbook/bears/black/0d147856-6c48-449c-80a1-8ea58587d207.jpg']
16
 
17
 
18
  def greet(name):
 
2
  from fastai.vision.widgets import *
3
  from fastbook import *
4
 
5
+ learn = load_learner("/Users/rs/dl-prep/fastbook/export.pkl")
6
 
7
+ categories = ('Black','Grizzly','Teddy')
8
 
9
  def classify_images(img):
10
  pred,idx,probs = learn.predict(img)
11
  return dict(zip(categories, map(float, probs)))
12
 
13
+ image = gr.Image(height=192,width=192)
14
+ label = gr.Label()
15
+ examples = ['/Users/rs/dl-prep/fastbook/bears/black/0b439e6e-4808-4e98-aa07-9090d3fc2237.jpg', "/Users/rs/dl-prep/fastbook/bears/black/0d147856-6c48-449c-80a1-8ea58587d207.jpg","/Users/rs/dl-prep/fastbook/bears/teddy/0e6b5384-bff6-4ee2-a7bf-77c9c566a4dc.jpg"]
16
 
17
 
18
  def greet(name):