DaniloTertu commited on
Commit
b899583
·
1 Parent(s): bf1160c

Novo modelo

Browse files
Files changed (4) hide show
  1. airplane.jpg +0 -0
  2. app.py +4 -4
  3. helicopter.jpg +0 -0
  4. model.pkl +1 -1
airplane.jpg ADDED
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
2
  from fastai.vision.all import *
3
 
4
- __all__ = ['is_cat', 'learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
5
 
6
- def is_cat(x): return x[0].isupper()
7
 
8
  learn = load_learner('model.pkl')
9
 
10
- categories = ('Bird', 'Forest')
11
 
12
  def classify_image(img):
13
  pred, idx, probs = learn.predict(img)
@@ -15,7 +15,7 @@ def classify_image(img):
15
 
16
  image = gr.inputs.Image(shape=(192,192))
17
  label = gr.outputs.Label()
18
- examples = ['bird.jpg', 'forest.jpg']
19
 
20
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
21
  intf.launch(inline=False)
 
1
  import gradio as gr
2
  from fastai.vision.all import *
3
 
4
+ __all__ = ['is_airplane', 'learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
5
 
6
+ def is_airplane(x): return x[0].isupper()
7
 
8
  learn = load_learner('model.pkl')
9
 
10
+ categories = ('Helicopter', 'Airplane')
11
 
12
  def classify_image(img):
13
  pred, idx, probs = learn.predict(img)
 
15
 
16
  image = gr.inputs.Image(shape=(192,192))
17
  label = gr.outputs.Label()
18
+ examples = ['airplane.jpg', 'helicopter.jpg']
19
 
20
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
21
  intf.launch(inline=False)
helicopter.jpg ADDED
model.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:92e5b2e725d1c0f20993a2faf8c31c990f3885f4bc098be7c4cd65b35c3db310
3
  size 46950545
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ae4d1d50da7398197632361c42e2908c7eebd22ef86be08a45e55bd5df58886
3
  size 46950545