fierce74 commited on
Commit
aa9e4f1
·
1 Parent(s): 661a51e

Upload 5 files

Browse files
Files changed (5) hide show
  1. app.py +16 -0
  2. elliptical.jpg +0 -0
  3. irregular.jpg +0 -0
  4. model.pkl +3 -0
  5. spiral.jpg +0 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+
4
+
5
+ learn = load_learner('model.pkl')
6
+
7
+ categories = 'elliptical', 'irregular', 'spiral'
8
+ def classify_img(img):
9
+ pred, idx, probs = learn.predict(img)
10
+ return dict(zip(categories, map(float,probs)))
11
+
12
+ image = gr.inputs.Image(shape=(192,192))
13
+ label = gr.outputs.Label()
14
+ examples = ['elliptical.jpg', 'irregular.jpg', 'spiral.jpg']
15
+ iface = gr.Interface(fn = classify_img, inputs = image, outputs = label, examples = examples)
16
+ iface.launch()
elliptical.jpg ADDED
irregular.jpg ADDED
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75f30f2d925d6df8b5527468273f3fa2ee9af4e132247905704ea9445aff0ceb
3
+ size 46961733
spiral.jpg ADDED