File size: 25,865 Bytes
98d05b6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7vLYqOipDn7J",
"outputId": "d0995580-9b7a-40cd-8147-7fdf58f148fe"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Cloning into 'Smart-Traffic'...\n",
"remote: Enumerating objects: 12, done.\u001b[K\n",
"remote: Counting objects: 100% (9/9), done.\u001b[K\n",
"remote: Compressing objects: 100% (9/9), done.\u001b[K\n",
"remote: Total 12 (delta 2), reused 0 (delta 0), pack-reused 3\u001b[K\n",
"Unpacking objects: 100% (12/12), 199.01 KiB | 939.00 KiB/s, done.\n",
"Filtering content: 100% (2/2), 57.18 MiB | 19.07 MiB/s, done.\n"
]
}
],
"source": [
"!git clone https://huggingface.co/ottoykh/Smart-Traffic"
]
},
{
"cell_type": "code",
"source": [
"!pip install ultralytics"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ku7viwceDrF-",
"outputId": "b6246bc3-2849-4c1e-f6bc-b3bc7860bf78"
},
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting ultralytics\n",
" Downloading ultralytics-8.1.18-py3-none-any.whl (716 kB)\n",
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m716.0/716.0 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: matplotlib>=3.3.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (3.7.1)\n",
"Requirement already satisfied: opencv-python>=4.6.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (4.8.0.76)\n",
"Requirement already satisfied: pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (9.4.0)\n",
"Requirement already satisfied: pyyaml>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (6.0.1)\n",
"Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (2.31.0)\n",
"Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (1.11.4)\n",
"Requirement already satisfied: torch>=1.8.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (2.1.0+cu121)\n",
"Requirement already satisfied: torchvision>=0.9.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (0.16.0+cu121)\n",
"Requirement already satisfied: tqdm>=4.64.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (4.66.2)\n",
"Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from ultralytics) (5.9.5)\n",
"Requirement already satisfied: py-cpuinfo in /usr/local/lib/python3.10/dist-packages (from ultralytics) (9.0.0)\n",
"Collecting thop>=0.1.1 (from ultralytics)\n",
" Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n",
"Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (1.5.3)\n",
"Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from ultralytics) (0.13.1)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (1.2.0)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (0.12.1)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (4.49.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (1.4.5)\n",
"Requirement already satisfied: numpy>=1.20 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (1.25.2)\n",
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (23.2)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (3.1.1)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.0->ultralytics) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->ultralytics) (2023.4)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->ultralytics) (3.3.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->ultralytics) (3.6)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->ultralytics) (2.0.7)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->ultralytics) (2024.2.2)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (3.13.1)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (4.9.0)\n",
"Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (1.12)\n",
"Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (3.2.1)\n",
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (3.1.3)\n",
"Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (2023.6.0)\n",
"Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.0->ultralytics) (2.1.0)\n",
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib>=3.3.0->ultralytics) (1.16.0)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.8.0->ultralytics) (2.1.5)\n",
"Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.8.0->ultralytics) (1.3.0)\n",
"Installing collected packages: thop, ultralytics\n",
"Successfully installed thop-0.1.1.post2209072238 ultralytics-8.1.18\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"from ultralytics import YOLO\n",
"\n",
"from IPython.display import display, Image\n",
"import requests\n",
"from PIL import Image\n",
"import time\n",
"import datetime\n",
"import os"
],
"metadata": {
"id": "tjNmyigvEPut"
},
"execution_count": 5,
"outputs": []
},
{
"cell_type": "code",
"source": [
"image_urls = [\n",
" \"https://tdcctv.data.one.gov.hk/AID01217.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01216.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01215.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01214.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01213.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01212.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01211.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01210.JPG\",\n",
" \"https://tdcctv.data.one.gov.hk/AID01209.JPG\"\n",
"]\n"
],
"metadata": {
"id": "NxP8UKN4EUh3"
},
"execution_count": 14,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import pytz\n",
"from urllib.parse import urlparse\n",
"import json\n",
"\n",
"hong_kong_timezone = pytz.timezone('Asia/Hong_Kong')\n",
"\n",
"while True:\n",
" current_time = datetime.datetime.now(tz=hong_kong_timezone).strftime(\"%Y%m%d%H%M%S\")\n",
" folder_name = f\"/content/{current_time}\"\n",
" print(folder_name)\n",
" os.makedirs(folder_name, exist_ok=True)\n",
"\n",
" for image_url in image_urls:\n",
" response = requests.get(image_url)\n",
" image_data = response.content\n",
" parsed_url = urlparse(image_url)\n",
" image_name = os.path.basename(parsed_url.path)\n",
" file_name = os.path.join(folder_name, image_name)\n",
" with open(file_name, \"wb\") as file:\n",
" file.write(image_data)\n",
" print(file_name)\n",
" folder_name_formatted = f\"'{folder_name}'\"\n",
"\n",
" !yolo task=segment mode=predict model='/content/Smart-Traffic/best.pt' conf=0.45 source={folder_name_formatted} save=true save_txt=true\n",
"\n",
" time.sleep(120)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "iNxB2wbrEa5q",
"outputId": "7854ac0b-c652-4660-bd03-356bc0cbff0c"
},
"execution_count": 19,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/20240223165431\n",
"/content/20240223165431/AID01217.JPG\n",
"/content/20240223165431/AID01216.JPG\n",
"/content/20240223165431/AID01215.JPG\n",
"/content/20240223165431/AID01214.JPG\n",
"/content/20240223165431/AID01213.JPG\n",
"/content/20240223165431/AID01212.JPG\n",
"/content/20240223165431/AID01211.JPG\n",
"/content/20240223165431/AID01210.JPG\n",
"/content/20240223165431/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223165431/AID01209.JPG: 480x640 (no detections), 750.7ms\n",
"image 2/9 /content/20240223165431/AID01210.JPG: 480x640 2 Private-cars, 813.9ms\n",
"image 3/9 /content/20240223165431/AID01211.JPG: 480x640 1 Minibus, 3 Private-cars, 1039.4ms\n",
"image 4/9 /content/20240223165431/AID01212.JPG: 480x640 (no detections), 996.6ms\n",
"image 5/9 /content/20240223165431/AID01213.JPG: 480x640 1 Bus, 2 Private-cars, 1 Taxi, 652.4ms\n",
"image 6/9 /content/20240223165431/AID01214.JPG: 480x640 2 Private-cars, 2 Taxis, 1 Truck, 661.9ms\n",
"image 7/9 /content/20240223165431/AID01215.JPG: 480x640 2 Private-cars, 1 Taxi, 626.7ms\n",
"image 8/9 /content/20240223165431/AID01216.JPG: 480x640 1 Minibus, 5 Private-cars, 639.9ms\n",
"image 9/9 /content/20240223165431/AID01217.JPG: 480x640 3 Private-cars, 619.7ms\n",
"Speed: 3.2ms preprocess, 755.7ms inference, 13.1ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict4\u001b[0m\n",
"7 labels saved to runs/segment/predict4/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n",
"/content/20240223165647\n",
"/content/20240223165647/AID01217.JPG\n",
"/content/20240223165647/AID01216.JPG\n",
"/content/20240223165647/AID01215.JPG\n",
"/content/20240223165647/AID01214.JPG\n",
"/content/20240223165647/AID01213.JPG\n",
"/content/20240223165647/AID01212.JPG\n",
"/content/20240223165647/AID01211.JPG\n",
"/content/20240223165647/AID01210.JPG\n",
"/content/20240223165647/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223165647/AID01209.JPG: 480x640 2 Private-cars, 1 Taxi, 733.2ms\n",
"image 2/9 /content/20240223165647/AID01210.JPG: 480x640 2 Private-cars, 628.8ms\n",
"image 3/9 /content/20240223165647/AID01211.JPG: 480x640 (no detections), 648.8ms\n",
"image 4/9 /content/20240223165647/AID01212.JPG: 480x640 2 Private-cars, 1 Taxi, 650.8ms\n",
"image 5/9 /content/20240223165647/AID01213.JPG: 480x640 4 Private-cars, 1 Truck, 642.1ms\n",
"image 6/9 /content/20240223165647/AID01214.JPG: 480x640 1 Bus, 3 Private-cars, 625.7ms\n",
"image 7/9 /content/20240223165647/AID01215.JPG: 480x640 4 Private-cars, 1 Truck, 839.4ms\n",
"image 8/9 /content/20240223165647/AID01216.JPG: 480x640 2 Private-cars, 995.4ms\n",
"image 9/9 /content/20240223165647/AID01217.JPG: 480x640 4 Private-cars, 970.9ms\n",
"Speed: 3.2ms preprocess, 748.4ms inference, 12.3ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict5\u001b[0m\n",
"8 labels saved to runs/segment/predict5/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n",
"/content/20240223165903\n",
"/content/20240223165903/AID01217.JPG\n",
"/content/20240223165903/AID01216.JPG\n",
"/content/20240223165903/AID01215.JPG\n",
"/content/20240223165903/AID01214.JPG\n",
"/content/20240223165903/AID01213.JPG\n",
"/content/20240223165903/AID01212.JPG\n",
"/content/20240223165903/AID01211.JPG\n",
"/content/20240223165903/AID01210.JPG\n",
"/content/20240223165903/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223165903/AID01209.JPG: 480x640 2 Private-cars, 1 Taxi, 755.6ms\n",
"image 2/9 /content/20240223165903/AID01210.JPG: 480x640 1 Bus, 3 Private-cars, 649.8ms\n",
"image 3/9 /content/20240223165903/AID01211.JPG: 480x640 (no detections), 627.9ms\n",
"image 4/9 /content/20240223165903/AID01212.JPG: 480x640 2 Private-cars, 1 Taxi, 639.2ms\n",
"image 5/9 /content/20240223165903/AID01213.JPG: 480x640 4 Private-cars, 1 Truck, 662.7ms\n",
"image 6/9 /content/20240223165903/AID01214.JPG: 480x640 1 Bus, 3 Private-cars, 632.2ms\n",
"image 7/9 /content/20240223165903/AID01215.JPG: 480x640 4 Private-cars, 1 Truck, 612.9ms\n",
"image 8/9 /content/20240223165903/AID01216.JPG: 480x640 2 Private-cars, 638.8ms\n",
"image 9/9 /content/20240223165903/AID01217.JPG: 480x640 4 Private-cars, 623.8ms\n",
"Speed: 3.0ms preprocess, 649.2ms inference, 11.9ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict6\u001b[0m\n",
"8 labels saved to runs/segment/predict6/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n",
"/content/20240223170118\n",
"/content/20240223170118/AID01217.JPG\n",
"/content/20240223170118/AID01216.JPG\n",
"/content/20240223170118/AID01215.JPG\n",
"/content/20240223170118/AID01214.JPG\n",
"/content/20240223170118/AID01213.JPG\n",
"/content/20240223170118/AID01212.JPG\n",
"/content/20240223170118/AID01211.JPG\n",
"/content/20240223170118/AID01210.JPG\n",
"/content/20240223170118/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223170118/AID01209.JPG: 480x640 1 Bus, 1 Taxi, 807.7ms\n",
"image 2/9 /content/20240223170118/AID01210.JPG: 480x640 3 Private-cars, 668.4ms\n",
"image 3/9 /content/20240223170118/AID01211.JPG: 480x640 (no detections), 654.9ms\n",
"image 4/9 /content/20240223170118/AID01212.JPG: 480x640 2 Private-cars, 1 Taxi, 660.6ms\n",
"image 5/9 /content/20240223170118/AID01213.JPG: 480x640 1 Bus, 2 Private-cars, 659.2ms\n",
"image 6/9 /content/20240223170118/AID01214.JPG: 480x640 1 Minibus, 6 Private-cars, 1 Taxi, 642.2ms\n",
"image 7/9 /content/20240223170118/AID01215.JPG: 480x640 3 Private-cars, 620.5ms\n",
"image 8/9 /content/20240223170118/AID01216.JPG: 480x640 4 Private-cars, 1 Taxi, 634.2ms\n",
"image 9/9 /content/20240223170118/AID01217.JPG: 480x640 2 Private-cars, 1 Taxi, 607.3ms\n",
"Speed: 3.9ms preprocess, 661.7ms inference, 14.4ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict7\u001b[0m\n",
"8 labels saved to runs/segment/predict7/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n",
"/content/20240223170334\n",
"/content/20240223170334/AID01217.JPG\n",
"/content/20240223170334/AID01216.JPG\n",
"/content/20240223170334/AID01215.JPG\n",
"/content/20240223170334/AID01214.JPG\n",
"/content/20240223170334/AID01213.JPG\n",
"/content/20240223170334/AID01212.JPG\n",
"/content/20240223170334/AID01211.JPG\n",
"/content/20240223170334/AID01210.JPG\n",
"/content/20240223170334/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223170334/AID01209.JPG: 480x640 7 Private-cars, 1 Taxi, 1209.1ms\n",
"image 2/9 /content/20240223170334/AID01210.JPG: 480x640 (no detections), 643.8ms\n",
"image 3/9 /content/20240223170334/AID01211.JPG: 480x640 1 Private-car, 615.6ms\n",
"image 4/9 /content/20240223170334/AID01212.JPG: 480x640 2 Private-cars, 1 Taxi, 625.5ms\n",
"image 5/9 /content/20240223170334/AID01213.JPG: 480x640 1 Taxi, 628.4ms\n",
"image 6/9 /content/20240223170334/AID01214.JPG: 480x640 1 Private-car, 1 Taxi, 616.1ms\n",
"image 7/9 /content/20240223170334/AID01215.JPG: 480x640 2 Private-cars, 623.7ms\n",
"image 8/9 /content/20240223170334/AID01216.JPG: 480x640 1 Bus, 611.1ms\n",
"image 9/9 /content/20240223170334/AID01217.JPG: 480x640 1 Private-car, 630.6ms\n",
"Speed: 3.1ms preprocess, 689.3ms inference, 9.7ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict8\u001b[0m\n",
"8 labels saved to runs/segment/predict8/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n",
"/content/20240223170552\n",
"/content/20240223170552/AID01217.JPG\n",
"/content/20240223170552/AID01216.JPG\n",
"/content/20240223170552/AID01215.JPG\n",
"/content/20240223170552/AID01214.JPG\n",
"/content/20240223170552/AID01213.JPG\n",
"/content/20240223170552/AID01212.JPG\n",
"/content/20240223170552/AID01211.JPG\n",
"/content/20240223170552/AID01210.JPG\n",
"/content/20240223170552/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223170552/AID01209.JPG: 480x640 7 Private-cars, 1 Taxi, 892.9ms\n",
"image 2/9 /content/20240223170552/AID01210.JPG: 480x640 2 Private-cars, 974.9ms\n",
"image 3/9 /content/20240223170552/AID01211.JPG: 480x640 4 Private-cars, 976.1ms\n",
"image 4/9 /content/20240223170552/AID01212.JPG: 480x640 4 Private-cars, 1 Taxi, 612.6ms\n",
"image 5/9 /content/20240223170552/AID01213.JPG: 480x640 2 Private-cars, 1 Taxi, 614.1ms\n",
"image 6/9 /content/20240223170552/AID01214.JPG: 480x640 1 Minibus, 6 Private-cars, 1 Taxi, 609.9ms\n",
"image 7/9 /content/20240223170552/AID01215.JPG: 480x640 2 Private-cars, 621.7ms\n",
"image 8/9 /content/20240223170552/AID01216.JPG: 480x640 (no detections), 624.3ms\n",
"image 9/9 /content/20240223170552/AID01217.JPG: 480x640 2 Private-cars, 605.0ms\n",
"Speed: 3.4ms preprocess, 725.7ms inference, 15.1ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict9\u001b[0m\n",
"8 labels saved to runs/segment/predict9/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n",
"/content/20240223170810\n",
"/content/20240223170810/AID01217.JPG\n",
"/content/20240223170810/AID01216.JPG\n",
"/content/20240223170810/AID01215.JPG\n",
"/content/20240223170810/AID01214.JPG\n",
"/content/20240223170810/AID01213.JPG\n",
"/content/20240223170810/AID01212.JPG\n",
"/content/20240223170810/AID01211.JPG\n",
"/content/20240223170810/AID01210.JPG\n",
"/content/20240223170810/AID01209.JPG\n",
"Ultralytics YOLOv8.1.18 π Python-3.10.12 torch-2.1.0+cu121 CPU (Intel Xeon 2.20GHz)\n",
"YOLOv8s-seg summary (fused): 195 layers, 11782309 parameters, 0 gradients, 42.5 GFLOPs\n",
"\n",
"image 1/9 /content/20240223170810/AID01209.JPG: 480x640 1 Minibus, 4 Private-cars, 1 Taxi, 746.6ms\n",
"image 2/9 /content/20240223170810/AID01210.JPG: 480x640 2 Private-cars, 624.7ms\n",
"image 3/9 /content/20240223170810/AID01211.JPG: 480x640 4 Private-cars, 639.6ms\n",
"image 4/9 /content/20240223170810/AID01212.JPG: 480x640 4 Private-cars, 1 Taxi, 828.6ms\n",
"image 5/9 /content/20240223170810/AID01213.JPG: 480x640 2 Private-cars, 1 Taxi, 987.7ms\n",
"image 6/9 /content/20240223170810/AID01214.JPG: 480x640 2 Private-cars, 1 Taxi, 975.8ms\n",
"image 7/9 /content/20240223170810/AID01215.JPG: 480x640 1 Minibus, 2 Private-cars, 1 Taxi, 629.0ms\n",
"image 8/9 /content/20240223170810/AID01216.JPG: 480x640 (no detections), 618.1ms\n",
"image 9/9 /content/20240223170810/AID01217.JPG: 480x640 2 Private-cars, 639.6ms\n",
"Speed: 3.1ms preprocess, 743.3ms inference, 13.4ms postprocess per image at shape (1, 3, 480, 640)\n",
"Results saved to \u001b[1mruns/segment/predict10\u001b[0m\n",
"8 labels saved to runs/segment/predict10/labels\n",
"π‘ Learn more at https://docs.ultralytics.com/modes/predict\n"
]
},
{
"output_type": "error",
"ename": "KeyboardInterrupt",
"evalue": "",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-19-eb142f4ed618>\u001b[0m in \u001b[0;36m<cell line: 7>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0mget_ipython\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msystem\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"yolo task=segment mode=predict model='/content/Smart-Traffic/best.pt' conf=0.45 source={folder_name_formatted} save=true save_txt=true\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 26\u001b[0;31m \u001b[0mtime\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m120\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
]
}
]
} |