Laks Srini commited on
Commit
26ee6ef
1 Parent(s): 8e3ed8d

update app

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,13 +7,13 @@ __all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'is_cat'
7
  from fastai.vision.all import *
8
  import gradio as gr
9
 
10
- def is_cat(x): return x[0].isupper()
11
 
12
  # %% app.ipynb 3
13
  learn = load_learner("model.pkl")
14
 
15
  # %% app.ipynb 5
16
- categories = ("Dog", "Cat")
17
 
18
  def classify_img(img):
19
  pred,idx,probs = learn.predict(img)
@@ -23,7 +23,7 @@ def classify_img(img):
23
  # %% app.ipynb 7
24
  image = gr.inputs.Image(shape=(192, 192))
25
  label = gr.outputs.Label()
26
- examples = ["dog.jpeg", "cat.jpeg", "dunno.jpeg"]
27
 
28
  intf = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
29
  intf.launch(inline=False)
 
7
  from fastai.vision.all import *
8
  import gradio as gr
9
 
10
+ # def is_cat(x): return x[0].isupper()
11
 
12
  # %% app.ipynb 3
13
  learn = load_learner("model.pkl")
14
 
15
  # %% app.ipynb 5
16
+ categories = ("kitchen", "living room")
17
 
18
  def classify_img(img):
19
  pred,idx,probs = learn.predict(img)
 
23
  # %% app.ipynb 7
24
  image = gr.inputs.Image(shape=(192, 192))
25
  label = gr.outputs.Label()
26
+ examples = ["kitchen.jpg", "living_room.jpg", "living_room2.jpg"]
27
 
28
  intf = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
29
  intf.launch(inline=False)