Anish13 commited on
Commit
9fa735c
1 Parent(s): 6c0378c
Files changed (6) hide show
  1. app.py +2 -2
  2. dragon.jpeg +0 -0
  3. green.jpeg +0 -0
  4. lemon.webp +0 -0
  5. orange.jpeg +0 -0
  6. yellow.jpeg +0 -0
app.py CHANGED
@@ -2,14 +2,14 @@ import gradio as gr
2
  from fastai.vision.all import *
3
 
4
  learn = load_learner('export.pkl')
5
- categories = ('Lemon', 'Orange','dragon fruit', 'yellow apple', 'red apple', 'green apple')
6
  def classify_image(img):
7
  pred, idx, probs = learn.predict(img)
8
  return dict(zip(categories, map(float, probs)))
9
 
10
  image = gr.inputs.Image(shape = (256, 256))
11
  label = gr.outputs.Label()
12
- examples = ['apple.jpeg']
13
 
14
  intf = gr.Interface(fn = classify_image, inputs=image, outputs=label, examples=examples)
15
  intf.launch()
 
2
  from fastai.vision.all import *
3
 
4
  learn = load_learner('export.pkl')
5
+ categories = ('Lemon', 'Orange','dragon fruit', 'green apple', 'red apple', 'yellow apple')
6
  def classify_image(img):
7
  pred, idx, probs = learn.predict(img)
8
  return dict(zip(categories, map(float, probs)))
9
 
10
  image = gr.inputs.Image(shape = (256, 256))
11
  label = gr.outputs.Label()
12
+ examples = ['apple.jpeg', 'dragon.jpeg', 'orange.jpeg', 'lemon.webp', 'green.jpeg', 'yellow.jpeg']
13
 
14
  intf = gr.Interface(fn = classify_image, inputs=image, outputs=label, examples=examples)
15
  intf.launch()
dragon.jpeg ADDED
green.jpeg ADDED
lemon.webp ADDED
orange.jpeg ADDED
yellow.jpeg ADDED