Spaces:
Sleeping
Sleeping
Added gitignore
Browse files- .gitignore +2 -0
- README.md +3 -0
- app.py +3 -7
- requirements.txt +2 -1
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.venv
|
2 |
+
venv/
|
README.md
CHANGED
@@ -11,3 +11,6 @@ license: apache-2.0
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
14 |
+
|
15 |
+
|
16 |
+
`pip install --no-cache-dir -r requirements.txt`
|
app.py
CHANGED
@@ -1,14 +1,10 @@
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
import pathlib
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
try:
|
7 |
-
pathlib.PosixPath = pathlib.WindowsPath
|
8 |
-
learn = load_learner('model.pkl')
|
9 |
-
finally:
|
10 |
-
pathlib.PosixPath = posix_backup
|
11 |
-
|
12 |
categories = ('dog','wolf')
|
13 |
|
14 |
def classify_image(img):
|
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
import pathlib
|
4 |
+
plt = platform.system()
|
5 |
+
if plt == 'Linux': pathlib.WindowsPath = pathlib.PosixPath
|
6 |
|
7 |
+
learn = load_learner(pathlib.Path('model.pkl'))
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
categories = ('dog','wolf')
|
9 |
|
10 |
def classify_image(img):
|
requirements.txt
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
fastai
|
|
|
|
1 |
+
fastai
|
2 |
+
gradio==3.19.1
|