teamtom commited on
Commit
b9c4e27
·
1 Parent(s): bab792a
.gitattributes CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
32
+ *.jpg filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+ import pathlib, os
4
+
5
+ # def greet(name):
6
+ # return "Hello " + name + "!!!!"
7
+
8
+ def is_cat(x): return x[0].isupper()
9
+
10
+ categories = ['Dog', 'Cat']
11
+
12
+ def classify_image(img):
13
+
14
+ if os.name == 'nt': # workaround for Windows
15
+ pathlib.PosixPath = pathlib.WindowsPath
16
+
17
+ learn = load_learner('model_cat-or-dog.pkl')
18
+ pred,idx,probs = learn.predict(img)
19
+ return dict(zip(categories, map(float, probs)))
20
+
21
+ image = gr.inputs.Image(shape=(192,192))
22
+ label = gr.outputs.Label()
23
+ examples = ['img_20180720_163054.jpg', 'img_20210614_141029.jpg', 'img_20210614_140945.jpg', 'img_20210613_193627.jpg', 'img_20210613_184022.jpg']
24
+
25
+ iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
26
+ iface.launch()
img_20180720_163054.jpg ADDED

Git LFS Details

  • SHA256: 5b464f4c406868ceb51a7d537f6a84afc65b65d755919db8eb505b3528dafd0d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.06 MB
img_20210613_184022.jpg ADDED

Git LFS Details

  • SHA256: 810f4a04efba726aea8300da8876d35040f2e5153575f5cc5b7a41d5c50d4bde
  • Pointer size: 132 Bytes
  • Size of remote file: 2.15 MB
img_20210613_193627.jpg ADDED

Git LFS Details

  • SHA256: 5684732934a87ede05e9c73a2ddbb427b644f5652930aa4d955d74e9aac347f4
  • Pointer size: 132 Bytes
  • Size of remote file: 4.03 MB
img_20210614_140945.jpg ADDED

Git LFS Details

  • SHA256: b4ef09a38c8b9e5114cfd8c61c9aee802f4a2a716d784e4777904547a8b2bf9b
  • Pointer size: 132 Bytes
  • Size of remote file: 1.59 MB
img_20210614_141029.jpg ADDED

Git LFS Details

  • SHA256: 998b564a38f718bba373cf3cb40771ed0cfb45ccc55562d813fb18e88665354d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.45 MB
model_cat-or-dog.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c67157ee0a0a42cb951bfe9d93f989f628ad2cbbe1038c1a9b29897559083eb
3
+ size 47061419