teamtom commited on
Commit
a3e0e46
1 Parent(s): 4b99107
.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
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+ import pathlib, os
4
+
5
+ categories = ['daisy', 'dandelion', 'rose', 'sunflower', 'tulip']
6
+
7
+ def classify_image(img):
8
+
9
+ learn = load_learner('flowers.pkl')
10
+ pred,idx,probs = learn.predict(img)
11
+ return dict(zip(categories, map(float, probs)))
12
+
13
+ image = gr.inputs.Image(shape=(192,192))
14
+ label = gr.outputs.Label()
15
+ examples = [
16
+ 'dandelion+seeds.jpg',
17
+ 'common-dandelion-seeds-medical-herb-taraxacum-officinale.jpg',
18
+ 'dandelion-seedhead.jpg',
19
+ 'how-to-draw-sunflower.jpg',
20
+ 'sunflower.jpg',
21
+ 'sunflower1.jpg',
22
+ 'tulip-drawing.jpg',
23
+ 'broken-tulip-flower.jpg',
24
+ 'rose01.jpg',
25
+ 'rose02-blue.jpg'
26
+ ]
27
+
28
+ iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
29
+ iface.launch()
broken-tulip-flower.jpg ADDED

Git LFS Details

  • SHA256: 3ed80a5f8ceba3fa9a6d437cc55c45438b36c3605b3618298fa223b60d054ae7
  • Pointer size: 131 Bytes
  • Size of remote file: 167 kB
common-dandelion-seeds-medical-herb-taraxacum-officinale.jpg ADDED

Git LFS Details

  • SHA256: c83acd1c40915b7cc2ee41def7c7eaa1b0dea450cbe0affa77d329fbcc34f83c
  • Pointer size: 130 Bytes
  • Size of remote file: 75.4 kB
dandelion+seeds.jpg ADDED

Git LFS Details

  • SHA256: a2a992ef064c03a8a58d3b2da0a1ebec8f366bcebd4f8d7cc10848bd54ffbe42
  • Pointer size: 131 Bytes
  • Size of remote file: 104 kB
dandelion-seedhead.jpg ADDED

Git LFS Details

  • SHA256: 28228120928f1028b9ea0dec8aa91ae192cd31f5e6528549a59f4b031e8150bc
  • Pointer size: 131 Bytes
  • Size of remote file: 138 kB
flowers.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34aafbe01f8c1952c0f5a29b71f464a2d1925a511424e282347bb15bb1ca752e
3
+ size 47014507
how-to-draw-sunflower.jpg ADDED

Git LFS Details

  • SHA256: 337879ef0f7f5c92d05c0294777c30a375c2730b389d4167ea01e7a3522455b4
  • Pointer size: 131 Bytes
  • Size of remote file: 146 kB
rose01.jpg ADDED

Git LFS Details

  • SHA256: 0438d0a65d14d85f7375f097837008a8eafe09afb75e52384c9b818212b74ec8
  • Pointer size: 130 Bytes
  • Size of remote file: 22.9 kB
rose02-blue.jpg ADDED

Git LFS Details

  • SHA256: a5b74f88bd3f25ce423ed679a857db42e961c6699a81a9967246e72ab0dc2fb0
  • Pointer size: 130 Bytes
  • Size of remote file: 43.6 kB
sunflower.jpg ADDED

Git LFS Details

  • SHA256: 693042010c6d2ed54b5a72672f99a9062f725acdb3e919168fc86ef311227686
  • Pointer size: 130 Bytes
  • Size of remote file: 48.5 kB
sunflower1.jpg ADDED

Git LFS Details

  • SHA256: 5d9535ff63559e0a794445e527edc4bea87bbef902be6ace683fb306787fb65a
  • Pointer size: 130 Bytes
  • Size of remote file: 52.1 kB
tulip-drawing.jpg ADDED

Git LFS Details

  • SHA256: d7d4ad068449e4f8dd0a8e0561f557989252d1a58c95dbf5849c459dee14c27b
  • Pointer size: 129 Bytes
  • Size of remote file: 4.27 kB