cjlise commited on
Commit
7721e0f
·
1 Parent(s): 487879f

Added requiresments

Browse files
Files changed (2) hide show
  1. app.py +13 -13
  2. requirements.txt +1 -0
app.py CHANGED
@@ -10,20 +10,20 @@ import gradio as gr
10
  def is_cat(x): return x[0].isupper()
11
 
12
  # %% ..\lesson2-app.ipynb 4
13
- #learn = load_learner('model.pkl')
14
- import pathlib
15
- posix_backup = pathlib.PosixPath
16
- try:
17
- pathlib.PosixPath = pathlib.WindowsPath
18
- learn = load_learner('model.pkl')
19
- finally:
20
- pathlib.PosixPath = posix_backup
21
 
22
- # %% ..\lesson2-app.ipynb 6
23
- categories = ('Dog','Cat')
24
- def classify_image(img):
25
- pred, idx, probs = learn.predict(img)
26
- return dict(zip(categories, map(float,probs)))
27
 
28
  # %% ..\lesson2-app.ipynb 8
29
  image = gr.inputs.Image(shape=(192,192))
 
10
  def is_cat(x): return x[0].isupper()
11
 
12
  # %% ..\lesson2-app.ipynb 4
13
+ learn = load_learner('model.pkl')
14
+ # import pathlib
15
+ # posix_backup = pathlib.PosixPath
16
+ # try:
17
+ # pathlib.PosixPath = pathlib.WindowsPath
18
+ # learn = load_learner('model.pkl')
19
+ # finally:
20
+ # pathlib.PosixPath = posix_backup
21
 
22
+ # # %% ..\lesson2-app.ipynb 6
23
+ # categories = ('Dog','Cat')
24
+ # def classify_image(img):
25
+ # pred, idx, probs = learn.predict(img)
26
+ # return dict(zip(categories, map(float,probs)))
27
 
28
  # %% ..\lesson2-app.ipynb 8
29
  image = gr.inputs.Image(shape=(192,192))
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastai