Sotiris commited on
Commit
0aef4bd
·
1 Parent(s): 380967d

Upload everything!

Browse files
Files changed (7) hide show
  1. .gitattributes +1 -0
  2. 1.jpg +3 -0
  3. 2.jpg +3 -0
  4. 3.jpg +3 -0
  5. app.py +32 -0
  6. model.pkl +3 -0
  7. requirements.txt +2 -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
1.jpg ADDED

Git LFS Details

  • SHA256: 31e9a78981bc3176ddbb4e6acd27251791e8c26e29da0ef66c7cc69f5c1d86e8
  • Pointer size: 131 Bytes
  • Size of remote file: 154 kB
2.jpg ADDED

Git LFS Details

  • SHA256: 5709a270ad16d491d5be408b6a74dbd757ae62ea551328efb376a310fbc81181
  • Pointer size: 131 Bytes
  • Size of remote file: 149 kB
3.jpg ADDED

Git LFS Details

  • SHA256: 97fa47dca5742a8c7b9fc7295bb6a965ac2d705bb34282fdea198098da4378c0
  • Pointer size: 132 Bytes
  • Size of remote file: 1.29 MB
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: . (unless otherwise specified).
2
+
3
+ __all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'example', 'intf']
4
+
5
+ # Cell
6
+
7
+ from fastai.vision.all import *
8
+ import gradio as gr
9
+
10
+ # Cell
11
+ learn = load_learner('model.pkl')
12
+
13
+ # Cell
14
+
15
+ categories = learn.dls.vocab
16
+
17
+
18
+ def classify_image(img):
19
+ pred, idx, probs = learn.predict(img)
20
+ return dict(zip(categories, map(float, probs)))
21
+
22
+ # Cell
23
+
24
+ image = gr.components.Image(shape=(224, 224))
25
+ label = gr.components.Label()
26
+ examples = ['1.jpg', '2.jpg', '3.jpg']
27
+
28
+ intf = gr.Interface(fn=classify_image,
29
+ inputs=image,
30
+ outputs=label,
31
+ examples=examples)
32
+ intf.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe8841712867a31c4c917b1685fe85da1e72dcb95c46af25551fdc4336c2bda4
3
+ size 201284453
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastai
2
+ timm