Spaces:
Runtime error
Runtime error
edthecoder
commited on
Commit
β’
2b19354
1
Parent(s):
1b90f8c
Add meta information
Browse files- .gitattributes +1 -0
- README.md +3 -3
- app.py +17 -6
- wyandotte.jpg +3 -0
.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
|
README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
---
|
2 |
-
title: Chicken
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.1.7
|
|
|
1 |
---
|
2 |
+
title: Chicken Breed Classifier
|
3 |
+
emoji: π
|
4 |
+
colorFrom: red
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.1.7
|
app.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
-
import
|
2 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
learn = load_learner("export.pkl")
|
5 |
labels = learn.dls.vocab
|
@@ -11,10 +19,13 @@ def predict(img):
|
|
11 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
|
13 |
|
14 |
-
iface =
|
15 |
fn=predict,
|
16 |
-
inputs=
|
17 |
-
outputs=
|
|
|
|
|
|
|
18 |
)
|
19 |
|
20 |
-
iface.launch()
|
|
|
1 |
+
from fastai.vision.all import PILImage, load_learner
|
2 |
+
from gradio import Interface
|
3 |
+
from gradio.components import Image, Label
|
4 |
+
|
5 |
+
TITLE = "Chicken Breed Classifier"
|
6 |
+
DESCRIPTION = """A chicken breed classifier trained using the dataset here: https://www.kaggle.com/datasets/abdalnassir/chicken-breeds.\n
|
7 |
+
Due to the limitations of the data, only the following breeds are currently recognised: American Gamefowl, Sapphire Gem, Speckled Sussex, Wyandotte, chick (all chicks recognised as 'Chick').
|
8 |
+
"""
|
9 |
+
EXAMPLES = ["wyandotte.jpg"]
|
10 |
+
|
11 |
|
12 |
learn = load_learner("export.pkl")
|
13 |
labels = learn.dls.vocab
|
|
|
19 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
20 |
|
21 |
|
22 |
+
iface = Interface(
|
23 |
fn=predict,
|
24 |
+
inputs=Image(shape=(512, 512)),
|
25 |
+
outputs=Label(num_top_classes=3),
|
26 |
+
title=TITLE,
|
27 |
+
description=DESCRIPTION,
|
28 |
+
examples=EXAMPLES,
|
29 |
)
|
30 |
|
31 |
+
iface.launch(enable_queue=True)
|
wyandotte.jpg
ADDED
Git LFS Details
|