edthecoder commited on
Commit
2b19354
β€’
1 Parent(s): 1b90f8c

Add meta information

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +3 -3
  3. app.py +17 -6
  4. 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 Breeds
3
- emoji: πŸ’©
4
- colorFrom: yellow
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 gradio as gr
2
- from fastai.vision.all import *
 
 
 
 
 
 
 
 
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 = gr.Interface(
15
  fn=predict,
16
- inputs=gr.inputs.Image(shape=(512, 512)),
17
- outputs=gr.outputs.Label(num_top_classes=3),
 
 
 
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

  • SHA256: 837fc9ca2a43da931fe42961485514c9384a800a34ee232c8ea7d80c24929dd2
  • Pointer size: 132 Bytes
  • Size of remote file: 1.56 MB