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