Spaces:
Sleeping
Sleeping
jerryjia92
commited on
Commit
•
4e30abb
1
Parent(s):
16a3c68
add is_cat
Browse files
app.py
CHANGED
@@ -5,6 +5,9 @@ learn = load_learner('export.pkl')
|
|
5 |
|
6 |
labels = learn.dls.vocab
|
7 |
|
|
|
|
|
|
|
8 |
def predict(img):
|
9 |
img = PILImage.create(img)
|
10 |
pred,pred_idx,probs = learn.predict(img)
|
|
|
5 |
|
6 |
labels = learn.dls.vocab
|
7 |
|
8 |
+
def is_cat(x):
|
9 |
+
return 'cat' if (x.name)[0].isupper() else 'dog'
|
10 |
+
|
11 |
def predict(img):
|
12 |
img = PILImage.create(img)
|
13 |
pred,pred_idx,probs = learn.predict(img)
|