Surya commited on
Commit
710f84a
·
unverified ·
1 Parent(s): eab3f06

remove file paths

Browse files
Files changed (2) hide show
  1. app.py +27 -3
  2. forest.jpeg +3 -0
app.py CHANGED
@@ -1,3 +1,27 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d838ccf445ebe6980a92538c6785e0ece690dbdedccdbd858786ac3ec123a433
3
- size 829
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: . (unless otherwise specified).
2
+
3
+ __all__ = ['is_bird', 'learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
4
+
5
+ # Cell
6
+ from fastai.vision.all import *
7
+ import gradio as gr
8
+
9
+ def is_bird(x): return x[0].isupper()
10
+
11
+ # Cell
12
+ learn = load_learner('bt_model.pkl')
13
+
14
+ # Cell
15
+ categories = ('animal','bird','forest')
16
+
17
+ def classify_image(img):
18
+ pred,idx,probs = learn.predict(img)
19
+ return dict(zip(categories, map(float,probs)))
20
+
21
+ # Cell
22
+ image = gr.Image(shape=(192, 192))
23
+ label = gr.Label()
24
+ examples = ['bird.jpeg', 'forest.jpeg', 'dunno.jpeg']
25
+
26
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
27
+ intf.launch(inline=False)
forest.jpeg ADDED

Git LFS Details

  • SHA256: f4ccf0435bc170fc5f6ca2b8bde8928040633f51e64d31b57464abfe692bc63a
  • Pointer size: 129 Bytes
  • Size of remote file: 7.87 kB