Disguised commited on
Commit
685c77f
·
1 Parent(s): 2f02313
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,10 +1,13 @@
1
  import gradio as gr
2
  from fastai.vision.all import *
3
  import gradio as gr
 
4
  from glob import glob
5
 
6
  learn = load_learner('model_ft15(extra).pkl')
7
 
 
 
8
  def classify_image(img):
9
  pred,idx,probs = learn.predict(img)
10
  return dict(zip(categories, map(float,probs)))
 
1
  import gradio as gr
2
  from fastai.vision.all import *
3
  import gradio as gr
4
+ import re
5
  from glob import glob
6
 
7
  learn = load_learner('model_ft15(extra).pkl')
8
 
9
+ categories = learn.dls.vocab
10
+
11
  def classify_image(img):
12
  pred,idx,probs = learn.predict(img)
13
  return dict(zip(categories, map(float,probs)))