AItool commited on
Commit
cd15ef2
·
1 Parent(s): 4e49752

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,6 +1,5 @@
1
  __all__ = ['is_real', 'learn', 'virtual staging', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']import pathlib
2
- temp = pathlib.PosixPath
3
- pathlib.PosixPath = pathlib.WindowsPath
4
  #|export
5
  #fastai has to be available, i.e. fastai folder
6
  from fastai.vision.all import *
@@ -15,7 +14,7 @@ learn = load_learner('model.pkl')
15
  categories =('Virtual Staging','Real')
16
 
17
  def classify_image(img):
18
- pred,idx,probs = learn.predict(im)
19
  return dict(zip(categories,map(float,probs)))
20
 
21
  #*** We have to cast to float above because KAGGLE does not return number on the answer it returns tensors, and Gradio does not deal with numpy so we have to cast to float
 
1
  __all__ = ['is_real', 'learn', 'virtual staging', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']import pathlib
2
+
 
3
  #|export
4
  #fastai has to be available, i.e. fastai folder
5
  from fastai.vision.all import *
 
14
  categories =('Virtual Staging','Real')
15
 
16
  def classify_image(img):
17
+ pred,idx,probs = learn.predict(img)
18
  return dict(zip(categories,map(float,probs)))
19
 
20
  #*** We have to cast to float above because KAGGLE does not return number on the answer it returns tensors, and Gradio does not deal with numpy so we have to cast to float