tyler cross
commited on
Commit
•
651c29b
1
Parent(s):
2567e9f
Added corrected pathing
Browse files- __pycache__/app.cpython-311.pyc +0 -0
- app.py +5 -1
__pycache__/app.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import load_learner
|
3 |
from PIL import Image
|
|
|
|
|
|
|
4 |
|
5 |
model = load_learner('export.pkl')
|
6 |
|
@@ -21,9 +24,10 @@ def classify_image(img):
|
|
21 |
return {model.dls.vocab[i]: float(probs[i]) for i in range(len(model.dls.vocab))}
|
22 |
|
23 |
demo = gr.Interface(
|
|
|
24 |
fn=classify_image,
|
25 |
inputs = gr.Image(
|
26 |
-
label = 'Upload an image of a dung beetle, a dolphin, or an elephant!'),
|
27 |
outputs="label")
|
28 |
|
29 |
if __name__ == "__main__":
|
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import load_learner
|
3 |
from PIL import Image
|
4 |
+
import pathlib
|
5 |
+
temp = pathlib.PosixPath
|
6 |
+
pathlib.PosixPath = pathlib.WindowsPath
|
7 |
|
8 |
model = load_learner('export.pkl')
|
9 |
|
|
|
24 |
return {model.dls.vocab[i]: float(probs[i]) for i in range(len(model.dls.vocab))}
|
25 |
|
26 |
demo = gr.Interface(
|
27 |
+
title = "A dung beetle / dolphin / elephant image classifier",
|
28 |
fn=classify_image,
|
29 |
inputs = gr.Image(
|
30 |
+
label = 'Upload an image of a dung beetle, a dolphin, or an elephant!'),
|
31 |
outputs="label")
|
32 |
|
33 |
if __name__ == "__main__":
|