Sanjay-M commited on
Commit
42a4f0a
·
unverified ·
1 Parent(s): db4426a
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.jpg filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+
4
+ learn = load_learner('export.pkl')
5
+ labels = learn.dls.vocab
6
+
7
+ def predict(img):
8
+ img = PILImage.create(img)
9
+ preds,preds_idx,probs = learn.predict(img)
10
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
11
+
12
+ title = 'Horse vs Donkey Classifier'
13
+ description = 'A Horse versus Donkey classifier trained on using DuckDuckGo search engine. Created a demo as part of fastai course'
14
+
15
+ examples = [Path('examples')/'donkey.jpg', Path('examples')/'horse.jpg', Path('examples')/'animated_horse.jpg', Path('examples')/'animated_donkey.jpg', Path('examples')/'hybrid.jpg']
16
+
17
+ iface = gr.Interface(fn=predict, inputs=gr.inputs.Image(type='pil', shape=(224, 224)), title=title, description=description, outputs=gr.outputs.Label(num_top_classes=2), examples=examples, enable_queue=True)
18
+ iface.launch()
examples/animated_donkey.jpg ADDED

Git LFS Details

  • SHA256: 6b55bc35ca82776f0da39d5f9ee94342b2f8433126b07585d4aa892a51549384
  • Pointer size: 130 Bytes
  • Size of remote file: 41.7 kB
examples/animated_horse.jpg ADDED

Git LFS Details

  • SHA256: 93b7e80fa3a77374f289efb0a204068422c4ae96fd21d913e34dc43d11500c67
  • Pointer size: 131 Bytes
  • Size of remote file: 155 kB
examples/donkey.jpg ADDED

Git LFS Details

  • SHA256: 725ef637fac146521f4ccffa7e7c14990facf47420bd3cb011505bb34c5e027b
  • Pointer size: 132 Bytes
  • Size of remote file: 4.83 MB
examples/horse.jpg ADDED

Git LFS Details

  • SHA256: cd0239cd180f48c4a122eb7f96fdf1c2dfc55ae163849ae64ef987617681f496
  • Pointer size: 130 Bytes
  • Size of remote file: 53.1 kB
examples/hybrid.jpg ADDED

Git LFS Details

  • SHA256: 595e97e928730ac192ae83e2a03fc0120e090b4e1d5357b6f4ebf8dd2cfb04f1
  • Pointer size: 130 Bytes
  • Size of remote file: 52.2 kB
export.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8a465536322958668b64368dbea1af06f89a1ad671fe31ce2c5daa83e9753d3
3
+ size 102891209