FergusArgyll commited on
Commit
0a23c34
1 Parent(s): 8b0baae
Files changed (3) hide show
  1. app.py +17 -0
  2. model.pkl +3 -0
  3. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+
5
+ learn = load_learner("model.pkl")
6
+ categories = ["Osprey", "Bald Eagle"]
7
+
8
+ def classify(img):
9
+ pred,idx,probs = learn.predict(img)
10
+ return dict(zip(categories, map(float,probs)))
11
+
12
+
13
+ image = gr.inputs.Image(shape=(192, 192))
14
+ label = gr.outputs.Label()
15
+
16
+ iface = gr.Interface(fn=classify, inputs=image, outputs=label)
17
+ iface.launch()
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f3f94ee9d8172934f2e8336f9425d3bc7e1653a2ee3eb36263af0bf89be8f79
3
+ size 46963718
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastai
2
+ scikit_learn