Upload 7 files
Browse files- .gitattributes +2 -0
- README.md +3 -3
- app.py +19 -0
- david_trinks_unsplash.jpg +0 -0
- edgar_castrejon_unsplash.jpg +3 -0
- example.jpg +3 -0
- model.pkl +3 -0
- requirements.txt +2 -0
.gitattributes
CHANGED
@@ -32,3 +32,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
edgar_castrejon_unsplash.jpg filter=lfs diff=lfs merge=lfs -text
|
36 |
+
example.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
title: Gourds
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.15.0
|
8 |
app_file: app.py
|
|
|
1 |
---
|
2 |
title: Gourds
|
3 |
+
emoji: 👁
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.15.0
|
8 |
app_file: app.py
|
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
import skimage
|
4 |
+
|
5 |
+
learn = load_learner('model.pkl')
|
6 |
+
|
7 |
+
labels = learn.dls.vocab
|
8 |
+
def predict(img):
|
9 |
+
img = PILImage.create(img)
|
10 |
+
pred,pred_idx,probs = learn.predict(img)
|
11 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
+
|
13 |
+
title = "Pet Breed Classifier"
|
14 |
+
description = "A winter squash classifer created by Candace Williams in fastai"
|
15 |
+
examples = ['david_trinks_unsplash.jpg', 'edgar_castrejon_unsplash.jpg', 'example.jpg' ]
|
16 |
+
interpretation='default'
|
17 |
+
enable_queue=True
|
18 |
+
|
19 |
+
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()
|
david_trinks_unsplash.jpg
ADDED
![]() |
edgar_castrejon_unsplash.jpg
ADDED
![]() |
Git LFS Details
|
example.jpg
ADDED
![]() |
Git LFS Details
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b0907ecd5c479f4c646d8ec8cb357d70c46bb32c801800598d641d92e7c4221f
|
3 |
+
size 47026283
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
scikit-image
|