Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,14 @@
|
|
| 1 |
-
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 *
|
| 7 |
import gradio as gr
|
| 8 |
-
import pickle
|
| 9 |
-
import timm
|
| 10 |
-
|
| 11 |
-
# Cell
|
| 12 |
-
learn = load_learner('model.pkl')
|
| 13 |
-
|
| 14 |
-
# Cell
|
| 15 |
-
#categories = learn.dls.vocab
|
| 16 |
|
| 17 |
def is_real(x): return x[0].isupper()
|
| 18 |
|
| 19 |
-
|
| 20 |
learn = load_learner('model.pkl')
|
| 21 |
|
| 22 |
#|export
|
|
@@ -35,5 +27,4 @@ label = gr.outputs.Label()
|
|
| 35 |
examples = ['virtual.jpg','real.jpg','dunno.jpg']
|
| 36 |
|
| 37 |
intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
| 38 |
-
intf.launch(inline=False)
|
| 39 |
-
|
|
|
|
| 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 *
|
| 7 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def is_real(x): return x[0].isupper()
|
| 10 |
|
| 11 |
+
# Cell
|
| 12 |
learn = load_learner('model.pkl')
|
| 13 |
|
| 14 |
#|export
|
|
|
|
| 27 |
examples = ['virtual.jpg','real.jpg','dunno.jpg']
|
| 28 |
|
| 29 |
intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
| 30 |
+
intf.launch(inline=False)
|
|
|