Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model=tf.keras.models.load_model('./my_model')
|
|
11 |
|
12 |
def import_and_predict(image_data):
|
13 |
x = image_data.reshape((-1, 224, 224, 3))
|
14 |
-
x = tf.keras.applications.imagenet_utils.preprocess_input(x,
|
15 |
prediction = model.predict(x)
|
16 |
labels=class_names
|
17 |
confidences = {labels[i]: float(prediction[0][i]) for i in range(15)}
|
|
|
11 |
|
12 |
def import_and_predict(image_data):
|
13 |
x = image_data.reshape((-1, 224, 224, 3))
|
14 |
+
x = tf.keras.applications.imagenet_utils.preprocess_input(x, mode="tf")
|
15 |
prediction = model.predict(x)
|
16 |
labels=class_names
|
17 |
confidences = {labels[i]: float(prediction[0][i]) for i in range(15)}
|