diff --git a/0031/daytime.jpg b/0031_SanRafael/daytime.jpg similarity index 100% rename from 0031/daytime.jpg rename to 0031_SanRafael/daytime.jpg diff --git a/0031/daytime2.jpg b/0031_SanRafael/daytime2.jpg similarity index 100% rename from 0031/daytime2.jpg rename to 0031_SanRafael/daytime2.jpg diff --git a/0031/night.jpg b/0031_SanRafael/night.jpg similarity index 100% rename from 0031/night.jpg rename to 0031_SanRafael/night.jpg diff --git a/0031/night_2.jpg b/0031_SanRafael/night_2.jpg similarity index 100% rename from 0031/night_2.jpg rename to 0031_SanRafael/night_2.jpg diff --git a/0033/day.jpg b/0033_SanQuentin/day.jpg similarity index 100% rename from 0033/day.jpg rename to 0033_SanQuentin/day.jpg diff --git a/0033/evening.jpg b/0033_SanQuentin/evening.jpg similarity index 100% rename from 0033/evening.jpg rename to 0033_SanQuentin/evening.jpg diff --git a/0033/night.jpg b/0033_SanQuentin/night.jpg similarity index 100% rename from 0033/night.jpg rename to 0033_SanQuentin/night.jpg diff --git a/0034/day.jpg b/0034_Novato/day.jpg similarity index 100% rename from 0034/day.jpg rename to 0034_Novato/day.jpg diff --git a/0034/evening.jpg b/0034_Novato/evening.jpg similarity index 100% rename from 0034/evening.jpg rename to 0034_Novato/evening.jpg diff --git a/0034/night.jpg b/0034_Novato/night.jpg similarity index 100% rename from 0034/night.jpg rename to 0034_Novato/night.jpg diff --git a/0307/daytime.jpg b/0307_SanQuentin/daytime.jpg similarity index 100% rename from 0307/daytime.jpg rename to 0307_SanQuentin/daytime.jpg diff --git a/0307/daytime2.jpg b/0307_SanQuentin/daytime2.jpg similarity index 100% rename from 0307/daytime2.jpg rename to 0307_SanQuentin/daytime2.jpg diff --git a/0307/night.jpg b/0307_SanQuentin/night.jpg similarity index 100% rename from 0307/night.jpg rename to 0307_SanQuentin/night.jpg diff --git a/0307/night_2.jpg b/0307_SanQuentin/night_2.jpg similarity index 100% rename from 0307/night_2.jpg rename to 0307_SanQuentin/night_2.jpg diff --git a/0308/daytime.jpg b/0308 _SanQuentin/daytime.jpg similarity index 100% rename from 0308/daytime.jpg rename to 0308 _SanQuentin/daytime.jpg diff --git a/0308/evening.jpg b/0308 _SanQuentin/evening.jpg similarity index 100% rename from 0308/evening.jpg rename to 0308 _SanQuentin/evening.jpg diff --git a/0308/foggy_day.jpg b/0308 _SanQuentin/foggy_day.jpg similarity index 100% rename from 0308/foggy_day.jpg rename to 0308 _SanQuentin/foggy_day.jpg diff --git a/0308/night.jpg b/0308 _SanQuentin/night.jpg similarity index 100% rename from 0308/night.jpg rename to 0308 _SanQuentin/night.jpg diff --git a/0309/day.jpg b/0309_SanQuentin/day.jpg similarity index 100% rename from 0309/day.jpg rename to 0309_SanQuentin/day.jpg diff --git a/0309/evening.jpg b/0309_SanQuentin/evening.jpg similarity index 100% rename from 0309/evening.jpg rename to 0309_SanQuentin/evening.jpg diff --git a/0309/night.jpg b/0309_SanQuentin/night.jpg similarity index 100% rename from 0309/night.jpg rename to 0309_SanQuentin/night.jpg diff --git a/0310/daytime.jpg b/0310_SanQuentin/daytime.jpg similarity index 100% rename from 0310/daytime.jpg rename to 0310_SanQuentin/daytime.jpg diff --git a/0310/evening.jpg b/0310_SanQuentin/evening.jpg similarity index 100% rename from 0310/evening.jpg rename to 0310_SanQuentin/evening.jpg diff --git a/0310/night2.jpg b/0310_SanQuentin/night2.jpg similarity index 100% rename from 0310/night2.jpg rename to 0310_SanQuentin/night2.jpg diff --git a/0313/day.jpg b/0313_SanQuentin/day.jpg similarity index 100% rename from 0313/day.jpg rename to 0313_SanQuentin/day.jpg diff --git a/0313/evening.jpg b/0313_SanQuentin/evening.jpg similarity index 100% rename from 0313/evening.jpg rename to 0313_SanQuentin/evening.jpg diff --git a/0313/foggy_day.jpg b/0313_SanQuentin/foggy_day.jpg similarity index 100% rename from 0313/foggy_day.jpg rename to 0313_SanQuentin/foggy_day.jpg diff --git a/0313/night.jpg b/0313_SanQuentin/night.jpg similarity index 100% rename from 0313/night.jpg rename to 0313_SanQuentin/night.jpg diff --git a/0317/daytime_4.jpg b/0317_SanQuentin/daytime_4.jpg similarity index 100% rename from 0317/daytime_4.jpg rename to 0317_SanQuentin/daytime_4.jpg diff --git a/0317/daytime_5.jpg b/0317_SanQuentin/daytime_5.jpg similarity index 100% rename from 0317/daytime_5.jpg rename to 0317_SanQuentin/daytime_5.jpg diff --git a/0317/eve.jpg b/0317_SanQuentin/eve.jpg similarity index 100% rename from 0317/eve.jpg rename to 0317_SanQuentin/eve.jpg diff --git a/0317/evening_2.jpg b/0317_SanQuentin/evening_2.jpg similarity index 100% rename from 0317/evening_2.jpg rename to 0317_SanQuentin/evening_2.jpg diff --git a/0317/night_2.jpg b/0317_SanQuentin/night_2.jpg similarity index 100% rename from 0317/night_2.jpg rename to 0317_SanQuentin/night_2.jpg diff --git a/0321/day.jpg b/0321_SanQuentin/day.jpg similarity index 100% rename from 0321/day.jpg rename to 0321_SanQuentin/day.jpg diff --git a/0321/day2.jpg b/0321_SanQuentin/day2.jpg similarity index 100% rename from 0321/day2.jpg rename to 0321_SanQuentin/day2.jpg diff --git a/0321/night.jpg b/0321_SanQuentin/night.jpg similarity index 100% rename from 0321/night.jpg rename to 0321_SanQuentin/night.jpg diff --git a/0322/day.jpg b/0322_SanQuentin/day.jpg similarity index 100% rename from 0322/day.jpg rename to 0322_SanQuentin/day.jpg diff --git a/0322/evening.jpg b/0322_SanQuentin/evening.jpg similarity index 100% rename from 0322/evening.jpg rename to 0322_SanQuentin/evening.jpg diff --git a/0322/night.jpg b/0322_SanQuentin/night.jpg similarity index 100% rename from 0322/night.jpg rename to 0322_SanQuentin/night.jpg diff --git a/0327/daytime.jpg b/0327_SanQuentin/daytime.jpg similarity index 100% rename from 0327/daytime.jpg rename to 0327_SanQuentin/daytime.jpg diff --git a/0327/evening.jpg b/0327_SanQuentin/evening.jpg similarity index 100% rename from 0327/evening.jpg rename to 0327_SanQuentin/evening.jpg diff --git a/0327/night.jpg b/0327_SanQuentin/night.jpg similarity index 100% rename from 0327/night.jpg rename to 0327_SanQuentin/night.jpg diff --git a/0468/daytime.jpg b/0468_ Novato/daytime.jpg similarity index 100% rename from 0468/daytime.jpg rename to 0468_ Novato/daytime.jpg diff --git a/0468/daytime_2.jpg b/0468_ Novato/daytime_2.jpg similarity index 100% rename from 0468/daytime_2.jpg rename to 0468_ Novato/daytime_2.jpg diff --git a/0468/evening.jpg b/0468_ Novato/evening.jpg similarity index 100% rename from 0468/evening.jpg rename to 0468_ Novato/evening.jpg diff --git a/0468/evening_2.jpg b/0468_ Novato/evening_2.jpg similarity index 100% rename from 0468/evening_2.jpg rename to 0468_ Novato/evening_2.jpg diff --git a/0483/day.jpg b/0483_Petaluma/day.jpg similarity index 100% rename from 0483/day.jpg rename to 0483_Petaluma/day.jpg diff --git a/0483/evening.jpg b/0483_Petaluma/evening.jpg similarity index 100% rename from 0483/evening.jpg rename to 0483_Petaluma/evening.jpg diff --git a/0483/night.jpg b/0483_Petaluma/night.jpg similarity index 100% rename from 0483/night.jpg rename to 0483_Petaluma/night.jpg diff --git a/0548/day2.jpg b/0548 _SanRafael/day2.jpg similarity index 100% rename from 0548/day2.jpg rename to 0548 _SanRafael/day2.jpg diff --git a/0548/night.jpg b/0548 _SanRafael/night.jpg similarity index 100% rename from 0548/night.jpg rename to 0548 _SanRafael/night.jpg diff --git a/0566/day.jpg b/0566_Sausalito/day.jpg similarity index 100% rename from 0566/day.jpg rename to 0566_Sausalito/day.jpg diff --git a/0569/evening.jpg b/0569_Novato/evening.jpg similarity index 100% rename from 0569/evening.jpg rename to 0569_Novato/evening.jpg diff --git a/0569/night.jpg b/0569_Novato/night.jpg similarity index 100% rename from 0569/night.jpg rename to 0569_Novato/night.jpg diff --git a/Inference/test.jpg b/Inference/test.jpg new file mode 100644 index 0000000000000000000000000000000000000000..782c6107f4236ffb5ebd66261476688bc2a0656f Binary files /dev/null and b/Inference/test.jpg differ diff --git a/app.py b/app.py index 0692e4691eed29eab3324961bfd2905d6a108564..9a2ff4452449c7b2428774e02efe310db7246aa0 100644 --- a/app.py +++ b/app.py @@ -15,7 +15,7 @@ import numpy as np cameras = { - "0031": [ + "0031_SanRafael": [ {"name": "night", "path": "night.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.165, "y": 0.594 },{ "x": 0.208, "y": 0.582 },{ "x": 0.344, "y": 0.912 },{ "x": 0.238, "y": 0.916 }]}, {"coordinates": [{ "x": 0.569, "y": 0.571 },{ "x": 0.617, "y": 0.620 },{ "x": 0.663, "y": 0.719 },{ "x": 0.671, "y": 0.866 },{ "x": 0.914, "y": 0.836 },{ "x": 0.710, "y": 0.668 },{ "x": 0.581, "y": 0.579 }]} @@ -33,7 +33,7 @@ cameras = { {"coordinates": [{ "x": 0.569, "y": 0.571 },{ "x": 0.617, "y": 0.620 },{ "x": 0.663, "y": 0.719 },{ "x": 0.671, "y": 0.866 },{ "x": 0.914, "y": 0.836 },{ "x": 0.710, "y": 0.668 },{ "x": 0.581, "y": 0.579 }]} ])} ], - "0034": [ + "0034_Novato": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.072, "y": 0.475 },{ "x": 0.105, "y": 0.445 },{ "x": 0.212, "y": 0.914 },{ "x": 0.027, "y": 0.911 }]}, {"coordinates": [{ "x": 0.233, "y": 0.433 },{ "x": 0.268, "y": 0.409 },{ "x": 0.879, "y": 0.885 },{ "x": 0.695, "y": 0.914 }]} @@ -47,7 +47,7 @@ cameras = { {"coordinates": [{ "x": 0.233, "y": 0.433 },{ "x": 0.268, "y": 0.409 },{ "x": 0.879, "y": 0.885 },{ "x": 0.695, "y": 0.914 }]} ])} ], - "0033": [ + "0033_SanQuentin": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.064, "y": 0.311 },{ "x": 0.089, "y": 0.297 },{ "x": 0.210, "y": 0.410 },{ "x": 0.263, "y": 0.508 },{ "x": 0.344, "y": 0.863 },{ "x": 0.195, "y": 0.883 },{ "x": 0.177, "y": 0.533 },{ "x": 0.113, "y": 0.361 },{ "x": 0.051, "y": 0.299 }]}, ])}, @@ -58,7 +58,7 @@ cameras = { {"coordinates": [{ "x": 0.064, "y": 0.311 },{ "x": 0.089, "y": 0.297 },{ "x": 0.210, "y": 0.410 },{ "x": 0.263, "y": 0.508 },{ "x": 0.344, "y": 0.863 },{ "x": 0.195, "y": 0.883 },{ "x": 0.177, "y": 0.533 },{ "x": 0.113, "y": 0.361 },{ "x": 0.051, "y": 0.299 }]}, ])} ], - "0307": [ + "0307_SanQuentin": [ {"name": "day", "path": "daytime.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.551, "y": 0.395 },{ "x": 0.568, "y": 0.391 },{ "x": 0.995, "y": 0.693 },{ "x": 0.996, "y": 0.794 }]}, {"coordinates": [{ "x": 0.448, "y": 0.379 },{ "x": 0.473, "y": 0.379 },{ "x": 0.661, "y": 0.908 },{ "x": 0.393, "y": 0.920 }]}, @@ -80,7 +80,7 @@ cameras = { ])} ], - "0308": [ + "0308_SanQuentin": [ {"name": "day", "path": "daytime.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.713, "y": 0.327 },{ "x": 0.741, "y": 0.324 },{ "x": 0.709, "y": 0.914 },{ "x": 0.483, "y": 0.913 }]}, @@ -89,7 +89,7 @@ cameras = { {"coordinates": [{ "x": 0.713, "y": 0.327 },{ "x": 0.741, "y": 0.324 },{ "x": 0.709, "y": 0.914 },{ "x": 0.483, "y": 0.913 }]}, ])}, - {"name": "foggy day", "path": "foggy_day.jpg", "roi": json.dumps([ + {"name": "foggy day (Vehicle on the side)", "path": "foggy_day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.713, "y": 0.327 },{ "x": 0.741, "y": 0.324 },{ "x": 0.709, "y": 0.914 },{ "x": 0.483, "y": 0.913 }]}, ])}, @@ -97,7 +97,7 @@ cameras = { {"coordinates": [{ "x": 0.713, "y": 0.327 },{ "x": 0.741, "y": 0.324 },{ "x": 0.709, "y": 0.914 },{ "x": 0.483, "y": 0.913 }]}, ])} ], - "0309": [ + "0309_SanQuentin": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.678, "y": 0.411 },{ "x": 0.696, "y": 0.407 },{ "x": 0.718, "y": 0.915 },{ "x": 0.438, "y": 0.917 }]}, @@ -111,7 +111,7 @@ cameras = { ])} ], - "0310": [ + "0310_SanQuentin": [ {"name": "day", "path": "daytime.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.682, "y": 0.458 },{ "x": 0.700, "y": 0.454 },{ "x": 0.729, "y": 0.907 },{ "x": 0.466, "y": 0.909 }]}, @@ -125,7 +125,7 @@ cameras = { ])} ], - "0313": [ + "0313_SanQuentin": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.656, "y": 0.283 },{ "x": 0.674, "y": 0.285 },{ "x": 0.675, "y": 0.913 },{ "x": 0.328, "y": 0.912 }]}, @@ -143,33 +143,33 @@ cameras = { ])}, ], - "0317": [ - {"name": "day", "path": "daytime_4.jpg", "roi": json.dumps([ + "0317_SanQuentin": [ + {"name": "day (vehicle on the side)", "path": "daytime_4.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.539, "y": 0.461 },{ "x": 0.569, "y": 0.457 },{ "x": 0.578, "y": 0.913 },{ "x": 0.322, "y": 0.913 }]}, ])}, - {"name": "day", "path": "daytime_5.jpg", "roi": json.dumps([ + {"name": "day (vehicle on the side)", "path": "daytime_5.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.539, "y": 0.461 },{ "x": 0.569, "y": 0.457 },{ "x": 0.578, "y": 0.913 },{ "x": 0.322, "y": 0.913 }]}, ])}, - {"name": "day", "path": "daytime_2.jpg", "roi": json.dumps([ + {"name": "day (vehicle on the side)", "path": "daytime_2.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.539, "y": 0.461 },{ "x": 0.569, "y": 0.457 },{ "x": 0.578, "y": 0.913 },{ "x": 0.322, "y": 0.913 }]}, ])}, - {"name": "evening", "path": "evening_2.jpg", "roi": json.dumps([ + {"name": "evening (vehicle on the side)", "path": "evening_2.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.539, "y": 0.461 },{ "x": 0.569, "y": 0.457 },{ "x": 0.578, "y": 0.913 },{ "x": 0.322, "y": 0.913 }]}, ])}, - {"name": "evening", "path": "eve.jpg", "roi": json.dumps([ + {"name": "evening (vehicle on the side)", "path": "eve.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.539, "y": 0.461 },{ "x": 0.569, "y": 0.457 },{ "x": 0.578, "y": 0.913 },{ "x": 0.322, "y": 0.913 }]}, ])}, - {"name": "night", "path": "night_2.jpg", "roi": json.dumps([ + {"name": "night (vehicle on the side)", "path": "night_2.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.539, "y": 0.461 },{ "x": 0.569, "y": 0.457 },{ "x": 0.578, "y": 0.913 },{ "x": 0.322, "y": 0.913 }]}, ])}, ], - "0321": [ + "0321_SanQuentin": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.647, "y": 0.297 },{ "x": 0.682, "y": 0.301 },{ "x": 0.704, "y": 0.903 },{ "x": 0.346, "y": 0.919 }]}, @@ -178,12 +178,12 @@ cameras = { {"coordinates": [{ "x": 0.647, "y": 0.297 },{ "x": 0.682, "y": 0.301 },{ "x": 0.704, "y": 0.903 },{ "x": 0.346, "y": 0.919 }]}, ])}, - {"name": "night", "path": "night.jpg", "roi": json.dumps([ + {"name": "night (vehicle on the side)", "path": "night.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.647, "y": 0.297 },{ "x": 0.682, "y": 0.301 },{ "x": 0.704, "y": 0.903 },{ "x": 0.346, "y": 0.919 }]}, ])} ], - "0322": [ + "0322_SanQuentin": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.672, "y": 0.421 },{ "x": 0.696, "y": 0.421 },{ "x": 0.660, "y": 0.914 },{ "x": 0.418, "y": 0.913 }]}, @@ -197,7 +197,7 @@ cameras = { ])}, ], - "0327": [ + "0327_SanQuentin": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.560, "y": 0.481 },{ "x": 0.619, "y": 0.486 },{ "x": 0.572, "y": 0.920 },{ "x": 0.433, "y": 0.916 }]}, {"coordinates": [{ "x": 0.357, "y": 0.266 },{ "x": 0.368, "y": 0.280 },{ "x": 0.002, "y": 0.611 },{ "x": 0.001, "y": 0.559 }]}, @@ -214,7 +214,7 @@ cameras = { ])}, ], - "0468": [ + "0468_Novato": [ {"name": "day", "path": "daytime.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.997, "y": 0.433 },{ "x": 0.929, "y": 0.481 },{ "x": 0.902, "y": 0.523 },{ "x": 0.906, "y": 0.566 },{ "x": 0.997, "y": 0.651 }]}, {"coordinates": [{ "x": 0.172, "y": 0.582 },{ "x": 0.273, "y": 0.587 },{ "x": 0.261, "y": 0.920 },{ "x": 0.097, "y": 0.918 }]}, @@ -236,7 +236,7 @@ cameras = { ])}, ], - "0483": [ + "0483_Petaluma": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.582, "y": 0.561 },{ "x": 0.592, "y": 0.563 },{ "x": 0.664, "y": 0.614 },{ "x": 0.773, "y": 0.744 },{ "x": 0.871, "y": 0.916 },{ "x": 0.791, "y": 0.923 }]}, @@ -250,7 +250,7 @@ cameras = { ])}, ], - "0548": [ + "0548_SanRafael": [ {"name": "day", "path": "day2.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.709, "y": 0.347 },{ "x": 0.746, "y": 0.347 },{ "x": 0.695, "y": 0.912 },{ "x": 0.553, "y": 0.909 }]}, {"coordinates": [{ "x": 0.440, "y": 0.363 },{ "x": 0.456, "y": 0.371 },{ "x": 0.013, "y": 0.708 },{ "x": 0.002, "y": 0.668 }]}, @@ -262,13 +262,13 @@ cameras = { ])} ], - "0566": [ + "0566_Sausalito": [ {"name": "day", "path": "day.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.643, "y": 0.267 },{ "x": 0.707, "y": 0.289 },{ "x": 0.615, "y": 0.635 },{ "x": 0.448, "y": 0.669 }]}, ])} ], - "0569": [ + "0569_Novato": [ {"name": "day", "path": "evening.jpg", "roi": json.dumps([ {"coordinates": [{ "x": 0.399, "y": 0.615 },{ "x": 0.307, "y": 0.643 },{ "x": 0.282, "y": 0.669 },{ "x": 0.300, "y": 0.712 },{ "x": 0.369, "y": 0.754 },{ "x": 0.551, "y": 0.840 },{ "x": 0.670, "y": 0.921 },{ "x": 0.815, "y": 0.918 },{ "x": 0.555, "y": 0.789 },{ "x": 0.415, "y": 0.721 },{ "x": 0.364, "y": 0.663 },{ "x": 0.422, "y": 0.621 }]}, @@ -314,9 +314,6 @@ names= [ 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', ' 'hair drier', 'toothbrush' ] desired_classes = ['person', 'bicycle', 'car', 'motorcycle', 'bus', 'train', 'truck'] desired_indices = [names.index(cls) for cls in desired_classes if cls in names] -print(desired_indices) - - def detect(img, model, rois): if img is None: @@ -355,7 +352,8 @@ def detect(img, model, rois): for roi in rois_data: roi_points = [(int(coord['x'] * im0.shape[1]), int(coord['y'] * im0.shape[0])) for coord in roi['coordinates']] roi_points_list.append(roi_points) - cv2.polylines(im0, [np.array(roi_points)], isClosed=True, color=(0, 255, 0), thickness=2) + # Initially set ROI color to red + cv2.polylines(im0, [np.array(roi_points)], isClosed=True, color=(0, 0, 255), thickness=2) for i, det in enumerate(pred): p, s, im0 = path, '', im0s @@ -375,17 +373,20 @@ def detect(img, model, rois): for roi_points in roi_points_list: if cv2.pointPolygonTest(np.array(roi_points, dtype=np.float32), (x_center, y_center), False) >= 0: inside_roi = True + # Change ROI color to green if a car is detected inside + cv2.polylines(im0, [np.array(roi_points)], isClosed=True, color=(0, 255, 0), thickness=2) break filtered_detections.append((*xyxy, conf, cls, inside_roi)) # Plot the detections with the desired color for *xyxy, conf, cls, inside_roi in filtered_detections: - color = (0, 255, 0) if inside_roi else (0, 0, 255) # green for inside ROI, red for outside + # Set bbox color to blue + color = (255, 0, 0) label = f'{names[int(cls)]} {conf:.2f}' plot_one_box(xyxy, im0, label=label, color=color, line_thickness=1) - return Image.fromarray(im0[:,:,::-1]) + return Image.fromarray(im0[:,:,::-1]) def get_dropdown_choices(): choices = [] @@ -425,7 +426,9 @@ iface = gr.Interface( ], live=True, title="Vehicle Detection on Roadside", - description="Select a camera and image to view vehicle detection results." + description = ("Navigating through the intricate pathways of roadside vehicle detection, " + "the system identifies and analyzes vehicles using advanced detection algorithms.\n\n" + "Select a Camera and Image to Dive Into the Analysis") ) iface.launch() diff --git a/models/__pycache__/__init__.cpython-310.pyc b/models/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fcc488a54f91935036d90d9eca19512da06ab705 Binary files /dev/null and b/models/__pycache__/__init__.cpython-310.pyc differ diff --git a/models/__pycache__/common.cpython-310.pyc b/models/__pycache__/common.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1cef5eddfb443251f826ca3062881a25f52bc6a1 Binary files /dev/null and b/models/__pycache__/common.cpython-310.pyc differ diff --git a/models/__pycache__/experimental.cpython-310.pyc b/models/__pycache__/experimental.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0dc69d0652ec7152c8194869c3daa4a6da80cf0 Binary files /dev/null and b/models/__pycache__/experimental.cpython-310.pyc differ diff --git a/models/__pycache__/yolo.cpython-310.pyc b/models/__pycache__/yolo.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e51a6cfcf093ef7871914790ecc57cd7dbc3c1d Binary files /dev/null and b/models/__pycache__/yolo.cpython-310.pyc differ diff --git a/utils/__pycache__/__init__.cpython-310.pyc b/utils/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6337d3ecc57636ab52ffa2fba34f3f0b4a405d95 Binary files /dev/null and b/utils/__pycache__/__init__.cpython-310.pyc differ diff --git a/utils/__pycache__/autoanchor.cpython-310.pyc b/utils/__pycache__/autoanchor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dabc9543d645dc1161b9226ae573f8afbb7884d8 Binary files /dev/null and b/utils/__pycache__/autoanchor.cpython-310.pyc differ diff --git a/utils/__pycache__/datasets.cpython-310.pyc b/utils/__pycache__/datasets.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fd7a66e49cdb59c856bd520f038fad792e447dc Binary files /dev/null and b/utils/__pycache__/datasets.cpython-310.pyc differ diff --git a/utils/__pycache__/general.cpython-310.pyc b/utils/__pycache__/general.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba386c98293e360fe0fc4773ed18dc2a610fbbf2 Binary files /dev/null and b/utils/__pycache__/general.cpython-310.pyc differ diff --git a/utils/__pycache__/google_utils.cpython-310.pyc b/utils/__pycache__/google_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ad5c72ed12a37fee28091a606627f74cea2f42b Binary files /dev/null and b/utils/__pycache__/google_utils.cpython-310.pyc differ diff --git a/utils/__pycache__/loss.cpython-310.pyc b/utils/__pycache__/loss.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..809e75b5604a98df402787d0d04fabb5c2c184f3 Binary files /dev/null and b/utils/__pycache__/loss.cpython-310.pyc differ diff --git a/utils/__pycache__/metrics.cpython-310.pyc b/utils/__pycache__/metrics.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3867bb500c656067d914ef32adbef4bdf7d83e67 Binary files /dev/null and b/utils/__pycache__/metrics.cpython-310.pyc differ diff --git a/utils/__pycache__/plots.cpython-310.pyc b/utils/__pycache__/plots.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b830fa585813cd72ad3286d854ea74f2743bb6bf Binary files /dev/null and b/utils/__pycache__/plots.cpython-310.pyc differ diff --git a/utils/__pycache__/torch_utils.cpython-310.pyc b/utils/__pycache__/torch_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96f24b9c06728bdbcbf7a398e091fa9573d99681 Binary files /dev/null and b/utils/__pycache__/torch_utils.cpython-310.pyc differ