fmussari commited on
Commit
6c48b37
1 Parent(s): 9511e7a
Files changed (4) hide show
  1. DSC01955.jpg +0 -0
  2. DSC01956.jpg +0 -0
  3. app.py +32 -0
  4. tower_parts_app.ipynb +0 -0
DSC01955.jpg ADDED
DSC01956.jpg ADDED
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: . (unless otherwise specified).
2
+
3
+ __all__ = ['learn', 'classify_image', 'categories', 'title', 'description', 'image', 'label', 'examples', 'intf']
4
+
5
+ # Cell
6
+ from fastai.vision.all import *
7
+
8
+ import gradio as gr
9
+
10
+
11
+ # Cell
12
+ learn = load_learner('tower_parts_model.pkl')
13
+
14
+ # Cell
15
+ categories = learn.dls.vocab
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
+ title = "Tower Parts Classifier"
23
+ description = "This deep learning model was trained with 478 images of telecommunication towers."
24
+
25
+ # Cell
26
+ image = gr.inputs.Image(shape=(192, 192))
27
+ label = gr.outputs.Label()
28
+ examples = ['DSC01955.jpg', 'DSC01956.jpg']
29
+
30
+ # Cell
31
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
32
+ intf.launch(inline=False)
tower_parts_app.ipynb ADDED
The diff for this file is too large to render. See raw diff