Spaces:
Runtime error
Runtime error
Commit Β·
a10fbfa
1
Parent(s): ab3729c
fixed examples and added requirements
Browse files
app.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
from fastai.vision.all import *
|
| 2 |
import gradio as gr
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
cap_labels = (
|
| 6 |
'balaclava cap',
|
|
@@ -25,7 +28,7 @@ cap_labels = (
|
|
| 25 |
'visor cap'
|
| 26 |
)
|
| 27 |
|
| 28 |
-
model = load_learner('cap-recognizer-v1.pkl')
|
| 29 |
|
| 30 |
def recognize_image(image):
|
| 31 |
pred, idx, probs = model.predict(image)
|
|
|
|
| 1 |
from fastai.vision.all import *
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
import pathlib
|
| 5 |
+
temp = pathlib.PosixPath
|
| 6 |
+
pathlib.PosixPath = pathlib.WindowsPath
|
| 7 |
|
| 8 |
cap_labels = (
|
| 9 |
'balaclava cap',
|
|
|
|
| 28 |
'visor cap'
|
| 29 |
)
|
| 30 |
|
| 31 |
+
model = load_learner('models/cap-recognizer-v1.pkl')
|
| 32 |
|
| 33 |
def recognize_image(image):
|
| 34 |
pred, idx, probs = model.predict(image)
|
requirements.txt
ADDED
|
Binary file (62 Bytes). View file
|
|
|
test_images/unknown_00.jpg β unknown_00.jpg
RENAMED
|
File without changes
|
test_images/unknown_01.jpg β unknown_01.jpg
RENAMED
|
File without changes
|
test_images/unknown_02.jpg β unknown_02.jpg
RENAMED
|
File without changes
|
test_images/unknown_03.jpg β unknown_03.jpg
RENAMED
|
File without changes
|