Spaces:
Runtime error
Runtime error
Load the model before get the labels from the model
Browse files
app.py
CHANGED
@@ -2,8 +2,9 @@ import gradio as gr
|
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
5 |
-
labels = learn.dls.vocab
|
6 |
learn = load_learner('export.pkl')
|
|
|
|
|
7 |
def predict(img):
|
8 |
img = PILImage.create(img)
|
9 |
pred, pred_idx, probs = learn.predict(img)
|
|
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
|
|
5 |
learn = load_learner('export.pkl')
|
6 |
+
labels = learn.dls.vocab
|
7 |
+
|
8 |
def predict(img):
|
9 |
img = PILImage.create(img)
|
10 |
pred, pred_idx, probs = learn.predict(img)
|