pkarthik15 commited on
Commit
87da3c4
·
1 Parent(s): 6d818eb

Upload 4 files

Browse files
Files changed (4) hide show
  1. app.py +5 -2
  2. bird.jpg +0 -0
  3. forest.jpg +0 -0
  4. requirements.txt +1 -0
app.py CHANGED
@@ -8,9 +8,12 @@ def greet(name):
8
  return f"Hello {name} !!"
9
 
10
  def predict(img):
11
- img = PILImage.create(img)
12
  pred, pred_idex, probs = model.predict(img)
13
  return {labels[i] : float(probs[i]) for i in range(len(labels))}
14
 
15
- interface = gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=2))
 
 
 
 
16
  interface.launch()
 
8
  return f"Hello {name} !!"
9
 
10
  def predict(img):
 
11
  pred, pred_idex, probs = model.predict(img)
12
  return {labels[i] : float(probs[i]) for i in range(len(labels))}
13
 
14
+ ip = gr.inputs.Image(shape=(512, 512))
15
+ op = gr.outputs.Label(num_top_classes=2)
16
+ example = ['bird.jpg', 'forest.jpg']
17
+
18
+ interface = gr.Interface(fn=predict, inputs=ip, outputs=op, examples=example)
19
  interface.launch()
bird.jpg ADDED
forest.jpg ADDED
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastai