alperenunlu commited on
Commit
78790a7
·
1 Parent(s): af55d99

Init commit

Browse files
Files changed (5) hide show
  1. British_Shorthair_Cat.jpg +0 -0
  2. Ragdoll_Cat.jpg +0 -0
  3. Tabby_Cat.jpg +0 -0
  4. app.py +19 -0
  5. cat.pkl +3 -0
British_Shorthair_Cat.jpg ADDED
Ragdoll_Cat.jpg ADDED
Tabby_Cat.jpg ADDED
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ learn = load_learner("cat.pkl")
5
+
6
+ classes = learn.vocab
7
+ examples = learn.examples
8
+
9
+ def classify_image(img):
10
+ probs = learn.predict(img)[2]
11
+ return dict(zip(classes, map(float, probs)))
12
+
13
+ image = gr.Image()
14
+ label = gr.Label(num_top_classes=5)
15
+
16
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
17
+
18
+ intf.launch()
19
+
cat.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f14d941dc089848de6cba3463aee8d13e3f8609b44dc0f6229ada50e4535f3b
3
+ size 87488743