chrwittm commited on
Commit
42f9018
1 Parent(s): 4856cf7

updated gradio image initialization

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -3,20 +3,20 @@
3
  # %% auto 0
4
  __all__ = ['learn', 'image', 'label', 'examples', 'intf', 'classify_image']
5
 
6
- # %% ../app.ipynb 2
7
  from fastai.vision.all import *
8
  import gradio as gr
9
 
10
- # %% ../app.ipynb 6
11
  learn = load_learner('export.pkl')
12
 
13
- # %% ../app.ipynb 12
14
  def classify_image(img):
15
  pred,pred_idx,probs = learn.predict(img)
16
  return dict(zip(learn.dls.vocab, map(float, probs)))
17
 
18
- # %% ../app.ipynb 17
19
- image = gr.components.Image(shape=(192,192))
20
  label = gr.components.Label()
21
  examples = ['cat.jpg', 'dog.jpg']
22
 
 
3
  # %% auto 0
4
  __all__ = ['learn', 'image', 'label', 'examples', 'intf', 'classify_image']
5
 
6
+ # %% ../app.ipynb 3
7
  from fastai.vision.all import *
8
  import gradio as gr
9
 
10
+ # %% ../app.ipynb 7
11
  learn = load_learner('export.pkl')
12
 
13
+ # %% ../app.ipynb 13
14
  def classify_image(img):
15
  pred,pred_idx,probs = learn.predict(img)
16
  return dict(zip(learn.dls.vocab, map(float, probs)))
17
 
18
+ # %% ../app.ipynb 18
19
+ image = gr.components.Image(height=192, width=192)
20
  label = gr.components.Label()
21
  examples = ['cat.jpg', 'dog.jpg']
22