yangfang236 commited on
Commit
530dd07
·
1 Parent(s): 1cb7b45

path_to_model

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,7 +5,8 @@ import pathlib
5
  import platform
6
  plt = platform.system()
7
  if plt == 'Windows': pathlib.PosixPath=pathlib.WindowsPath
8
-
 
9
  # %% Untitled.ipynb 3
10
  def predict(img):
11
  labels=learn.dls.vocab
@@ -14,7 +15,7 @@ def predict(img):
14
  return {labels[i]:float(probs[i]) for i in range (len(labels))}
15
 
16
  # %% Untitled.ipynb 5
17
- learn=load_learner('export.pkl')
18
 
19
  # %% Untitled.ipynb 8
20
  examples = ["covid-19.jpg", "normal.jpg", "viral pneumonia.jpg"]
 
5
  import platform
6
  plt = platform.system()
7
  if plt == 'Windows': pathlib.PosixPath=pathlib.WindowsPath
8
+ from pathlib import Path
9
+ path_to_model=Path('export.pkl')
10
  # %% Untitled.ipynb 3
11
  def predict(img):
12
  labels=learn.dls.vocab
 
15
  return {labels[i]:float(probs[i]) for i in range (len(labels))}
16
 
17
  # %% Untitled.ipynb 5
18
+ learn=load_learner(path_to_model)
19
 
20
  # %% Untitled.ipynb 8
21
  examples = ["covid-19.jpg", "normal.jpg", "viral pneumonia.jpg"]