vebie91 commited on
Commit
52489ed
1 Parent(s): 3ff4a8e

update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -1,12 +1,7 @@
1
  import gradio as gr
2
  from fastai.vision.all import *
3
-
4
- #fix some issues with Poxixpath
5
- # import pathlib
6
- # temp = pathlib.PosixPath
7
- # pathlib.PosixPath = pathlib.WindowsPath
8
-
9
  import pathlib
 
10
  plt = platform.system()
11
  if plt == 'Windows': pathlib.PosixPath = pathlib.WindowsPath
12
 
@@ -16,12 +11,9 @@ def is_cat(x):
16
  learn = load_learner('model.pkl')
17
 
18
  # labels = learn.dls.vocab
 
19
 
20
- # learn.predict(im)
21
-
22
- # %time learn.predict(im)
23
-
24
- categories = ('Dog', 'Cat')
25
 
26
  def classify_image(img):
27
  pred, idx, probs = learn.predict(img)
@@ -36,4 +28,5 @@ intf = gr.Interface(
36
  inputs=image,
37
  outputs=label,
38
  examples=examples)
39
- intf.launch(inline=False)
 
 
1
  import gradio as gr
2
  from fastai.vision.all import *
 
 
 
 
 
 
3
  import pathlib
4
+
5
  plt = platform.system()
6
  if plt == 'Windows': pathlib.PosixPath = pathlib.WindowsPath
7
 
 
11
  learn = load_learner('model.pkl')
12
 
13
  # labels = learn.dls.vocab
14
+ #labels #['cat', 'dog']
15
 
16
+ categories = ('cat', 'dog')
 
 
 
 
17
 
18
  def classify_image(img):
19
  pred, idx, probs = learn.predict(img)
 
28
  inputs=image,
29
  outputs=label,
30
  examples=examples)
31
+
32
+ intf.launch(inline=False)