PaulMest commited on
Commit
f276542
1 Parent(s): 18f1f64

Tracking examples as binary files via git lfs

Browse files
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ examples/*.* filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -1,29 +1,12 @@
1
- # import gradio as gr
2
- #
3
- # def greet(name):
4
- # return "Hello " + name + "!!"
5
- #
6
- # iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- # iface.launch()
8
-
9
- # Cell
10
  from fastai.vision.all import *
11
  import gradio as gr
12
  import timm
13
  import dill
 
14
 
15
-
16
- def is_catan(x):
17
- # print(x[:5])
18
- # print(x[:5] == 'Catan')
19
- return x[:5] == 'Catan'
20
-
21
-
22
- # Cell
23
- learn = load_learner('./models/catan-model-paperspace-3.pkl', pickle_module=dill)
24
  # learn = load_learner('catan-model.pkl', pickle_module=dill)
25
 
26
- # Cell
27
  # categories = learn.dls.vocab
28
  categories = ('Not Catan', 'Catan')
29
 
@@ -36,7 +19,8 @@ def classify_image(img):
36
  # Cell
37
  image = gr.inputs.Image(shape=(192, 192))
38
  label = gr.outputs.Label()
39
- examples = ['board-game-catan-IMG_4671.jpg', 'photo-of-macbook-catan-IMG_4817.jpg']
 
40
 
41
  # Cell
42
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
 
 
 
 
 
 
 
 
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
  import timm
4
  import dill
5
+ import os
6
 
7
+ learn = load_learner('./models/catan-model-paperspace-5.pkl', pickle_module=dill)
 
 
 
 
 
 
 
 
8
  # learn = load_learner('catan-model.pkl', pickle_module=dill)
9
 
 
10
  # categories = learn.dls.vocab
11
  categories = ('Not Catan', 'Catan')
12
 
19
  # Cell
20
  image = gr.inputs.Image(shape=(192, 192))
21
  label = gr.outputs.Label()
22
+ examples_dir_path = './examples/'
23
+ examples = [(examples_dir_path + filename) for filename in os.listdir(examples_dir_path) if filename[:1] != '.']
24
 
25
  # Cell
26
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
board-game-catan-IMG_4671.jpg DELETED
Binary file (738 kB)
examples/Hotdog - Hot_dog_with_mustard.png ADDED

Git LFS Details

  • SHA256: 2239ac71beb535985826d8fb8c78e04b0daaaf86342b2d6ff977198969dc2c40
  • Pointer size: 132 Bytes
  • Size of remote file: 1.06 MB
examples/board-game-catan-IMG_4671.jpg ADDED

Git LFS Details

  • SHA256: 5b669350c0c92f4c8d7dcc98e346ee9ba4f89762ab7f79cf3105b172d6237552
  • Pointer size: 131 Bytes
  • Size of remote file: 738 kB
examples/josh-at-reggie-wedding.jpeg ADDED

Git LFS Details

  • SHA256: 4b348d23451d01e9ff19dcbad7b8b64311b9acfe98827519527766e33a6e91fc
  • Pointer size: 130 Bytes
  • Size of remote file: 64 kB
examples/photo-of-macbook-catan-IMG_4817.jpg ADDED

Git LFS Details

  • SHA256: 243961e3e7327f8eb09f6388a35f4cc98da8e32b79d83687c9c4a5878b8e4c3d
  • Pointer size: 131 Bytes
  • Size of remote file: 591 kB
models/catan-model-paperspace-5.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c8d90b3d3a5dda33b8656170ad1f764081673a78bc7b89421129938fde68ed0
3
+ size 87464303
photo-of-macbook-catan-IMG_4817.jpg DELETED
Binary file (591 kB)