Spaces:
Runtime error
Runtime error
Amanda Sarubbi
commited on
Commit
·
de2563a
1
Parent(s):
7140212
fix
Browse files
app.py
CHANGED
@@ -51,14 +51,23 @@ def predict(img, model_name):
|
|
51 |
colors_learn = import_model('colors_model.pkl')
|
52 |
pred = colors_learn.predict(img)[0]
|
53 |
labels = misc
|
|
|
|
|
|
|
54 |
elif (model_name == 'Buildings, Dwellings & Furniture'):
|
55 |
build_learn = import_model('buildings_model.pkl')
|
56 |
pred = build_learn.predict(img)[0]
|
57 |
labels = build
|
|
|
|
|
|
|
58 |
elif (model_name == 'Animals'):
|
59 |
anim_learn = import_model('animals_model.pkl')
|
60 |
pred = anim_learn.predict(img)[0]
|
61 |
labels = anim
|
|
|
|
|
|
|
62 |
|
63 |
pred = str(pred)
|
64 |
fix_pred = pred[4:-4]
|
|
|
51 |
colors_learn = import_model('colors_model.pkl')
|
52 |
pred = colors_learn.predict(img)[0]
|
53 |
labels = misc
|
54 |
+
pred = str(pred)
|
55 |
+
fix_pred = pred[4:-4]
|
56 |
+
return fix_pred
|
57 |
elif (model_name == 'Buildings, Dwellings & Furniture'):
|
58 |
build_learn = import_model('buildings_model.pkl')
|
59 |
pred = build_learn.predict(img)[0]
|
60 |
labels = build
|
61 |
+
pred = str(pred)
|
62 |
+
fix_pred = pred[4:-4]
|
63 |
+
return fix_pred
|
64 |
elif (model_name == 'Animals'):
|
65 |
anim_learn = import_model('animals_model.pkl')
|
66 |
pred = anim_learn.predict(img)[0]
|
67 |
labels = anim
|
68 |
+
pred = str(pred)
|
69 |
+
fix_pred = pred[4:-4]
|
70 |
+
return fix_pred
|
71 |
|
72 |
pred = str(pred)
|
73 |
fix_pred = pred[4:-4]
|