Update app.py
Browse files
app.py
CHANGED
|
@@ -10,26 +10,27 @@ examples = ['1.jpg','2.jpg','3.png','4.png','5.png','6.png','7.webp','8.png','9.
|
|
| 10 |
|
| 11 |
|
| 12 |
# Define class names (replace with your actual class names)
|
| 13 |
-
class_names = [
|
| 14 |
-
"Speed limit
|
| 15 |
-
"Speed limit
|
| 16 |
-
"Speed limit
|
| 17 |
-
"Speed limit
|
| 18 |
-
"Speed limit
|
| 19 |
-
"End of speed limit
|
| 20 |
-
"Speed limit
|
| 21 |
-
"Speed limit
|
| 22 |
"No passing",
|
| 23 |
-
"No passing
|
| 24 |
-
"Right-of-way at intersection",
|
| 25 |
"Priority road",
|
| 26 |
"Yield",
|
|
|
|
| 27 |
"No vehicles",
|
| 28 |
-
"
|
| 29 |
"No entry",
|
| 30 |
"General caution",
|
| 31 |
-
"Dangerous curve left",
|
| 32 |
-
"Dangerous curve right",
|
| 33 |
"Double curve",
|
| 34 |
"Bumpy road",
|
| 35 |
"Slippery road",
|
|
@@ -41,7 +42,7 @@ class_names = [ "Speed limit (20 km/h)",
|
|
| 41 |
"Bicycles crossing",
|
| 42 |
"Beware of ice/snow",
|
| 43 |
"Wild animals crossing",
|
| 44 |
-
"End speed
|
| 45 |
"Turn right ahead",
|
| 46 |
"Turn left ahead",
|
| 47 |
"Ahead only",
|
|
@@ -51,7 +52,7 @@ class_names = [ "Speed limit (20 km/h)",
|
|
| 51 |
"Keep left",
|
| 52 |
"Roundabout mandatory",
|
| 53 |
"End of no passing",
|
| 54 |
-
"End no passing
|
| 55 |
|
| 56 |
# Preprocessing function
|
| 57 |
def preprocess_image(image):
|
|
@@ -85,7 +86,7 @@ interface = gr.Interface(
|
|
| 85 |
outputs=gr.Textbox(label="Label "), # Display output as text
|
| 86 |
title="German Traffic Sign Recognition",
|
| 87 |
description="Upload an image to classify it into one of the predefined classes.",
|
| 88 |
-
|
| 89 |
|
| 90 |
# Launch the app
|
| 91 |
if __name__ == "__main__":
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
# Define class names (replace with your actual class names)
|
| 13 |
+
class_names = [ "Speed limit 20 km/h",
|
| 14 |
+
"Speed limit 30 km/h",
|
| 15 |
+
"Speed limit 50 km/h",
|
| 16 |
+
"Speed limit 60 km/h",
|
| 17 |
+
"Speed limit 70 km/h",
|
| 18 |
+
"Speed limit 80 km/h",
|
| 19 |
+
"End of speed limit 80 km/h",
|
| 20 |
+
"Speed limit 100 km/h",
|
| 21 |
+
"Speed limit 120 km/h",
|
| 22 |
"No passing",
|
| 23 |
+
"No passing for vehicles over 3.5 metric tons",
|
| 24 |
+
"Right-of-way at the next intersection",
|
| 25 |
"Priority road",
|
| 26 |
"Yield",
|
| 27 |
+
"Stop",
|
| 28 |
"No vehicles",
|
| 29 |
+
"Vehicles over 3.5 metric tons prohibited",
|
| 30 |
"No entry",
|
| 31 |
"General caution",
|
| 32 |
+
"Dangerous curve to the left",
|
| 33 |
+
"Dangerous curve to the right",
|
| 34 |
"Double curve",
|
| 35 |
"Bumpy road",
|
| 36 |
"Slippery road",
|
|
|
|
| 42 |
"Bicycles crossing",
|
| 43 |
"Beware of ice/snow",
|
| 44 |
"Wild animals crossing",
|
| 45 |
+
"End of all speed and passing limits",
|
| 46 |
"Turn right ahead",
|
| 47 |
"Turn left ahead",
|
| 48 |
"Ahead only",
|
|
|
|
| 52 |
"Keep left",
|
| 53 |
"Roundabout mandatory",
|
| 54 |
"End of no passing",
|
| 55 |
+
"End of no passing by vehicles over 3.5 metric tons"] # Update this with your classes
|
| 56 |
|
| 57 |
# Preprocessing function
|
| 58 |
def preprocess_image(image):
|
|
|
|
| 86 |
outputs=gr.Textbox(label="Label "), # Display output as text
|
| 87 |
title="German Traffic Sign Recognition",
|
| 88 |
description="Upload an image to classify it into one of the predefined classes.",
|
| 89 |
+
)
|
| 90 |
|
| 91 |
# Launch the app
|
| 92 |
if __name__ == "__main__":
|