Update app.py
Browse files
app.py
CHANGED
|
@@ -25,8 +25,7 @@ if not os.path.exists(FEEDBACK_FILE):
|
|
| 25 |
# SIMULATED NUMBER PLATE COLOUR DETECTION
|
| 26 |
# Replace with real color detection later
|
| 27 |
# ===============================
|
| 28 |
-
def
|
| 29 |
-
def classify_plate_color(plate_img):
|
| 30 |
try:
|
| 31 |
img = np.array(plate_img)
|
| 32 |
img = cv2.GaussianBlur(img, (5,5), 0)
|
|
@@ -53,6 +52,7 @@ def detect_plate_colour():
|
|
| 53 |
return "Unknown Classification"
|
| 54 |
|
| 55 |
|
|
|
|
| 56 |
def get_vehicle_type_from_colour(colour):
|
| 57 |
mapping = {
|
| 58 |
"White": "Private Vehicle",
|
|
@@ -107,7 +107,7 @@ def detect_image(image):
|
|
| 107 |
return None, "Upload image first.", "", "", "", "", "", ""
|
| 108 |
|
| 109 |
plate_colour = detect_plate_colour()
|
| 110 |
-
vehicle_type =
|
| 111 |
plate_number = "KA01AB1234"
|
| 112 |
|
| 113 |
total_vehicles += 1
|
|
|
|
| 25 |
# SIMULATED NUMBER PLATE COLOUR DETECTION
|
| 26 |
# Replace with real color detection later
|
| 27 |
# ===============================
|
| 28 |
+
def classify_plate_color(plate_img):
|
|
|
|
| 29 |
try:
|
| 30 |
img = np.array(plate_img)
|
| 31 |
img = cv2.GaussianBlur(img, (5,5), 0)
|
|
|
|
| 52 |
return "Unknown Classification"
|
| 53 |
|
| 54 |
|
| 55 |
+
|
| 56 |
def get_vehicle_type_from_colour(colour):
|
| 57 |
mapping = {
|
| 58 |
"White": "Private Vehicle",
|
|
|
|
| 107 |
return None, "Upload image first.", "", "", "", "", "", ""
|
| 108 |
|
| 109 |
plate_colour = detect_plate_colour()
|
| 110 |
+
vehicle_type = classify_plate_color(plate_colour)
|
| 111 |
plate_number = "KA01AB1234"
|
| 112 |
|
| 113 |
total_vehicles += 1
|