PaulMest commited on
Commit
d72a078
·
1 Parent(s): 4994b79

Attempt #3 - does adding is_catan make this work??

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -12,6 +12,13 @@ import gradio as gr
12
  import timm
13
  import dill
14
 
 
 
 
 
 
 
 
15
  # Cell
16
  learn = load_learner('catan-model-paperspace.pkl', pickle_module=dill)
17
 
@@ -19,6 +26,7 @@ learn = load_learner('catan-model-paperspace.pkl', pickle_module=dill)
19
  # categories = learn.dls.vocab
20
  categories = ('Not Catan', 'Catan')
21
 
 
22
  def classify_image(img):
23
  pred, idx, probs = learn.predict(img)
24
  return dict(zip(categories, map(float, probs)))
 
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('catan-model-paperspace.pkl', pickle_module=dill)
24
 
 
26
  # categories = learn.dls.vocab
27
  categories = ('Not Catan', 'Catan')
28
 
29
+
30
  def classify_image(img):
31
  pred, idx, probs = learn.predict(img)
32
  return dict(zip(categories, map(float, probs)))