DietToms commited on
Commit
af99ed2
1 Parent(s): be77a75

app and model

Browse files
Files changed (2) hide show
  1. Rotifer_Classifier.pkl +3 -0
  2. app.py +25 -7
Rotifer_Classifier.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e4b937ff13c1ed34a79ac9585993e12b7c31d62f605bccd18a85ac3f59e6474
3
+ size 114631857
app.py CHANGED
@@ -1,7 +1,25 @@
1
- import gradio as gr
2
-
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
-
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: ../app.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['learn', 'categories', 'image', 'label', 'intf', 'classify_image']
5
+
6
+ # %% ../app.ipynb 1
7
+ from fastai.vision.all import *
8
+ import gradio as gr
9
+
10
+ # %% ../app.ipynb 3
11
+ learn = load_learner("Rotifer_Classifier.pkl")
12
+
13
+ # %% ../app.ipynb 5
14
+ categories = ("Bdelloid Rotifer", "Monogonont Rotifer")
15
+
16
+ def classify_image(img):
17
+ pred, idx, probs = learn.predict(img)
18
+ return dict(zip(categories, map(float,probs)))
19
+
20
+ # %% ../app.ipynb 7
21
+ image = gr.inputs.Image(shape=(192,192))
22
+ label = gr.outputs.Label()
23
+
24
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
25
+ intf.launch(inline=False)