Keith Preston commited on
Commit
bbe2416
·
1 Parent(s): 264a8c7

Set Gradio version to 3.33.1

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +7 -6
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 😻
4
  colorFrom: blue
5
  colorTo: green
6
  sdk: gradio
7
- sdk_version: 3.34.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
4
  colorFrom: blue
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 3.33.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -1,5 +1,4 @@
1
  from fastai.vision.all import *
2
- import timm
3
  import gradio as gr
4
 
5
  learn = load_learner('model.pkl')
@@ -10,10 +9,12 @@ def classify_image(img):
10
  ds = sorted(d.items(), key=lambda item: item[1], reverse=True)
11
  return dict(ds[0:5])
12
 
13
- image = gr.inputs.Image(shape=(244, 244))
14
- label = gr.outputs.Label()
 
15
  examples = ['dog1.jpg', 'dog2.jpg', 'dog3.jpg']
16
 
17
- #intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
18
- intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
19
- intf.launch(inline=False)
 
 
1
  from fastai.vision.all import *
 
2
  import gradio as gr
3
 
4
  learn = load_learner('model.pkl')
 
9
  ds = sorted(d.items(), key=lambda item: item[1], reverse=True)
10
  return dict(ds[0:5])
11
 
12
+ #image = gr.Image(shape=(244, 244))
13
+ image = gr.Image()
14
+ label = gr.Label()
15
  examples = ['dog1.jpg', 'dog2.jpg', 'dog3.jpg']
16
 
17
+ #demo = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
18
+ demo = gr.Interface(fn=classify_image, inputs=image, outputs=label, analytics_enabled=False)
19
+ demo.launch(inline=False)
20
+