Spaces:
Sleeping
Sleeping
Sanjay-M
commited on
init
Browse files- .gitattributes +1 -0
- app.py +18 -0
- examples/animated_donkey.jpg +3 -0
- examples/animated_horse.jpg +3 -0
- examples/donkey.jpg +3 -0
- examples/horse.jpg +3 -0
- examples/hybrid.jpg +3 -0
- export.pkl +3 -0
.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
|
examples/animated_horse.jpg
ADDED
|
Git LFS Details
|
examples/donkey.jpg
ADDED
|
Git LFS Details
|
examples/horse.jpg
ADDED
|
Git LFS Details
|
examples/hybrid.jpg
ADDED
|
Git LFS Details
|
export.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8a465536322958668b64368dbea1af06f89a1ad671fe31ce2c5daa83e9753d3
|
| 3 |
+
size 102891209
|