Spaces:
Sleeping
Sleeping
adding workaround for PosixPath
Browse files
app.py
CHANGED
@@ -5,6 +5,8 @@ import pathlib, os
|
|
5 |
categories = ['daisy', 'dandelion', 'rose', 'sunflower', 'tulip']
|
6 |
|
7 |
def classify_image(img):
|
|
|
|
|
8 |
|
9 |
learn = load_learner('flowers.pkl')
|
10 |
pred,idx,probs = learn.predict(img)
|
|
|
5 |
categories = ['daisy', 'dandelion', 'rose', 'sunflower', 'tulip']
|
6 |
|
7 |
def classify_image(img):
|
8 |
+
if os.name == 'posix': # workaround for Linux
|
9 |
+
pathlib.WindowsPath = pathlib.PosixPath
|
10 |
|
11 |
learn = load_learner('flowers.pkl')
|
12 |
pred,idx,probs = learn.predict(img)
|