Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import os
|
|
7 |
import numpy as np
|
8 |
|
9 |
|
10 |
-
labels= {'Burger King': 0, 'KFC': 1,'McDonalds': 2,'Other': 3,'Starbucks': 4,'Subway': 5}
|
11 |
HEIGHT,WIDTH=224,224
|
12 |
NUM_CLASSES=6
|
13 |
|
@@ -43,7 +43,7 @@ def classify_image(inp):
|
|
43 |
result[label] = float(predicted_class_indices[i])
|
44 |
except KeyError:
|
45 |
print(f"KeyError: Label not found for index {predicted_class_indices[i]}")
|
46 |
-
return f"{
|
47 |
|
48 |
|
49 |
|
|
|
7 |
import numpy as np
|
8 |
|
9 |
|
10 |
+
# labels= {'Burger King': 0, 'KFC': 1,'McDonalds': 2,'Other': 3,'Starbucks': 4,'Subway': 5}
|
11 |
HEIGHT,WIDTH=224,224
|
12 |
NUM_CLASSES=6
|
13 |
|
|
|
43 |
result[label] = float(predicted_class_indices[i])
|
44 |
except KeyError:
|
45 |
print(f"KeyError: Label not found for index {predicted_class_indices[i]}")
|
46 |
+
return f"{labels[i]: float(prediction[i]) for i in range(NUM_CLASSES)}"
|
47 |
|
48 |
|
49 |
|