Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,14 @@ import os
|
|
7 |
HEIGHT, WIDTH = 224, 224
|
8 |
NUM_CLASSES = 6
|
9 |
LABELS = ["Burger King", "KFC", "McDonalds", "Other", "Starbucks", "Subway"]
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Loading trained model
|
12 |
-
model = tf.keras.models.load_model('best_model2.h5')
|
13 |
|
14 |
def classify_image(inp):
|
15 |
np.random.seed(143)
|
|
|
7 |
HEIGHT, WIDTH = 224, 224
|
8 |
NUM_CLASSES = 6
|
9 |
LABELS = ["Burger King", "KFC", "McDonalds", "Other", "Starbucks", "Subway"]
|
10 |
+
from tensorflow_addons.metrics import F1Score
|
11 |
+
from keras.utils import custom_object_scope
|
12 |
+
|
13 |
+
with custom_object_scope({'Addons>F1Score': F1Score}):
|
14 |
+
model = tf.keras.models.load_model('best_model2.h5')
|
15 |
|
16 |
# Loading trained model
|
17 |
+
# model = tf.keras.models.load_model('best_model2.h5')
|
18 |
|
19 |
def classify_image(inp):
|
20 |
np.random.seed(143)
|