mgogov commited on
Commit
ddd1611
·
1 Parent(s): baf8d98

fix def dependencies

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -1,7 +1,7 @@
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
 
3
  # %% auto 0
4
- __all__ = ['learn', 'categories', 'image', 'label', 'intf', 'classify_image']
5
 
6
  # %% ../app.ipynb 2
7
  from fastai.vision.all import *
@@ -10,10 +10,21 @@ import matplotlib.pyplot as plt
10
  import gradio as gr
11
  from nbdev.export import nb_export
12
 
13
- # %% ../app.ipynb 5
 
 
 
 
 
 
 
 
 
 
 
14
  learn = load_learner('models/02.pkl')
15
 
16
- # %% ../app.ipynb 7
17
  categories = ('tfs', 'xk', 'dbt', 'pbs', 'rwo', 'hth', 'itb')
18
 
19
  def classify_image(img):
@@ -21,7 +32,7 @@ def classify_image(img):
21
 
22
  return dict(zip(sorted(categories), map(float, probs)))
23
 
24
- # %% ../app.ipynb 9
25
  image = gr.Image(height=192, width=192)
26
  label = gr.Label()
27
 
 
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
 
3
  # %% auto 0
4
+ __all__ = ['example_image_paths', 'learn', 'categories', 'image', 'label', 'intf', 'classify_image']
5
 
6
  # %% ../app.ipynb 2
7
  from fastai.vision.all import *
 
10
  import gradio as gr
11
  from nbdev.export import nb_export
12
 
13
+ # %% ../app.ipynb 4
14
+ example_image_paths = [
15
+ 'images/tfh-dogs-alcohol.jpg',
16
+ 'images/dbt-techy-things.jpg',
17
+ 'images/pbs-book-festival.jpg',
18
+ 'images/hth-underwear.jpg',
19
+ 'images/xk-compiling.jpg',
20
+ 'images/rwo-family-reunion.jpg',
21
+ 'images/itb-golf-saucer.jpg'
22
+ ]
23
+
24
+ # %% ../app.ipynb 6
25
  learn = load_learner('models/02.pkl')
26
 
27
+ # %% ../app.ipynb 8
28
  categories = ('tfs', 'xk', 'dbt', 'pbs', 'rwo', 'hth', 'itb')
29
 
30
  def classify_image(img):
 
32
 
33
  return dict(zip(sorted(categories), map(float, probs)))
34
 
35
+ # %% ../app.ipynb 10
36
  image = gr.Image(height=192, width=192)
37
  label = gr.Label()
38