Harshinder Chadha commited on
Commit
31d3e9d
·
1 Parent(s): a65401b

Added load_learner and title and description for app

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -7,6 +7,9 @@ __all__ = ['categories', 'image', 'label', 'examples', 'intf', 'classify_image']
7
  from fastai.vision.all import *
8
  import gradio as gr
9
 
 
 
 
10
  # %% ../prod.ipynb 5
11
  categories = ('1990s', '2010s')
12
  def classify_image(img):
@@ -16,7 +19,9 @@ def classify_image(img):
16
  # %% ../prod.ipynb 6
17
  image = gr.Image(shape=(192,192))
18
  label = gr.Label()
 
 
19
  examples = ['sample.png', 'sample2.png', 'sample3.png']
20
 
21
- intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
22
  intf.launch(inline=False)
 
7
  from fastai.vision.all import *
8
  import gradio as gr
9
 
10
+
11
+ learner = load_learner('model.pkl')
12
+
13
  # %% ../prod.ipynb 5
14
  categories = ('1990s', '2010s')
15
  def classify_image(img):
 
19
  # %% ../prod.ipynb 6
20
  image = gr.Image(shape=(192,192))
21
  label = gr.Label()
22
+ title = "1990s or 2010s classifier"
23
+ description = "A nba eras classifier trained on images from Bing Image search with fastai."
24
  examples = ['sample.png', 'sample2.png', 'sample3.png']
25
 
26
+ intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples, title=title, description=description)
27
  intf.launch(inline=False)