Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,23 +134,23 @@ def load_data():
|
|
| 134 |
|
| 135 |
imgs = y_test["Path"].values
|
| 136 |
labels = y_test["ClassId"].values
|
| 137 |
-
st.write(imgs)
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
#
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
def main():
|
| 156 |
colored_title("Traffic Symbol Prediction", "black")
|
|
|
|
| 134 |
|
| 135 |
imgs = y_test["Path"].values
|
| 136 |
labels = y_test["ClassId"].values
|
| 137 |
+
# st.write(imgs)
|
| 138 |
+
test_images = []
|
| 139 |
+
for img in imgs:
|
| 140 |
+
if isinstance(img,str):
|
| 141 |
+
image = Image.open('traffic_lights'+img)
|
| 142 |
+
image = image.resize([30, 30])
|
| 143 |
+
test_images.append(np.array(image))
|
| 144 |
+
|
| 145 |
+
# Load meta images
|
| 146 |
+
meta_images = {}
|
| 147 |
+
meta_folder = 'traffic_lights/Meta' # Replace with the path to your meta folder
|
| 148 |
+
for class_id in range(43):
|
| 149 |
+
meta_image_path = os.path.join(meta_folder, f"{class_id}.png") # Assuming meta images are named as 0.png, 1.png, etc.
|
| 150 |
+
if os.path.exists(meta_image_path):
|
| 151 |
+
meta_images[class_id] = Image.open(meta_image_path)
|
| 152 |
+
|
| 153 |
+
return test_images, labels, meta_images
|
| 154 |
|
| 155 |
def main():
|
| 156 |
colored_title("Traffic Symbol Prediction", "black")
|