Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ labels = ['compost', 'e-waste', 'recycle', 'trash']
|
|
17 |
def classify_image(inp):
|
18 |
inp = inp.reshape((-1, 224, 224, 3))
|
19 |
#inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
20 |
-
prediction =
|
21 |
confidences = {labels[i]: float(prediction[i]) for i in range(4)}
|
22 |
return confidences
|
23 |
|
|
|
17 |
def classify_image(inp):
|
18 |
inp = inp.reshape((-1, 224, 224, 3))
|
19 |
#inp = tf.keras.applications.mobilenet_v2.preprocess_input(inp)
|
20 |
+
prediction = pre_trained_model.predict(inp).flatten()
|
21 |
confidences = {labels[i]: float(prediction[i]) for i in range(4)}
|
22 |
return confidences
|
23 |
|