Spaces:
Runtime error
Runtime error
Erik Lager
commited on
Commit
·
6818f1f
1
Parent(s):
fce2bf4
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,13 @@ from fastai.vision.all import *
|
|
2 |
import gradio as gr
|
3 |
import os
|
4 |
from pathlib import Path
|
|
|
5 |
|
6 |
def is_cat(x): return x[0].isupper()
|
7 |
|
|
|
|
|
|
|
8 |
path = Path(os.path.dirname(os.path.abspath(__file__)))
|
9 |
model_path = path / 'model.pkl' # Construct the Windows-style path
|
10 |
|
@@ -17,9 +21,8 @@ def classify_image(img):
|
|
17 |
return dict(zip(categories, map(float, probs)))
|
18 |
|
19 |
image = gr.inputs.Image(shape=(192,192))
|
20 |
-
|
21 |
label = gr.outputs.Label()
|
22 |
examples = ['dog.jpg']
|
23 |
|
24 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label,examples=examples)
|
25 |
-
intf.launch()
|
|
|
2 |
import gradio as gr
|
3 |
import os
|
4 |
from pathlib import Path
|
5 |
+
import pathlib
|
6 |
|
7 |
def is_cat(x): return x[0].isupper()
|
8 |
|
9 |
+
temp = pathlib.PosixPath
|
10 |
+
pathlib.PosixPath = pathlib.WindowsPath
|
11 |
+
|
12 |
path = Path(os.path.dirname(os.path.abspath(__file__)))
|
13 |
model_path = path / 'model.pkl' # Construct the Windows-style path
|
14 |
|
|
|
21 |
return dict(zip(categories, map(float, probs)))
|
22 |
|
23 |
image = gr.inputs.Image(shape=(192,192))
|
|
|
24 |
label = gr.outputs.Label()
|
25 |
examples = ['dog.jpg']
|
26 |
|
27 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label,examples=examples)
|
28 |
+
intf.launch(share=True)
|