Spaces:
Sleeping
Sleeping
deploy
Browse files- .gitattributes +1 -0
- app.py +29 -0
- broken-tulip-flower.jpg +3 -0
- common-dandelion-seeds-medical-herb-taraxacum-officinale.jpg +3 -0
- dandelion+seeds.jpg +3 -0
- dandelion-seedhead.jpg +3 -0
- flowers.pkl +3 -0
- how-to-draw-sunflower.jpg +3 -0
- rose01.jpg +3 -0
- rose02-blue.jpg +3 -0
- sunflower.jpg +3 -0
- sunflower1.jpg +3 -0
- tulip-drawing.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
|
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
|
common-dandelion-seeds-medical-herb-taraxacum-officinale.jpg
ADDED
Git LFS Details
|
dandelion+seeds.jpg
ADDED
Git LFS Details
|
dandelion-seedhead.jpg
ADDED
Git LFS Details
|
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
|
rose01.jpg
ADDED
Git LFS Details
|
rose02-blue.jpg
ADDED
Git LFS Details
|
sunflower.jpg
ADDED
Git LFS Details
|
sunflower1.jpg
ADDED
Git LFS Details
|
tulip-drawing.jpg
ADDED
Git LFS Details
|