Spaces:
Sleeping
Sleeping
thebenfirsty
commited on
Commit
•
acd8759
1
Parent(s):
68c303e
Make sure to add label function in app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,14 @@ import gradio as gr
|
|
2 |
import fastai
|
3 |
from fastai.vision.all import *
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
learn = load_learner('export-2.pkl')
|
6 |
labels = learn.dls.vocab
|
7 |
def predict(img):
|
|
|
2 |
import fastai
|
3 |
from fastai.vision.all import *
|
4 |
|
5 |
+
def label_func(x):
|
6 |
+
if x.name[0] == 'm':
|
7 |
+
return "Mustang"
|
8 |
+
elif x.name[1] == "a":
|
9 |
+
return "Camaro"
|
10 |
+
elif x.name[1] == "h":
|
11 |
+
return "Challenger"
|
12 |
+
|
13 |
learn = load_learner('export-2.pkl')
|
14 |
labels = learn.dls.vocab
|
15 |
def predict(img):
|