Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,11 @@ model = load_model('DS11Sudhanva.h5')
|
|
8 |
classnames = ['cardboard', 'metal','paper','plastic','trash','green-glass','white-glass','brown-glass','clothes','biological','battery','shoes']
|
9 |
|
10 |
def predict(img):
|
11 |
-
img=img.reshape(
|
12 |
-
|
|
|
|
|
|
|
13 |
return {classnames[i]: float(prediction[i]) for i in range(len(classnames))}
|
14 |
|
15 |
image = gr.inputs.Image(shape=(298, 384))
|
|
|
8 |
classnames = ['cardboard', 'metal','paper','plastic','trash','green-glass','white-glass','brown-glass','clothes','biological','battery','shoes']
|
9 |
|
10 |
def predict(img):
|
11 |
+
img=img.reshape(298,384,3)
|
12 |
+
images_list = []
|
13 |
+
images_list.append(np.array(img))
|
14 |
+
x = np.asarray(images_list)
|
15 |
+
prediction = model.predict(x)
|
16 |
return {classnames[i]: float(prediction[i]) for i in range(len(classnames))}
|
17 |
|
18 |
image = gr.inputs.Image(shape=(298, 384))
|