msibertman commited on
Commit
306483c
·
1 Parent(s): af75e96
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1,9 +1,9 @@
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
4
- # import pathlib
5
- # temp = pathlib.PosixPath
6
- # pathlib.PosixPath = pathlib.WindowsPath
7
 
8
  cap_labels = (
9
  'balaclava cap',
@@ -31,10 +31,10 @@ cap_labels = (
31
  model = load_learner('models/cap-recognizer-v2.pkl')
32
 
33
  def recognize_image(image):
34
- pred, idx, probs = model.predict(image)
35
- return dict(zip(cap_labels, map(float, probs)))
36
 
37
- image = gr.inputs.Image(type='pil', shape=(192,192))
38
  label = gr.outputs.Label(num_top_classes=5)
39
  examples = [
40
  'test_images/unknown_00.jpg',
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
4
+ import pathlib
5
+ temp = pathlib.PosixPath
6
+ pathlib.PosixPath = pathlib.WindowsPath
7
 
8
  cap_labels = (
9
  'balaclava cap',
 
31
  model = load_learner('models/cap-recognizer-v2.pkl')
32
 
33
  def recognize_image(image):
34
+ pred, idx, probs = model.predict(image)
35
+ return dict(zip(cap_labels, map(float, probs)))
36
 
37
+ image = gr.inputs.Image(shape=(192,192))
38
  label = gr.outputs.Label(num_top_classes=5)
39
  examples = [
40
  'test_images/unknown_00.jpg',