diff --git a/notebooks/how-to-count-the-objects-using-ultralytics-yolo.ipynb b/notebooks/how-to-count-the-objects-using-ultralytics-yolo.ipynb index 1eef696..2f9aca3 100644 --- a/notebooks/how-to-count-the-objects-using-ultralytics-yolo.ipynb +++ b/notebooks/how-to-count-the-objects-using-ultralytics-yolo.ipynb @@ -1,225 +1,224 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [], - "toc_visible": true - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "accelerator": "GPU" + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "toc_visible": true }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - " \n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Object counting using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Object Counting using Ultralytics YOLO11\n", - "\n", - "This notebook serves as a starting point for [counting objects](https://docs.ultralytics.com/guides/object-counting/) in videos or live streams using the YOLO11 model.\n", - "\n", - "### What is Object Counting?\n", - "\n", - "- Object counting with YOLO11 involves accurate identification and counting of specific objects in videos and camera streams. YOLO11 excels in real-time applications, providing efficient and precise object counting for various scenarios like crowd analysis and surveillance, thanks to its state-of-the-art algorithms and deep learning capabilities.\n", - "\n", - "### Advantages of Object Counting?\n", - "\n", - "- **Resource Optimization**: Object counting facilitates efficient resource management by providing accurate counts, and optimizing resource allocation in applications like inventory management.\n", - "- **Enhanced Security**: Object counting enhances security and surveillance by accurately tracking and counting entities, aiding in proactive threat detection.\n", - "- **Informed Decision-Making**: Object counting offers valuable insights for decision-making, optimizing processes in retail, traffic management, and various other domains." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "### Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG" - }, - "source": [ - "!pip install ultralytics\n", - "\n", - "import ultralytics\n", - "import cv2\n", - "from ultralytics.utils.downloads import safe_download\n", - "from ultralytics import solutions\n", - "\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Read the Video File\n", - "\n", - "- You can either read the video file directly or stream the content from an RTSP (Real-Time Streaming Protocol) source, allowing for flexible video input depending on your needs.\n", - "- We will also set up the video writer to handle the output video writing." - ], - "metadata": { - "id": "h8go3HNgN0WU" - } - }, - { - "cell_type": "code", - "source": [ - "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/solutions-ci-demo.mp4\")\n", - "cap = cv2.VideoCapture(\"solutions-ci-demo.mp4\")\n", - - "assert cap.isOpened(), \"Error reading video file\"\n", - "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,\n", - " cv2.CAP_PROP_FRAME_HEIGHT,\n", - " cv2.CAP_PROP_FPS))\n", - "\n", - "# Video writer\n", - "video_writer = cv2.VideoWriter(\"counting.avi\",\n", - " cv2.VideoWriter_fourcc(*\"mp4v\"),\n", - " fps, (w, h))" - ], - "metadata": { - "id": "QUgMYUvlNLvy" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Define Region Coordinates\n", - "\n", - "Here, we set the coordinates for specific regions to ensure accurate object tracking and analysis within the video or stream. This helps monitor and count objects effectively in different areas." - ], - "metadata": { - "id": "3wJlBXORXNsj" - } - }, - { - "cell_type": "code", - "source": [ - "# Define region points\n", - "# region_points = [(20, 400), (1080, 400)] # For line counting\n", - "region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)] # For rectangle region counting\n", - "# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360), (20, 400)] # For polygon region counting" - ], - "metadata": { - "id": "bVCrrForXRgS" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Initialize the ObjectCounter Class\n", - "\n", - "- Now, let's initialize the `ObjectCounter` class to track and count objects in each frame of the video." - ], - "metadata": { - "id": "rt3soEHzXe8c" - } - }, - { - "cell_type": "code", - "source": [ - "# Init ObjectCounter\n", - "counter = solutions.ObjectCounter(\n", - " show=True, # Display the output\n", - " region=region_points, # Pass region points\n", - " model=\"yolo11n.pt\", # model=\"yolo11n-obb.pt\" for object counting using YOLO11 OBB model.\n", - " # classes=[0, 2], # If you want to count specific classes i.e person and car with COCO pretrained model.\n", - " # show_in=True, # Display in counts\n", - " # show_out=True, # Display out counts\n", - " # line_width=2, # Adjust the line width for bounding boxes and text display\n", - ")" - ], - "metadata": { - "id": "Va24DpUZXTh3" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Process Video Frames\n", - "\n", - "In this step, we will process each frame of the video to detect and analyze objects. This allows for real-time tracking and counting, based on the visual data in the frames." - ], - "metadata": { - "id": "1ewYRFFqXvtj" - } - }, - { - "cell_type": "code", - "source": [ - "# Process video\n", - "while cap.isOpened():\n", - " success, im0 = cap.read()\n", - " if not success:\n", - " print(\"Video frame is empty or video processing has been successfully completed.\")\n", - " break\n", - " results = counter(im0) # count the objects\n", - " video_writer.write(results.plot_im) # write the video frames\n", - "\n", - "cap.release() # Release the capture\n", - "video_writer.release()" - ], - "metadata": { - "id": "PVf1pyRtXijz" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "![Fish Counting in the Sea Using Ultralytics YOLO11](https://github.com/ultralytics/docs/releases/download/0/conveyor-belt-packets-counting.avif)" - ], - "metadata": { - "id": "bWskbLSKH2S5" - } - }, -{ + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + " \n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Object counting using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Object Counting using Ultralytics YOLO11\n", + "\n", + "This notebook serves as a starting point for [counting objects](https://docs.ultralytics.com/guides/object-counting/) in videos or live streams using the YOLO11 model.\n", + "\n", + "### What is Object Counting?\n", + "\n", + "- Object counting with YOLO11 involves accurate identification and counting of specific objects in videos and camera streams. YOLO11 excels in real-time applications, providing efficient and precise object counting for various scenarios like crowd analysis and surveillance, thanks to its state-of-the-art algorithms and deep learning capabilities.\n", + "\n", + "### Advantages of Object Counting?\n", + "\n", + "- **Resource Optimization**: Object counting facilitates efficient resource management by providing accurate counts, and optimizing resource allocation in applications like inventory management.\n", + "- **Enhanced Security**: Object counting enhances security and surveillance by accurately tracking and counting entities, aiding in proactive threat detection.\n", + "- **Informed Decision-Making**: Object counting offers valuable insights for decision-making, optimizing processes in retail, traffic management, and various other domains." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "### Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG" + }, + "source": [ + "!uv pip install ultralytics\n", + "\n", + "import ultralytics\n", + "import cv2\n", + "from ultralytics.utils.downloads import safe_download\n", + "from ultralytics import solutions\n", + "\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Read the Video File\n", + "\n", + "- You can either read the video file directly or stream the content from an RTSP (Real-Time Streaming Protocol) source, allowing for flexible video input depending on your needs.\n", + "- We will also set up the video writer to handle the output video writing." + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "code", + "source": [ + "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/solutions-ci-demo.mp4\")\n", + "cap = cv2.VideoCapture(\"solutions-ci-demo.mp4\")\n", + "assert cap.isOpened(), \"Error reading video file\"\n", + "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,\n", + " cv2.CAP_PROP_FRAME_HEIGHT,\n", + " cv2.CAP_PROP_FPS))\n", + "\n", + "# Video writer\n", + "video_writer = cv2.VideoWriter(\"counting.avi\",\n", + " cv2.VideoWriter_fourcc(*\"mp4v\"),\n", + " fps, (w, h))" + ], + "metadata": { + "id": "QUgMYUvlNLvy" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Define Region Coordinates\n", + "\n", + "Here, we set the coordinates for specific regions to ensure accurate object tracking and analysis within the video or stream. This helps monitor and count objects effectively in different areas." + ], + "metadata": { + "id": "3wJlBXORXNsj" + } + }, + { + "cell_type": "code", + "source": [ + "# Define region points\n", + "# region_points = [(20, 400), (1080, 400)] # For line counting\n", + "region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)] # For rectangle region counting\n", + "# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360), (20, 400)] # For polygon region counting" + ], + "metadata": { + "id": "bVCrrForXRgS" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Initialize the ObjectCounter Class\n", + "\n", + "- Now, let's initialize the `ObjectCounter` class to track and count objects in each frame of the video." + ], + "metadata": { + "id": "rt3soEHzXe8c" + } + }, + { + "cell_type": "code", + "source": [ + "# Init ObjectCounter\n", + "counter = solutions.ObjectCounter(\n", + " show=True, # Display the output\n", + " region=region_points, # Pass region points\n", + " model=\"yolo11n.pt\", # model=\"yolo11n-obb.pt\" for object counting using YOLO11 OBB model.\n", + " # classes=[0, 2], # If you want to count specific classes i.e person and car with COCO pretrained model.\n", + " # show_in=True, # Display in counts\n", + " # show_out=True, # Display out counts\n", + " # line_width=2, # Adjust the line width for bounding boxes and text display\n", + ")" + ], + "metadata": { + "id": "Va24DpUZXTh3" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Process Video Frames\n", + "\n", + "In this step, we will process each frame of the video to detect and analyze objects. This allows for real-time tracking and counting, based on the visual data in the frames." + ], + "metadata": { + "id": "1ewYRFFqXvtj" + } + }, + { + "cell_type": "code", + "source": [ + "# Process video\n", + "while cap.isOpened():\n", + " success, im0 = cap.read()\n", + " if not success:\n", + " print(\"Video frame is empty or video processing has been successfully completed.\")\n", + " break\n", + " results = counter(im0) # count the objects\n", + " video_writer.write(results.plot_im) # write the video frames\n", + "\n", + "cap.release() # Release the capture\n", + "video_writer.release()" + ], + "metadata": { + "id": "PVf1pyRtXijz" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "![Fish Counting in the Sea Using Ultralytics YOLO11](https://github.com/ultralytics/docs/releases/download/0/conveyor-belt-packets-counting.avif)" + ], + "metadata": { + "id": "bWskbLSKH2S5" + } + }, + { "cell_type": "markdown", "metadata": { "id": "bwBUa5kZyZ2k" @@ -230,5 +229,5 @@ "🌟 Explore and star the [Ultralytics Notebooks](https://github.com/ultralytics/notebooks/) to supercharge your AI journey! 🚀" ] } - ] + ] } diff --git a/notebooks/how-to-export-the-validation-results-into-dataframe-csv-sql-and-other-formats.ipynb b/notebooks/how-to-export-the-validation-results-into-dataframe-csv-sql-and-other-formats.ipynb index 647e537..889505c 100644 --- a/notebooks/how-to-export-the-validation-results-into-dataframe-csv-sql-and-other-formats.ipynb +++ b/notebooks/how-to-export-the-validation-results-into-dataframe-csv-sql-and-other-formats.ipynb @@ -1,535 +1,535 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "MwKH62l2dYD5" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - " \n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Ultralytics YOLO models validation results exports in different formats notebook 🚀 Ultralytics YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "main-title" - }, - "source": [ - "# Ultralytics YOLO Model Validation and Results Export\n", - "\n", - "This notebook demonstrates how to validate a YOLO model and export the validation results in multiple formats including CSV, HTML, XML, SQL, and JSON. This is particularly useful for:\n", - "\n", - "- **Model Performance Analysis**: Get detailed metrics for each class i.e Precision, Recall, mAP.\n", - "- **Data Integration**: Export results to different formats for integration in the existing pipeline of the project." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "o-WxHpU1Y1en" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "dEXdyKGvYBcN", - "outputId": "fd669804-119a-45d3-e7a0-48400bddd404" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.160 🚀 Python-3.11.13 torch-2.6.0+cu124 CPU (Intel Xeon 2.20GHz)\n", - "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 41.8/107.7 GB disk)\n" - ] - } - ], - "source": [ - "%pip install ultralytics # Install Ultralytics YOLO package\n", - "\n", - "# Import and verify installation\n", - "import ultralytics\n", - "\n", - "ultralytics.checks()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "BS5DF2e4Y4R_" - }, - "source": [ - "## Model Validation\n", - "\n", - "Here we load a pre-trained YOLO11 nano model and validate it on the COCO8 dataset. The validation process evaluates the model's performance across different object classes and generates comprehensive metrics including:\n", - "\n", - "- **Precision:** Measures how many predicted positives are actually correct, minimizing false positives.\n", - "\n", - "- **Recall:** Measures how well the model captures actual positives, minimizing false negatives.\n", - "\n", - "- **F1-Score:** Harmonic mean of precision and recall, balancing precision-recall trade-offs.\n", - "\n", - "- **mAP (mean Average Precision):** Mean precision across classes and IoU thresholds, summarizing detection performance.\n", - "\n", - "- **Confusion Matrix:** Tabular summary of prediction results, highlighting class-wise errors and accuracy.\n", - "\n", - "💡 **Tip**: Replace `\"coco8.yaml\"` with your custom dataset configuration file if using a custom-trained model." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-2Y5WSONYW1A", - "outputId": "a6cb7448-312c-4bc0-ea3f-b8b8a5f958ac" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.160 🚀 Python-3.11.13 torch-2.6.0+cu124 CPU (Intel Xeon 2.20GHz)\n", - "YOLO11n summary (fused): 100 layers, 2,616,248 parameters, 0 gradients, 6.5 GFLOPs\n", - "\u001b[34m\u001b[1mval: \u001b[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 1009.2±368.9 MB/s, size: 54.0 KB)\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mScanning /content/datasets/coco8/labels/val.cache... 4 images, 0 backgrounds, 0 corrupt: 100%|██████████| 4/4 [00:00\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + " \n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Ultralytics YOLO models validation results exports in different formats notebook 🚀 Ultralytics YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "main-title" + }, + "source": [ + "# Ultralytics YOLO Model Validation and Results Export\n", + "\n", + "This notebook demonstrates how to validate a YOLO model and export the validation results in multiple formats including CSV, HTML, XML, SQL, and JSON. This is particularly useful for:\n", + "\n", + "- **Model Performance Analysis**: Get detailed metrics for each class i.e Precision, Recall, mAP.\n", + "- **Data Integration**: Export results to different formats for integration in the existing pipeline of the project." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "o-WxHpU1Y1en" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "dEXdyKGvYBcN", + "outputId": "fd669804-119a-45d3-e7a0-48400bddd404" + }, + "outputs": [ { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "hq_eJc_5a6w_", - "outputId": "5f731587-f09a-4e1a-be15-77ae1faaa809" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - ",Class,Images,Instances,Box-P,Box-R,Box-F1,mAP50,mAP50-95\n", - "0,person,3,10,0.55725,0.6,0.57783,0.58518,0.27239\n", - "1,dog,1,1,0.54802,1.0,0.70803,0.995,0.6965\n", - "2,horse,1,2,0.53058,1.0,0.69331,0.995,0.67398\n", - "3,elephant,1,2,0.37078,0.5,0.4258,0.51583,0.25634\n", - "4,umbrella,1,1,0.569,1.0,0.72531,0.995,0.995\n", - "5,potted plant,1,1,0.84718,1.0,0.91727,0.995,0.8955\n", - "\n" - ] - } - ], - "source": [ - "# Display results as CSV format\n", - "val_csv = metrics.to_csv()\n", - "print(val_csv)\n", - "\n", - "# Optionally save to file\n", - "csv_filename = \"validation_results.csv\"\n", - "with open(csv_filename, \"w\") as f:\n", - " f.write(val_csv)" - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.160 🚀 Python-3.11.13 torch-2.6.0+cu124 CPU (Intel Xeon 2.20GHz)\n", + "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 41.8/107.7 GB disk)\n" + ] + } + ], + "source": [ + "!uv pip install ultralytics # Install Ultralytics YOLO package\n", + "\n", + "# Import and verify installation\n", + "import ultralytics\n", + "\n", + "ultralytics.checks()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "BS5DF2e4Y4R_" + }, + "source": [ + "## Model Validation\n", + "\n", + "Here we load a pre-trained YOLO11 nano model and validate it on the COCO8 dataset. The validation process evaluates the model's performance across different object classes and generates comprehensive metrics including:\n", + "\n", + "- **Precision:** Measures how many predicted positives are actually correct, minimizing false positives.\n", + "\n", + "- **Recall:** Measures how well the model captures actual positives, minimizing false negatives.\n", + "\n", + "- **F1-Score:** Harmonic mean of precision and recall, balancing precision-recall trade-offs.\n", + "\n", + "- **mAP (mean Average Precision):** Mean precision across classes and IoU thresholds, summarizing detection performance.\n", + "\n", + "- **Confusion Matrix:** Tabular summary of prediction results, highlighting class-wise errors and accuracy.\n", + "\n", + "💡 **Tip**: Replace `\"coco8.yaml\"` with your custom dataset configuration file if using a custom-trained model." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "-2Y5WSONYW1A", + "outputId": "a6cb7448-312c-4bc0-ea3f-b8b8a5f958ac" + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "7HLVkPHPa_CA" - }, - "source": [ - "### SQL\n", - "\n", - "Enables structured storage, querying, and integration with relational databases like MySQL or PostgreSQL.\n", - "\n", - "💡 **Tip**: To view the SQL file, open the [SQLite Viewer](https://inloop.github.io/sqlite-viewer/) and upload the `results.db` file." - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.160 🚀 Python-3.11.13 torch-2.6.0+cu124 CPU (Intel Xeon 2.20GHz)\n", + "YOLO11n summary (fused): 100 layers, 2,616,248 parameters, 0 gradients, 6.5 GFLOPs\n", + "\u001B[34m\u001B[1mval: \u001B[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 1009.2±368.9 MB/s, size: 54.0 KB)\n" + ] }, { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "oOrl79b4bBXo", - "outputId": "fce9946f-81c4-4487-f4f6-ce96b8ad778e" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Results saved to SQL table 'results' in 'results.db'.\n" - ] - } - ], - "source": [ - "# Export to SQL database\n", - "metrics.to_sql()" - ] + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mScanning /content/datasets/coco8/labels/val.cache... 4 images, 0 backgrounds, 0 corrupt: 100%|██████████| 4/4 [00:00\n", - " \n", - " \n", - " Class\n", - " Images\n", - " Instances\n", - " Box-P\n", - " Box-R\n", - " Box-F1\n", - " mAP50\n", - " mAP50-95\n", - " \n", - " \n", - " \n", - " \n", - " person\n", - " 3\n", - " 10\n", - " 0.55725\n", - " 0.6\n", - " 0.57783\n", - " 0.58518\n", - " 0.27239\n", - " \n", - " \n", - " dog\n", - " 1\n", - " 1\n", - " 0.54802\n", - " 1.0\n", - " 0.70803\n", - " 0.99500\n", - " 0.69650\n", - " \n", - " \n", - " horse\n", - " 1\n", - " 2\n", - " 0.53058\n", - " 1.0\n", - " 0.69331\n", - " 0.99500\n", - " 0.67398\n", - " \n", - " \n", - " elephant\n", - " 1\n", - " 2\n", - " 0.37078\n", - " 0.5\n", - " 0.42580\n", - " 0.51583\n", - " 0.25634\n", - " \n", - " \n", - " umbrella\n", - " 1\n", - " 1\n", - " 0.56900\n", - " 1.0\n", - " 0.72531\n", - " 0.99500\n", - " 0.99500\n", - " \n", - " \n", - " potted plant\n", - " 1\n", - " 1\n", - " 0.84718\n", - " 1.0\n", - " 0.91727\n", - " 0.99500\n", - " 0.89550\n", - " \n", - " \n", - "\n" - ] - } - ], - "source": [ - "# Display results in HTML format and optionally export\n", - "val_html = metrics.to_html()\n", - "print(val_html)\n", - "with open(\"validation_results.html\", \"w\") as f:\n", - " f.write(val_html)\n", - "\n", - "# Export results in XML format\n", - "val_xml = metrics.to_xml()\n", - "with open(\"validation_results.xml\", \"w\") as f:\n", - " f.write(val_xml)\n", - "\n", - "# Export results in JSON format\n", - "val_json = metrics.to_json()\n", - "with open(\"validation_results.json\", \"w\") as f:\n", - " f.write(val_json)" - ] + "output_type": "stream", + "name": "stdout", + "text": [ + " Class Images Instances Box-P Box-R Box-F1 mAP50 mAP50-95\n", + "0 person 3 10 0.55725 0.6 0.57783 0.58518 0.27239\n", + "1 dog 1 1 0.54802 1.0 0.70803 0.99500 0.69650\n", + "2 horse 1 2 0.53058 1.0 0.69331 0.99500 0.67398\n", + "3 elephant 1 2 0.37078 0.5 0.42580 0.51583 0.25634\n", + "4 umbrella 1 1 0.56900 1.0 0.72531 0.99500 0.99500\n", + "5 potted plant 1 1 0.84718 1.0 0.91727 0.99500 0.89550\n" + ] + } + ], + "source": [ + "# Display results as pandas DataFrame\n", + "val_df = metrics.to_df()\n", + "print(val_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Y1ggdrpsa1Bg" + }, + "source": [ + "### CSV\n", + "\n", + "CSV is widely used plain-text format for data export/import across Excel, Google Sheets, and other tabular tools." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "hq_eJc_5a6w_", + "outputId": "5f731587-f09a-4e1a-be15-77ae1faaa809" + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "od_0gPE6ZHjn" - }, - "source": [ - "## Confusion Matrix Export\n", - "\n", - "The confusion matrix provides detailed insights into model performance by showing:\n", - "\n", - "- **True vs Predicted classifications:** Displays how many predictions matched the actual class for each label.\n", - "\n", - "- **Misclassification patterns:** Highlights confusion between similar or overlapping classes in the dataset.\n", - "\n", - "- **Background vs object detection:** Reveals how well the model distinguishes foreground objects from background noise.\n", - "\n", - "- **Class-specific strengths and weaknesses:** Identifies which classes are consistently well-predicted and which ones struggle.\n", - "\n", - "💡 **Tip**: The confusion matrix can also be exported to the same formats as the validation metrics." - ] + "output_type": "stream", + "name": "stdout", + "text": [ + ",Class,Images,Instances,Box-P,Box-R,Box-F1,mAP50,mAP50-95\n", + "0,person,3,10,0.55725,0.6,0.57783,0.58518,0.27239\n", + "1,dog,1,1,0.54802,1.0,0.70803,0.995,0.6965\n", + "2,horse,1,2,0.53058,1.0,0.69331,0.995,0.67398\n", + "3,elephant,1,2,0.37078,0.5,0.4258,0.51583,0.25634\n", + "4,umbrella,1,1,0.569,1.0,0.72531,0.995,0.995\n", + "5,potted plant,1,1,0.84718,1.0,0.91727,0.995,0.8955\n", + "\n" + ] + } + ], + "source": [ + "# Display results as CSV format\n", + "val_csv = metrics.to_csv()\n", + "print(val_csv)\n", + "\n", + "# Optionally save to file\n", + "csv_filename = \"validation_results.csv\"\n", + "with open(csv_filename, \"w\") as f:\n", + " f.write(val_csv)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7HLVkPHPa_CA" + }, + "source": [ + "### SQL\n", + "\n", + "Enables structured storage, querying, and integration with relational databases like MySQL or PostgreSQL.\n", + "\n", + "💡 **Tip**: To view the SQL file, open the [SQLite Viewer](https://inloop.github.io/sqlite-viewer/) and upload the `results.db` file." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "oOrl79b4bBXo", + "outputId": "fce9946f-81c4-4487-f4f6-ce96b8ad778e" + }, + "outputs": [ { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Bqy2jPI0ZGPH", - "outputId": "5deb9c06-5098-4181-f2d0-1cb77d5e7db3" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - " Predicted person bicycle car motorcycle airplane bus train truck \\\n", - "0 person 4.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "1 bicycle 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "2 car 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "3 motorcycle 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "4 airplane 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "\n", - " boat ... sink refrigerator book clock vase scissors teddy_bear \\\n", - "0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "1 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "2 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "3 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "4 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", - "\n", - " hair_drier toothbrush background \n", - "0 0.0 0.0 2.0 \n", - "1 0.0 0.0 0.0 \n", - "2 0.0 0.0 0.0 \n", - "3 0.0 0.0 0.0 \n", - "4 0.0 0.0 0.0 \n", - "\n", - "[5 rows x 82 columns]\n", - "Results saved to SQL table 'results' in 'results.db'.\n" - ] - } - ], - "source": [ - "# Display in Pandas Dataframe\n", - "cm_df = metrics.confusion_matrix.to_df()\n", - "print(cm_df.head()) # Display first 5 rows of confusion matrix\n", - "\n", - "# Export in CSV format\n", - "cm_csv = metrics.confusion_matrix.to_csv()\n", - "with open(\"confusion_matrix.csv\", \"w\") as f:\n", - " f.write(cm_csv)\n", - "\n", - "# Export in SQL format\n", - "metrics.confusion_matrix.to_sql()\n", - "\n", - "# Other formats\n", - "# print(metrics.confusion_matrix.to_html())\n", - "# print(metrics.confusion_matrix.to_json())\n", - "# print(metrics.confusion_matrix.to_xml())" - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Results saved to SQL table 'results' in 'results.db'.\n" + ] + } + ], + "source": [ + "# Export to SQL database\n", + "metrics.to_sql()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "additional-formats" + }, + "source": [ + "### Additional Export Formats\n", + "\n", + "Ultralytics YOLO also supports exporting validation results to HTML, XML, and JSON formats." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "additional-exports", + "outputId": "56d6446d-d6f2-4bb0-9384-8889a3de97ca" + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "summary-section" - }, - "source": [ - "## Additional Resources \n", - "\n", - "✅ Docs: https://docs.ultralytics.com/modes/val/\n", - "\n", - "✅ GitHub: https://github.com/ultralytics/ultralytics/\n", - "\n", - "🌟 Explore the [Ultralytics Notebooks](https://github.com/ultralytics/notebooks/) to boost your AI journey! 🚀\n", - "\n", - "Built with 💙 by [Ultralytics](https://ultralytics.com/) " - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ClassImagesInstancesBox-PBox-RBox-F1mAP50mAP50-95
person3100.557250.60.577830.585180.27239
dog110.548021.00.708030.995000.69650
horse120.530581.00.693310.995000.67398
elephant120.370780.50.425800.515830.25634
umbrella110.569001.00.725310.995000.99500
potted plant110.847181.00.917270.995000.89550
\n" + ] } - ], - "metadata": { + ], + "source": [ + "# Display results in HTML format and optionally export\n", + "val_html = metrics.to_html()\n", + "print(val_html)\n", + "with open(\"validation_results.html\", \"w\") as f:\n", + " f.write(val_html)\n", + "\n", + "# Export results in XML format\n", + "val_xml = metrics.to_xml()\n", + "with open(\"validation_results.xml\", \"w\") as f:\n", + " f.write(val_xml)\n", + "\n", + "# Export results in JSON format\n", + "val_json = metrics.to_json()\n", + "with open(\"validation_results.json\", \"w\") as f:\n", + " f.write(val_json)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "od_0gPE6ZHjn" + }, + "source": [ + "## Confusion Matrix Export\n", + "\n", + "The confusion matrix provides detailed insights into model performance by showing:\n", + "\n", + "- **True vs Predicted classifications:** Displays how many predictions matched the actual class for each label.\n", + "\n", + "- **Misclassification patterns:** Highlights confusion between similar or overlapping classes in the dataset.\n", + "\n", + "- **Background vs object detection:** Reveals how well the model distinguishes foreground objects from background noise.\n", + "\n", + "- **Class-specific strengths and weaknesses:** Identifies which classes are consistently well-predicted and which ones struggle.\n", + "\n", + "💡 **Tip**: The confusion matrix can also be exported to the same formats as the validation metrics." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { "colab": { - "provenance": [], - "toc_visible": true - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" + "base_uri": "https://localhost:8080/" }, - "language_info": { - "name": "python" + "id": "Bqy2jPI0ZGPH", + "outputId": "5deb9c06-5098-4181-f2d0-1cb77d5e7db3" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " Predicted person bicycle car motorcycle airplane bus train truck \\\n", + "0 person 4.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "1 bicycle 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "2 car 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "3 motorcycle 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "4 airplane 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "\n", + " boat ... sink refrigerator book clock vase scissors teddy_bear \\\n", + "0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "1 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "2 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "3 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "4 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "\n", + " hair_drier toothbrush background \n", + "0 0.0 0.0 2.0 \n", + "1 0.0 0.0 0.0 \n", + "2 0.0 0.0 0.0 \n", + "3 0.0 0.0 0.0 \n", + "4 0.0 0.0 0.0 \n", + "\n", + "[5 rows x 82 columns]\n", + "Results saved to SQL table 'results' in 'results.db'.\n" + ] } + ], + "source": [ + "# Display in Pandas Dataframe\n", + "cm_df = metrics.confusion_matrix.to_df()\n", + "print(cm_df.head()) # Display first 5 rows of confusion matrix\n", + "\n", + "# Export in CSV format\n", + "cm_csv = metrics.confusion_matrix.to_csv()\n", + "with open(\"confusion_matrix.csv\", \"w\") as f:\n", + " f.write(cm_csv)\n", + "\n", + "# Export in SQL format\n", + "metrics.confusion_matrix.to_sql()\n", + "\n", + "# Other formats\n", + "# print(metrics.confusion_matrix.to_html())\n", + "# print(metrics.confusion_matrix.to_json())\n", + "# print(metrics.confusion_matrix.to_xml())" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "summary-section" + }, + "source": [ + "## Additional Resources \n", + "\n", + "✅ Docs: https://docs.ultralytics.com/modes/val/\n", + "\n", + "✅ GitHub: https://github.com/ultralytics/ultralytics/\n", + "\n", + "🌟 Explore the [Ultralytics Notebooks](https://github.com/ultralytics/notebooks/) to boost your AI journey! 🚀\n", + "\n", + "Built with 💙 by [Ultralytics](https://ultralytics.com/) " + ] + } + ], + "metadata": { + "colab": { + "provenance": [], + "toc_visible": true + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/how-to-generate-heatmaps-using-ultralytics-yolo.ipynb b/notebooks/how-to-generate-heatmaps-using-ultralytics-yolo.ipynb index cd4e7d2..8cc883b 100644 --- a/notebooks/how-to-generate-heatmaps-using-ultralytics-yolo.ipynb +++ b/notebooks/how-to-generate-heatmaps-using-ultralytics-yolo.ipynb @@ -78,7 +78,7 @@ } ], "source": [ - "!pip install ultralytics\n", + "!uv pip install ultralytics\n", "\n", "import cv2\n", "import ultralytics\n", @@ -109,7 +109,6 @@ "source": [ "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/solutions-ci-demo.mp4\")\n", "cap = cv2.VideoCapture(\"solutions-ci-demo.mp4\")\n", - "assert cap.isOpened(), \"Error reading video file\"\n", "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))\n", "\n", diff --git a/notebooks/how-to-monitor-objects-in-queue-using-queue-management-solution.ipynb b/notebooks/how-to-monitor-objects-in-queue-using-queue-management-solution.ipynb index 70bc97e..4662eec 100644 --- a/notebooks/how-to-monitor-objects-in-queue-using-queue-management-solution.ipynb +++ b/notebooks/how-to-monitor-objects-in-queue-using-queue-management-solution.ipynb @@ -1,2746 +1,2746 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "accelerator": "GPU" + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - " \n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the queue management using Ultralytics Solutions 🚀 notebook!\n", - " \n", - " Ultralytics YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11 + Solutions. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Queue Management using Ultralytics Solutions\n", - "\n", - "This notebook serves as a starting point for [queue management](https://docs.ultralytics.com/guides/queue-management/) in videos or live streams using the Ultralytics Solutions.\n", - "\n", - "### What is Queue Management?\n", - "\n", - "- Queue management involves accurate identification and monitoring of people or objects forming queues in real-time video streams. Ultralytics Solutions enables efficient queue tracking for scenarios like retail store entrances, transport terminals, and event venues, ensuring smooth crowd flow and improved operational oversight.\n", - "\n", - "### Advantages of Queue Management?\n", - "\n", - "- **Crowd Flow Optimization:** Real-time monitoring of queue lengths helps in adjusting staffing or opening new counters, reducing wait times and enhancing user experience.\n", - "\n", - "- **Operational Efficiency:** Insights from queue patterns can optimize service workflows and scheduling in high-traffic environments such as banks, airports, or restaurants.\n", - "\n", - "- **Improved Safety & Compliance:** Detecting overcrowded or stagnant queues enables proactive interventions to maintain safety and follow social distancing or security protocols." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "### Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "01245876-8635-43bb-9a5c-4b6176484dba" - }, - "source": [ - "!pip install ultralytics\n", - "\n", - "import ultralytics\n", - "import cv2\n", - "from ultralytics.utils.downloads import safe_download\n", - "from ultralytics import solutions\n", - "\n", - "ultralytics.checks()" - ], - "execution_count": 10, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.169 🚀 Python-3.11.13 torch-2.6.0+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", - "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 42.3/112.6 GB disk)\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "### Read the Video File\n", - "\n", - "You can read the video either from a local file or stream it using an RTSP (Real-Time Streaming Protocol) source, offering flexibility based on your input needs. We'll also initialize the video writer to handle saving the processed output video." - ], - "metadata": { - "id": "h8go3HNgN0WU" - } - }, - { - "cell_type": "code", - "source": [ - "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/queue-management-demo.mp4\")\n", - "cap = cv2.VideoCapture(\"queue-management-demo.mp4\")\n", - "assert cap.isOpened(), \"Error reading video file\"\n", - "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,\n", - " cv2.CAP_PROP_FRAME_HEIGHT,\n", - " cv2.CAP_PROP_FPS))\n", - "\n", - "# Video writer\n", - "video_writer = cv2.VideoWriter(\"queue-management.avi\",\n", - " cv2.VideoWriter_fourcc(*\"mp4v\"),\n", - " fps, (w, h))" - ], - "metadata": { - "id": "QUgMYUvlNLvy", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "884a05ae-86b2-45b5-da9f-eee13ac6e689" - }, - "execution_count": 11, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/notebooks/releases/download/v0.0.0/queue-management-demo.mp4 to 'queue-management-demo.mp4'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.69M/5.69M [00:00<00:00, 41.1MB/s]\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "### Set Region Coordinates\n", - "\n", - "In this step, we define the coordinates of the area to be monitored, enabling precise object tracking and efficient queue management within the video or stream. This ensures effective monitoring of objects across designated zones." - ], - "metadata": { - "id": "3wJlBXORXNsj" - } - }, - { - "cell_type": "code", - "source": [ - "# For rectangle region counting\n", - "queue_region = [\n", - " (57, 271),\n", - " (295, 669),\n", - " (879, 521),\n", - " (315, 215),\n", - "]\n", - "\n", - "# For polygon region counting\n", - "# queue_region = [\n", - "# (20, 400),\n", - "# (1080, 400),\n", - "# (1080, 360),\n", - "# (20, 360),\n", - "# (20, 400)\n", - "# ]" - ], - "metadata": { - "id": "bVCrrForXRgS" - }, - "execution_count": 12, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Initialize the QueueManager Class\n", - "\n", - "Now, let's initialize the `QueueManager` class to detect and monitor objects in every frame of the video." - ], - "metadata": { - "id": "rt3soEHzXe8c" - } + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + " \n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the queue management using Ultralytics Solutions 🚀 notebook!\n", + " \n", + " Ultralytics YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11 + Solutions. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Queue Management using Ultralytics Solutions\n", + "\n", + "This notebook serves as a starting point for [queue management](https://docs.ultralytics.com/guides/queue-management/) in videos or live streams using the Ultralytics Solutions.\n", + "\n", + "### What is Queue Management?\n", + "\n", + "- Queue management involves accurate identification and monitoring of people or objects forming queues in real-time video streams. Ultralytics Solutions enables efficient queue tracking for scenarios like retail store entrances, transport terminals, and event venues, ensuring smooth crowd flow and improved operational oversight.\n", + "\n", + "### Advantages of Queue Management?\n", + "\n", + "- **Crowd Flow Optimization:** Real-time monitoring of queue lengths helps in adjusting staffing or opening new counters, reducing wait times and enhancing user experience.\n", + "\n", + "- **Operational Efficiency:** Insights from queue patterns can optimize service workflows and scheduling in high-traffic environments such as banks, airports, or restaurants.\n", + "\n", + "- **Improved Safety & Compliance:** Detecting overcrowded or stagnant queues enables proactive interventions to maintain safety and follow social distancing or security protocols." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "### Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "01245876-8635-43bb-9a5c-4b6176484dba" + }, + "source": [ + "!uv pip install ultralytics\n", + "\n", + "import ultralytics\n", + "import cv2\n", + "from ultralytics.utils.downloads import safe_download\n", + "from ultralytics import solutions\n", + "\n", + "ultralytics.checks()" + ], + "execution_count": 10, + "outputs": [ { - "cell_type": "code", - "source": [ - "# Init ObjectCounter\n", - "queuemanager = solutions.QueueManager(\n", - " show=True, # Display the output\n", - " region=queue_region, # Pass region points\n", - " model=\"yolo11m.pt\", # model=\"yolo11n-obb.pt\" for object counting using YOLO11 OBB model.\n", - " classes=[0], # If you want to count specific classes i.e person COCO pretrained model.\n", - " line_width=3, # Adjust the line width for bounding boxes and text display\n", - ")" - ], - "metadata": { - "id": "Va24DpUZXTh3", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "25feb631-7394-4e03-fbca-cf0eaac530a8" - }, - "execution_count": 15, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics Solutions: ✅ {'source': None, 'model': 'yolo11m.pt', 'classes': [0], 'show_conf': True, 'show_labels': True, 'region': [(57, 271), (295, 669), (879, 521), (315, 215)], 'colormap': 21, 'show_in': True, 'show_out': True, 'up_angle': 145.0, 'down_angle': 90, 'kpts': [6, 8, 10], 'analytics_type': 'line', 'figsize': (12.8, 7.2), 'blur_ratio': 0.5, 'vision_point': (20, 20), 'crop_dir': 'cropped-detections', 'json_file': None, 'line_width': 3, 'records': 5, 'fps': 30.0, 'max_hist': 5, 'meter_per_pixel': 0.05, 'max_speed': 120, 'show': True, 'iou': 0.7, 'conf': 0.25, 'device': None, 'max_det': 300, 'half': False, 'tracker': 'botsort.yaml', 'verbose': True, 'data': 'images'}\n" - ] - } - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.169 🚀 Python-3.11.13 torch-2.6.0+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", + "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 42.3/112.6 GB disk)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Read the Video File\n", + "\n", + "You can read the video either from a local file or stream it using an RTSP (Real-Time Streaming Protocol) source, offering flexibility based on your input needs. We'll also initialize the video writer to handle saving the processed output video." + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "code", + "source": [ + "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/queue-management-demo.mp4\")\n", + "cap = cv2.VideoCapture(\"queue-management-demo.mp4\")\n", + "assert cap.isOpened(), \"Error reading video file\"\n", + "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,\n", + " cv2.CAP_PROP_FRAME_HEIGHT,\n", + " cv2.CAP_PROP_FPS))\n", + "\n", + "# Video writer\n", + "video_writer = cv2.VideoWriter(\"queue-management.avi\",\n", + " cv2.VideoWriter_fourcc(*\"mp4v\"),\n", + " fps, (w, h))" + ], + "metadata": { + "id": "QUgMYUvlNLvy", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "884a05ae-86b2-45b5-da9f-eee13ac6e689" + }, + "execution_count": 11, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "### Process Video Frames\n", - "\n", - "In this step, we process each frame of the video to detect and analyze objects, enabling real-time tracking and queue management based on the visual data within the frames." - ], - "metadata": { - "id": "1ewYRFFqXvtj" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/notebooks/releases/download/v0.0.0/queue-management-demo.mp4 to 'queue-management-demo.mp4'...\n" + ] }, { - "cell_type": "code", - "source": [ - "# Process video\n", - "while cap.isOpened():\n", - " success, im0 = cap.read()\n", - " if not success:\n", - " print(\"Video frame is empty or video processing has been successfully completed.\")\n", - " break\n", - " results = queuemanager(im0) # queue management\n", - " video_writer.write(results.plot_im) # write the video frames\n", - "\n", - "cap.release() # Release the capture\n", - "video_writer.release()" - ], - "metadata": { - "id": "PVf1pyRtXijz", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "a7710323-2ed5-43fb-8ecf-dcb08111e2ed" - }, - "execution_count": 16, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "0: 674x1280 5.1ms\n", - "Speed: 478.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "1: 674x1280 6.0ms\n", - "Speed: 51.4ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "2: 674x1280 6.1ms\n", - "Speed: 50.7ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "3: 674x1280 6.9ms\n", - "Speed: 51.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "4: 674x1280 6.6ms\n", - "Speed: 51.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "5: 674x1280 6.3ms\n", - "Speed: 50.9ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "6: 674x1280 6.5ms\n", - "Speed: 50.7ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "7: 674x1280 6.5ms\n", - "Speed: 57.0ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "8: 674x1280 5.8ms\n", - "Speed: 52.3ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "9: 674x1280 6.7ms\n", - "Speed: 53.3ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "10: 674x1280 5.9ms\n", - "Speed: 52.0ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "11: 674x1280 5.6ms\n", - "Speed: 52.5ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "12: 674x1280 5.4ms\n", - "Speed: 50.2ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "13: 674x1280 5.6ms\n", - "Speed: 50.4ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "14: 674x1280 5.6ms\n", - "Speed: 50.9ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "15: 674x1280 5.8ms\n", - "Speed: 61.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "16: 674x1280 5.4ms\n", - "Speed: 51.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "17: 674x1280 5.5ms\n", - "Speed: 50.8ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "18: 674x1280 5.9ms\n", - "Speed: 51.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "19: 674x1280 5.9ms\n", - "Speed: 50.8ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "20: 674x1280 5.6ms\n", - "Speed: 51.8ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "21: 674x1280 5.9ms\n", - "Speed: 50.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "22: 674x1280 6.5ms\n", - "Speed: 52.5ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "23: 674x1280 6.2ms\n", - "Speed: 51.0ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "24: 674x1280 10.6ms\n", - "Speed: 69.9ms track, 10.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "25: 674x1280 9.9ms\n", - "Speed: 72.9ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "26: 674x1280 9.9ms\n", - "Speed: 67.9ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "27: 674x1280 8.5ms\n", - "Speed: 68.9ms track, 8.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "28: 674x1280 10.2ms\n", - "Speed: 70.1ms track, 10.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "29: 674x1280 9.2ms\n", - "Speed: 67.5ms track, 9.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "30: 674x1280 9.0ms\n", - "Speed: 68.8ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "31: 674x1280 9.8ms\n", - "Speed: 68.4ms track, 9.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "32: 674x1280 9.0ms\n", - "Speed: 70.8ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "33: 674x1280 8.6ms\n", - "Speed: 71.1ms track, 8.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "34: 674x1280 9.4ms\n", - "Speed: 68.7ms track, 9.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "35: 674x1280 10.0ms\n", - "Speed: 67.6ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "36: 674x1280 9.0ms\n", - "Speed: 67.1ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "37: 674x1280 9.5ms\n", - "Speed: 65.9ms track, 9.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "38: 674x1280 10.6ms\n", - "Speed: 65.7ms track, 10.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "39: 674x1280 11.5ms\n", - "Speed: 69.7ms track, 11.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "40: 674x1280 10.8ms\n", - "Speed: 67.1ms track, 10.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "41: 674x1280 11.2ms\n", - "Speed: 66.5ms track, 11.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "42: 674x1280 11.7ms\n", - "Speed: 65.7ms track, 11.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "43: 674x1280 14.3ms\n", - "Speed: 69.6ms track, 14.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "44: 674x1280 12.0ms\n", - "Speed: 67.3ms track, 12.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "45: 674x1280 13.3ms\n", - "Speed: 67.4ms track, 13.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "46: 674x1280 11.9ms\n", - "Speed: 68.2ms track, 11.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "47: 674x1280 6.5ms\n", - "Speed: 55.0ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "48: 674x1280 6.5ms\n", - "Speed: 49.9ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "49: 674x1280 7.1ms\n", - "Speed: 50.2ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "50: 674x1280 6.9ms\n", - "Speed: 49.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "51: 674x1280 9.2ms\n", - "Speed: 61.4ms track, 9.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "52: 674x1280 6.0ms\n", - "Speed: 49.6ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "53: 674x1280 6.1ms\n", - "Speed: 50.1ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "54: 674x1280 6.2ms\n", - "Speed: 50.2ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "55: 674x1280 6.0ms\n", - "Speed: 49.6ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "56: 674x1280 5.9ms\n", - "Speed: 49.4ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "57: 674x1280 6.4ms\n", - "Speed: 51.1ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "58: 674x1280 7.0ms\n", - "Speed: 50.9ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "59: 674x1280 7.4ms\n", - "Speed: 51.1ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "60: 674x1280 7.5ms\n", - "Speed: 51.8ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "61: 674x1280 7.1ms\n", - "Speed: 50.9ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "62: 674x1280 6.1ms\n", - "Speed: 50.9ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "63: 674x1280 5.9ms\n", - "Speed: 51.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "64: 674x1280 6.0ms\n", - "Speed: 53.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "65: 674x1280 6.1ms\n", - "Speed: 52.9ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "66: 674x1280 6.1ms\n", - "Speed: 51.0ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "67: 674x1280 6.0ms\n", - "Speed: 52.0ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "68: 674x1280 6.1ms\n", - "Speed: 50.7ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "69: 674x1280 5.9ms\n", - "Speed: 50.4ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "70: 674x1280 5.9ms\n", - "Speed: 51.2ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "71: 674x1280 6.1ms\n", - "Speed: 50.7ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "72: 674x1280 6.1ms\n", - "Speed: 51.1ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "73: 674x1280 6.0ms\n", - "Speed: 50.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "74: 674x1280 6.2ms\n", - "Speed: 50.1ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "75: 674x1280 6.5ms\n", - "Speed: 50.8ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "76: 674x1280 6.0ms\n", - "Speed: 51.2ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "77: 674x1280 6.0ms\n", - "Speed: 50.7ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "78: 674x1280 6.1ms\n", - "Speed: 51.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "79: 674x1280 6.9ms\n", - "Speed: 51.4ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "80: 674x1280 6.4ms\n", - "Speed: 51.7ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "81: 674x1280 7.5ms\n", - "Speed: 55.0ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "82: 674x1280 6.4ms\n", - "Speed: 60.1ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "83: 674x1280 6.8ms\n", - "Speed: 50.1ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "84: 674x1280 6.9ms\n", - "Speed: 50.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "85: 674x1280 6.9ms\n", - "Speed: 49.9ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "86: 674x1280 7.0ms\n", - "Speed: 50.4ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "87: 674x1280 7.1ms\n", - "Speed: 51.2ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "88: 674x1280 7.1ms\n", - "Speed: 51.3ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "89: 674x1280 8.3ms\n", - "Speed: 50.8ms track, 8.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "90: 674x1280 7.2ms\n", - "Speed: 52.2ms track, 7.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "91: 674x1280 6.7ms\n", - "Speed: 50.6ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "92: 674x1280 7.0ms\n", - "Speed: 50.7ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "93: 674x1280 7.0ms\n", - "Speed: 51.8ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "94: 674x1280 6.7ms\n", - "Speed: 50.6ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "95: 674x1280 7.4ms\n", - "Speed: 51.7ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "96: 674x1280 6.6ms\n", - "Speed: 53.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "97: 674x1280 6.6ms\n", - "Speed: 63.6ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "98: 674x1280 7.4ms\n", - "Speed: 51.4ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "99: 674x1280 6.3ms\n", - "Speed: 51.5ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "100: 674x1280 6.7ms\n", - "Speed: 51.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "101: 674x1280 7.5ms\n", - "Speed: 52.2ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "102: 674x1280 6.5ms\n", - "Speed: 52.1ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "103: 674x1280 6.3ms\n", - "Speed: 52.5ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "104: 674x1280 6.2ms\n", - "Speed: 52.1ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "105: 674x1280 6.4ms\n", - "Speed: 51.9ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "106: 674x1280 6.1ms\n", - "Speed: 51.3ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "107: 674x1280 5.8ms\n", - "Speed: 51.4ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "108: 674x1280 6.0ms\n", - "Speed: 51.8ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "109: 674x1280 5.9ms\n", - "Speed: 51.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "110: 674x1280 6.4ms\n", - "Speed: 52.2ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "111: 674x1280 6.6ms\n", - "Speed: 51.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "112: 674x1280 10.2ms\n", - "Speed: 60.9ms track, 10.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "113: 674x1280 6.4ms\n", - "Speed: 53.1ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "114: 674x1280 6.6ms\n", - "Speed: 53.5ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "115: 674x1280 6.3ms\n", - "Speed: 52.2ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "116: 674x1280 6.8ms\n", - "Speed: 54.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "117: 674x1280 7.4ms\n", - "Speed: 53.6ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "118: 674x1280 6.1ms\n", - "Speed: 52.9ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "119: 674x1280 14.9ms\n", - "Speed: 52.7ms track, 14.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "120: 674x1280 6.4ms\n", - "Speed: 52.3ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "121: 674x1280 7.9ms\n", - "Speed: 51.5ms track, 7.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "122: 674x1280 5.9ms\n", - "Speed: 53.9ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "123: 674x1280 6.1ms\n", - "Speed: 52.5ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "124: 674x1280 6.7ms\n", - "Speed: 56.1ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "125: 674x1280 6.3ms\n", - "Speed: 53.1ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "126: 674x1280 6.0ms\n", - "Speed: 52.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "127: 674x1280 6.3ms\n", - "Speed: 58.1ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "128: 674x1280 6.6ms\n", - "Speed: 53.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "129: 674x1280 6.2ms\n", - "Speed: 54.0ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "130: 674x1280 6.8ms\n", - "Speed: 56.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "131: 674x1280 6.2ms\n", - "Speed: 53.8ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "132: 674x1280 6.3ms\n", - "Speed: 52.7ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "133: 674x1280 7.0ms\n", - "Speed: 52.2ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "134: 674x1280 5.8ms\n", - "Speed: 52.3ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "135: 674x1280 6.2ms\n", - "Speed: 53.3ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "136: 674x1280 6.1ms\n", - "Speed: 53.4ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "137: 674x1280 6.2ms\n", - "Speed: 53.2ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "138: 674x1280 6.6ms\n", - "Speed: 53.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "139: 674x1280 6.2ms\n", - "Speed: 54.8ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "140: 674x1280 6.5ms\n", - "Speed: 52.7ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "141: 674x1280 6.3ms\n", - "Speed: 52.3ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "142: 674x1280 6.3ms\n", - "Speed: 53.9ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "143: 674x1280 6.4ms\n", - "Speed: 53.0ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "144: 674x1280 6.3ms\n", - "Speed: 53.6ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "145: 674x1280 6.7ms\n", - "Speed: 53.2ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "146: 674x1280 6.3ms\n", - "Speed: 52.4ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "147: 674x1280 6.9ms\n", - "Speed: 50.9ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "148: 674x1280 6.7ms\n", - "Speed: 50.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "149: 674x1280 6.7ms\n", - "Speed: 51.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "150: 674x1280 6.9ms\n", - "Speed: 52.1ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "151: 674x1280 6.7ms\n", - "Speed: 53.2ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "152: 674x1280 6.1ms\n", - "Speed: 51.4ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "153: 674x1280 6.3ms\n", - "Speed: 52.4ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "154: 674x1280 6.6ms\n", - "Speed: 52.0ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "155: 674x1280 6.6ms\n", - "Speed: 53.0ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "156: 674x1280 6.8ms\n", - "Speed: 52.7ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "157: 674x1280 6.8ms\n", - "Speed: 55.0ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "158: 674x1280 6.7ms\n", - "Speed: 52.4ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "159: 674x1280 7.2ms\n", - "Speed: 53.4ms track, 7.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "160: 674x1280 7.0ms\n", - "Speed: 52.1ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "161: 674x1280 6.6ms\n", - "Speed: 51.2ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "162: 674x1280 6.7ms\n", - "Speed: 51.9ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "163: 674x1280 6.9ms\n", - "Speed: 52.0ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "164: 674x1280 7.1ms\n", - "Speed: 51.1ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "165: 674x1280 6.6ms\n", - "Speed: 52.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "166: 674x1280 6.6ms\n", - "Speed: 51.1ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "167: 674x1280 6.1ms\n", - "Speed: 50.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "168: 674x1280 5.5ms\n", - "Speed: 54.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "169: 674x1280 5.4ms\n", - "Speed: 50.9ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "170: 674x1280 5.6ms\n", - "Speed: 50.6ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "171: 674x1280 5.6ms\n", - "Speed: 50.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "172: 674x1280 6.2ms\n", - "Speed: 55.9ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "173: 674x1280 5.7ms\n", - "Speed: 52.0ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "174: 674x1280 5.4ms\n", - "Speed: 52.1ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "175: 674x1280 5.7ms\n", - "Speed: 50.6ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "176: 674x1280 5.3ms\n", - "Speed: 49.9ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "177: 674x1280 5.5ms\n", - "Speed: 51.5ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "178: 674x1280 5.4ms\n", - "Speed: 50.3ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "179: 674x1280 5.6ms\n", - "Speed: 50.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "180: 674x1280 5.8ms\n", - "Speed: 50.4ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "181: 674x1280 6.0ms\n", - "Speed: 50.2ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "182: 674x1280 6.0ms\n", - "Speed: 50.0ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "183: 674x1280 7.6ms\n", - "Speed: 50.3ms track, 7.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "184: 674x1280 6.0ms\n", - "Speed: 52.9ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "185: 674x1280 5.5ms\n", - "Speed: 50.4ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "186: 674x1280 5.6ms\n", - "Speed: 50.5ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "187: 674x1280 9.9ms\n", - "Speed: 51.1ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "188: 674x1280 6.1ms\n", - "Speed: 50.4ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "189: 674x1280 6.1ms\n", - "Speed: 52.1ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "190: 674x1280 6.1ms\n", - "Speed: 51.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "191: 674x1280 5.6ms\n", - "Speed: 50.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "192: 674x1280 5.5ms\n", - "Speed: 50.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "193: 674x1280 5.6ms\n", - "Speed: 50.1ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "194: 674x1280 10.0ms\n", - "Speed: 68.4ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "195: 674x1280 9.6ms\n", - "Speed: 68.8ms track, 9.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "196: 674x1280 9.4ms\n", - "Speed: 69.0ms track, 9.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "197: 674x1280 9.3ms\n", - "Speed: 65.4ms track, 9.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "198: 674x1280 9.0ms\n", - "Speed: 67.5ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "199: 674x1280 10.4ms\n", - "Speed: 67.5ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "200: 674x1280 15.3ms\n", - "Speed: 70.8ms track, 15.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "201: 674x1280 8.9ms\n", - "Speed: 67.8ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "202: 674x1280 9.7ms\n", - "Speed: 65.9ms track, 9.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "203: 674x1280 8.7ms\n", - "Speed: 65.5ms track, 8.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "204: 674x1280 9.4ms\n", - "Speed: 65.9ms track, 9.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "205: 674x1280 8.0ms\n", - "Speed: 67.8ms track, 8.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "206: 674x1280 7.8ms\n", - "Speed: 68.2ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "207: 674x1280 8.4ms\n", - "Speed: 67.0ms track, 8.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "208: 674x1280 7.7ms\n", - "Speed: 65.2ms track, 7.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "209: 674x1280 8.2ms\n", - "Speed: 65.2ms track, 8.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "210: 674x1280 9.2ms\n", - "Speed: 66.9ms track, 9.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "211: 674x1280 10.0ms\n", - "Speed: 67.3ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "212: 674x1280 13.9ms\n", - "Speed: 69.9ms track, 13.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "213: 674x1280 9.9ms\n", - "Speed: 67.1ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "214: 674x1280 8.9ms\n", - "Speed: 68.1ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "215: 674x1280 10.3ms\n", - "Speed: 66.0ms track, 10.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "216: 674x1280 11.1ms\n", - "Speed: 68.3ms track, 11.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "217: 674x1280 11.0ms\n", - "Speed: 66.6ms track, 11.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "218: 674x1280 10.4ms\n", - "Speed: 68.6ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "219: 674x1280 10.0ms\n", - "Speed: 65.2ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "220: 674x1280 5.5ms\n", - "Speed: 52.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "221: 674x1280 5.9ms\n", - "Speed: 50.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "222: 674x1280 5.8ms\n", - "Speed: 50.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "223: 674x1280 5.8ms\n", - "Speed: 50.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "224: 674x1280 6.4ms\n", - "Speed: 49.5ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "225: 674x1280 6.6ms\n", - "Speed: 59.2ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "226: 674x1280 6.5ms\n", - "Speed: 49.7ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "227: 674x1280 6.9ms\n", - "Speed: 51.5ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "228: 674x1280 5.9ms\n", - "Speed: 50.8ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "229: 674x1280 6.0ms\n", - "Speed: 49.6ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "230: 674x1280 6.0ms\n", - "Speed: 49.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "231: 674x1280 5.7ms\n", - "Speed: 49.5ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "232: 674x1280 5.6ms\n", - "Speed: 50.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "233: 674x1280 5.1ms\n", - "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "234: 674x1280 5.8ms\n", - "Speed: 50.3ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "235: 674x1280 5.7ms\n", - "Speed: 49.8ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "236: 674x1280 5.4ms\n", - "Speed: 50.1ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "237: 674x1280 5.9ms\n", - "Speed: 50.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "238: 674x1280 5.3ms\n", - "Speed: 49.1ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "239: 674x1280 5.2ms\n", - "Speed: 52.0ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "240: 674x1280 5.2ms\n", - "Speed: 50.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "241: 674x1280 5.7ms\n", - "Speed: 52.6ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "242: 674x1280 5.6ms\n", - "Speed: 50.5ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "243: 674x1280 5.6ms\n", - "Speed: 49.9ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "244: 674x1280 5.4ms\n", - "Speed: 48.8ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "245: 674x1280 5.4ms\n", - "Speed: 49.7ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "246: 674x1280 5.8ms\n", - "Speed: 50.9ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "247: 674x1280 5.4ms\n", - "Speed: 49.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "248: 674x1280 5.6ms\n", - "Speed: 49.9ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "249: 674x1280 5.1ms\n", - "Speed: 49.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "250: 674x1280 5.1ms\n", - "Speed: 49.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "251: 674x1280 5.1ms\n", - "Speed: 49.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "252: 674x1280 5.1ms\n", - "Speed: 51.4ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "253: 674x1280 5.3ms\n", - "Speed: 50.2ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "254: 674x1280 5.3ms\n", - "Speed: 51.2ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "255: 674x1280 5.6ms\n", - "Speed: 54.2ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "256: 674x1280 10.5ms\n", - "Speed: 57.1ms track, 10.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "257: 674x1280 5.1ms\n", - "Speed: 51.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "258: 674x1280 5.0ms\n", - "Speed: 50.4ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "259: 674x1280 4.9ms\n", - "Speed: 50.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "260: 674x1280 5.0ms\n", - "Speed: 49.9ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "261: 674x1280 6.0ms\n", - "Speed: 50.4ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "262: 674x1280 5.1ms\n", - "Speed: 52.3ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "263: 674x1280 5.0ms\n", - "Speed: 50.4ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "264: 674x1280 5.1ms\n", - "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "265: 674x1280 4.6ms\n", - "Speed: 51.4ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "266: 674x1280 6.0ms\n", - "Speed: 50.4ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "267: 674x1280 5.1ms\n", - "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "268: 674x1280 5.1ms\n", - "Speed: 51.6ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "269: 674x1280 5.3ms\n", - "Speed: 50.8ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "270: 674x1280 5.2ms\n", - "Speed: 51.6ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "271: 674x1280 5.3ms\n", - "Speed: 51.1ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "272: 674x1280 5.7ms\n", - "Speed: 59.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "273: 674x1280 5.5ms\n", - "Speed: 51.5ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "274: 674x1280 5.9ms\n", - "Speed: 50.9ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "275: 674x1280 5.6ms\n", - "Speed: 50.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "276: 674x1280 5.5ms\n", - "Speed: 49.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "277: 674x1280 5.6ms\n", - "Speed: 51.1ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "278: 674x1280 5.5ms\n", - "Speed: 51.2ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "279: 674x1280 5.3ms\n", - "Speed: 49.8ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "280: 674x1280 5.5ms\n", - "Speed: 49.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "281: 674x1280 6.1ms\n", - "Speed: 51.2ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "282: 674x1280 5.5ms\n", - "Speed: 51.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "283: 674x1280 5.9ms\n", - "Speed: 52.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "284: 674x1280 5.9ms\n", - "Speed: 52.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "285: 674x1280 5.8ms\n", - "Speed: 52.8ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "286: 674x1280 6.2ms\n", - "Speed: 51.5ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "287: 674x1280 10.9ms\n", - "Speed: 59.2ms track, 10.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "288: 674x1280 5.2ms\n", - "Speed: 52.6ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "289: 674x1280 5.2ms\n", - "Speed: 51.9ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "290: 674x1280 5.3ms\n", - "Speed: 51.5ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "291: 674x1280 5.2ms\n", - "Speed: 52.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "292: 674x1280 5.0ms\n", - "Speed: 50.7ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "293: 674x1280 5.1ms\n", - "Speed: 51.6ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "294: 674x1280 5.3ms\n", - "Speed: 51.2ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "295: 674x1280 8.9ms\n", - "Speed: 52.9ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "296: 674x1280 10.7ms\n", - "Speed: 177.4ms track, 10.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "297: 674x1280 5.8ms\n", - "Speed: 78.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "298: 674x1280 5.2ms\n", - "Speed: 51.4ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "299: 674x1280 5.5ms\n", - "Speed: 64.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "300: 674x1280 5.0ms\n", - "Speed: 51.2ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "301: 674x1280 5.5ms\n", - "Speed: 51.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "302: 674x1280 5.4ms\n", - "Speed: 51.0ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "303: 674x1280 5.9ms\n", - "Speed: 50.8ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "304: 674x1280 7.3ms\n", - "Speed: 54.5ms track, 7.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "305: 674x1280 27.4ms\n", - "Speed: 145.0ms track, 27.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "306: 674x1280 12.6ms\n", - "Speed: 74.6ms track, 12.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "307: 674x1280 5.8ms\n", - "Speed: 51.9ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "308: 674x1280 6.0ms\n", - "Speed: 53.0ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "309: 674x1280 5.4ms\n", - "Speed: 51.4ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "310: 674x1280 5.6ms\n", - "Speed: 51.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "311: 674x1280 5.7ms\n", - "Speed: 63.4ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "312: 674x1280 5.5ms\n", - "Speed: 51.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "313: 674x1280 5.6ms\n", - "Speed: 51.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "314: 674x1280 6.0ms\n", - "Speed: 52.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "315: 674x1280 27.7ms\n", - "Speed: 188.0ms track, 27.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "316: 674x1280 6.0ms\n", - "Speed: 56.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "317: 674x1280 5.7ms\n", - "Speed: 52.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "318: 674x1280 5.9ms\n", - "Speed: 53.4ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "319: 674x1280 7.8ms\n", - "Speed: 52.3ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "320: 674x1280 5.1ms\n", - "Speed: 52.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "321: 674x1280 5.0ms\n", - "Speed: 50.1ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "322: 674x1280 5.1ms\n", - "Speed: 50.3ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "323: 674x1280 4.7ms\n", - "Speed: 56.7ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "324: 674x1280 5.1ms\n", - "Speed: 50.9ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "325: 674x1280 5.3ms\n", - "Speed: 50.7ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "326: 674x1280 5.4ms\n", - "Speed: 50.2ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "327: 674x1280 4.9ms\n", - "Speed: 51.0ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "328: 674x1280 4.9ms\n", - "Speed: 51.3ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "329: 674x1280 5.1ms\n", - "Speed: 50.0ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "330: 674x1280 5.2ms\n", - "Speed: 49.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "331: 674x1280 5.1ms\n", - "Speed: 49.4ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "332: 674x1280 5.0ms\n", - "Speed: 50.2ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "333: 674x1280 6.1ms\n", - "Speed: 49.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "334: 674x1280 5.0ms\n", - "Speed: 49.6ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "335: 674x1280 4.5ms\n", - "Speed: 49.8ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "336: 674x1280 4.5ms\n", - "Speed: 49.6ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "337: 674x1280 4.6ms\n", - "Speed: 50.9ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "338: 674x1280 4.4ms\n", - "Speed: 49.5ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "339: 674x1280 4.7ms\n", - "Speed: 53.6ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "340: 674x1280 4.5ms\n", - "Speed: 49.5ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "341: 674x1280 4.5ms\n", - "Speed: 50.8ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "342: 674x1280 4.9ms\n", - "Speed: 49.9ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "343: 674x1280 4.9ms\n", - "Speed: 49.6ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "344: 674x1280 5.5ms\n", - "Speed: 50.0ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "345: 674x1280 5.0ms\n", - "Speed: 49.0ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "346: 674x1280 5.0ms\n", - "Speed: 50.5ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "347: 674x1280 4.9ms\n", - "Speed: 49.0ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "348: 674x1280 5.0ms\n", - "Speed: 48.3ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "349: 674x1280 4.9ms\n", - "Speed: 49.3ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "350: 674x1280 4.9ms\n", - "Speed: 48.2ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "351: 674x1280 4.9ms\n", - "Speed: 47.9ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "352: 674x1280 4.9ms\n", - "Speed: 48.4ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "353: 674x1280 4.9ms\n", - "Speed: 47.8ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "354: 674x1280 4.9ms\n", - "Speed: 47.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "355: 674x1280 5.4ms\n", - "Speed: 59.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "356: 674x1280 5.5ms\n", - "Speed: 48.8ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "357: 674x1280 5.6ms\n", - "Speed: 49.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "358: 674x1280 5.0ms\n", - "Speed: 48.6ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "359: 674x1280 5.1ms\n", - "Speed: 50.3ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "360: 674x1280 5.1ms\n", - "Speed: 49.9ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "361: 674x1280 10.1ms\n", - "Speed: 64.2ms track, 10.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "362: 674x1280 8.9ms\n", - "Speed: 63.3ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "363: 674x1280 10.4ms\n", - "Speed: 64.7ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "364: 674x1280 9.8ms\n", - "Speed: 63.0ms track, 9.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "365: 674x1280 7.6ms\n", - "Speed: 62.2ms track, 7.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "366: 674x1280 8.4ms\n", - "Speed: 62.8ms track, 8.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "367: 674x1280 9.7ms\n", - "Speed: 68.5ms track, 9.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "368: 674x1280 8.9ms\n", - "Speed: 70.7ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "369: 674x1280 9.0ms\n", - "Speed: 69.2ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "370: 674x1280 8.3ms\n", - "Speed: 64.6ms track, 8.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "371: 674x1280 9.0ms\n", - "Speed: 64.6ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "372: 674x1280 8.5ms\n", - "Speed: 64.5ms track, 8.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "373: 674x1280 7.8ms\n", - "Speed: 63.5ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "374: 674x1280 7.8ms\n", - "Speed: 65.2ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "375: 674x1280 8.0ms\n", - "Speed: 65.1ms track, 8.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "376: 674x1280 8.3ms\n", - "Speed: 66.4ms track, 8.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "377: 674x1280 8.2ms\n", - "Speed: 64.4ms track, 8.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "378: 674x1280 9.9ms\n", - "Speed: 67.0ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "379: 674x1280 9.3ms\n", - "Speed: 69.8ms track, 9.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "380: 674x1280 8.5ms\n", - "Speed: 68.0ms track, 8.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "381: 674x1280 8.6ms\n", - "Speed: 65.3ms track, 8.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "382: 674x1280 10.2ms\n", - "Speed: 65.9ms track, 10.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "383: 674x1280 9.5ms\n", - "Speed: 68.6ms track, 9.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "384: 674x1280 9.6ms\n", - "Speed: 65.2ms track, 9.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "385: 674x1280 8.6ms\n", - "Speed: 65.6ms track, 8.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "386: 674x1280 10.4ms\n", - "Speed: 65.7ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "387: 674x1280 5.5ms\n", - "Speed: 51.8ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "388: 674x1280 5.7ms\n", - "Speed: 49.5ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "389: 674x1280 5.4ms\n", - "Speed: 50.8ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "390: 674x1280 5.8ms\n", - "Speed: 50.0ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "391: 674x1280 5.2ms\n", - "Speed: 49.2ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "392: 674x1280 4.9ms\n", - "Speed: 49.2ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "393: 674x1280 5.8ms\n", - "Speed: 49.0ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "394: 674x1280 4.6ms\n", - "Speed: 52.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "395: 674x1280 6.2ms\n", - "Speed: 49.0ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "396: 674x1280 4.7ms\n", - "Speed: 52.4ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "397: 674x1280 4.6ms\n", - "Speed: 49.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "398: 674x1280 4.5ms\n", - "Speed: 49.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "399: 674x1280 4.6ms\n", - "Speed: 48.8ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "400: 674x1280 4.5ms\n", - "Speed: 48.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "401: 674x1280 4.3ms\n", - "Speed: 48.6ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "402: 674x1280 4.2ms\n", - "Speed: 48.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "403: 674x1280 4.5ms\n", - "Speed: 49.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "404: 674x1280 4.0ms\n", - "Speed: 49.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "405: 674x1280 4.4ms\n", - "Speed: 48.7ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "406: 674x1280 4.5ms\n", - "Speed: 49.0ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "407: 674x1280 5.1ms\n", - "Speed: 48.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "408: 674x1280 4.7ms\n", - "Speed: 50.7ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "409: 674x1280 4.8ms\n", - "Speed: 50.1ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "410: 674x1280 5.9ms\n", - "Speed: 62.7ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "411: 674x1280 4.6ms\n", - "Speed: 50.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "412: 674x1280 4.6ms\n", - "Speed: 51.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "413: 674x1280 4.7ms\n", - "Speed: 49.3ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "414: 674x1280 4.6ms\n", - "Speed: 49.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "415: 674x1280 5.1ms\n", - "Speed: 49.5ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "416: 674x1280 6.0ms\n", - "Speed: 49.5ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "417: 674x1280 5.2ms\n", - "Speed: 48.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "418: 674x1280 6.7ms\n", - "Speed: 49.3ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "419: 674x1280 5.0ms\n", - "Speed: 48.9ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "420: 674x1280 5.0ms\n", - "Speed: 49.7ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "421: 674x1280 4.1ms\n", - "Speed: 49.3ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "422: 674x1280 4.1ms\n", - "Speed: 49.0ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "423: 674x1280 4.0ms\n", - "Speed: 48.3ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "424: 674x1280 4.0ms\n", - "Speed: 49.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "425: 674x1280 4.5ms\n", - "Speed: 48.9ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "426: 674x1280 5.2ms\n", - "Speed: 63.2ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "427: 674x1280 5.2ms\n", - "Speed: 50.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "428: 674x1280 4.7ms\n", - "Speed: 50.0ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "429: 674x1280 5.1ms\n", - "Speed: 50.9ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "430: 674x1280 5.0ms\n", - "Speed: 49.6ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "431: 674x1280 4.9ms\n", - "Speed: 49.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "432: 674x1280 4.5ms\n", - "Speed: 51.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "433: 674x1280 4.5ms\n", - "Speed: 50.5ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "434: 674x1280 4.9ms\n", - "Speed: 51.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "435: 674x1280 4.7ms\n", - "Speed: 51.3ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "436: 674x1280 5.1ms\n", - "Speed: 50.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "437: 674x1280 4.5ms\n", - "Speed: 51.9ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "438: 674x1280 4.6ms\n", - "Speed: 50.5ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "439: 674x1280 5.3ms\n", - "Speed: 51.5ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "440: 674x1280 5.8ms\n", - "Speed: 52.9ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "441: 674x1280 8.9ms\n", - "Speed: 61.7ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "442: 674x1280 4.8ms\n", - "Speed: 52.3ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "443: 674x1280 4.8ms\n", - "Speed: 51.2ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "444: 674x1280 4.9ms\n", - "Speed: 51.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "445: 674x1280 5.0ms\n", - "Speed: 50.8ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "446: 674x1280 5.1ms\n", - "Speed: 51.4ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "447: 674x1280 5.0ms\n", - "Speed: 51.5ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "448: 674x1280 5.1ms\n", - "Speed: 52.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "449: 674x1280 4.8ms\n", - "Speed: 53.5ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "450: 674x1280 5.7ms\n", - "Speed: 53.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "451: 674x1280 4.8ms\n", - "Speed: 52.5ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "452: 674x1280 5.2ms\n", - "Speed: 52.6ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "453: 674x1280 5.7ms\n", - "Speed: 52.6ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "454: 674x1280 4.7ms\n", - "Speed: 51.6ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "455: 674x1280 5.1ms\n", - "Speed: 51.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "456: 674x1280 5.8ms\n", - "Speed: 50.8ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "457: 674x1280 4.4ms\n", - "Speed: 54.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "458: 674x1280 4.4ms\n", - "Speed: 50.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "459: 674x1280 4.4ms\n", - "Speed: 49.5ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "460: 674x1280 4.4ms\n", - "Speed: 51.0ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "461: 674x1280 4.8ms\n", - "Speed: 49.8ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "462: 674x1280 4.3ms\n", - "Speed: 49.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "463: 674x1280 4.5ms\n", - "Speed: 50.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "464: 674x1280 4.3ms\n", - "Speed: 50.3ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "465: 674x1280 4.2ms\n", - "Speed: 49.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "466: 674x1280 4.4ms\n", - "Speed: 50.3ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "467: 674x1280 4.1ms\n", - "Speed: 50.9ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "468: 674x1280 4.2ms\n", - "Speed: 51.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "469: 674x1280 4.2ms\n", - "Speed: 50.0ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "470: 674x1280 4.3ms\n", - "Speed: 51.4ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "471: 674x1280 4.4ms\n", - "Speed: 51.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "472: 674x1280 4.7ms\n", - "Speed: 52.4ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "473: 674x1280 4.6ms\n", - "Speed: 57.0ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "474: 674x1280 4.6ms\n", - "Speed: 51.4ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "475: 674x1280 4.2ms\n", - "Speed: 50.3ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "476: 674x1280 4.4ms\n", - "Speed: 50.8ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "477: 674x1280 4.3ms\n", - "Speed: 51.2ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "478: 674x1280 4.3ms\n", - "Speed: 49.5ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "479: 674x1280 4.5ms\n", - "Speed: 51.7ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "480: 674x1280 4.3ms\n", - "Speed: 49.3ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "481: 674x1280 4.3ms\n", - "Speed: 50.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "482: 674x1280 4.3ms\n", - "Speed: 50.1ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "483: 674x1280 4.4ms\n", - "Speed: 50.7ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "484: 674x1280 4.2ms\n", - "Speed: 49.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "485: 674x1280 4.2ms\n", - "Speed: 50.3ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "486: 674x1280 4.2ms\n", - "Speed: 50.3ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "487: 674x1280 4.1ms\n", - "Speed: 51.5ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "488: 674x1280 4.4ms\n", - "Speed: 49.3ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "489: 674x1280 4.3ms\n", - "Speed: 50.8ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "490: 674x1280 4.2ms\n", - "Speed: 48.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "491: 674x1280 4.3ms\n", - "Speed: 49.2ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "492: 674x1280 4.5ms\n", - "Speed: 49.5ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "493: 674x1280 4.4ms\n", - "Speed: 49.9ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "494: 674x1280 4.5ms\n", - "Speed: 49.6ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "495: 674x1280 4.5ms\n", - "Speed: 50.8ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "496: 674x1280 4.4ms\n", - "Speed: 49.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "497: 674x1280 4.3ms\n", - "Speed: 48.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "498: 674x1280 4.2ms\n", - "Speed: 48.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "499: 674x1280 4.4ms\n", - "Speed: 48.5ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "500: 674x1280 4.3ms\n", - "Speed: 48.7ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "501: 674x1280 5.4ms\n", - "Speed: 49.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "502: 674x1280 5.5ms\n", - "Speed: 47.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "503: 674x1280 4.2ms\n", - "Speed: 48.1ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "504: 674x1280 4.4ms\n", - "Speed: 47.8ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "505: 674x1280 4.4ms\n", - "Speed: 59.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "506: 674x1280 4.1ms\n", - "Speed: 47.1ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "507: 674x1280 4.2ms\n", - "Speed: 46.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "508: 674x1280 4.3ms\n", - "Speed: 46.8ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "509: 674x1280 4.2ms\n", - "Speed: 46.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "510: 674x1280 4.4ms\n", - "Speed: 46.9ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "511: 674x1280 4.3ms\n", - "Speed: 48.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "512: 674x1280 4.2ms\n", - "Speed: 46.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "513: 674x1280 4.2ms\n", - "Speed: 47.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "514: 674x1280 4.2ms\n", - "Speed: 48.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "515: 674x1280 4.4ms\n", - "Speed: 45.1ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "516: 674x1280 4.2ms\n", - "Speed: 45.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "517: 674x1280 4.2ms\n", - "Speed: 45.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "518: 674x1280 4.4ms\n", - "Speed: 46.2ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "519: 674x1280 4.7ms\n", - "Speed: 46.2ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "520: 674x1280 4.2ms\n", - "Speed: 45.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "521: 674x1280 4.4ms\n", - "Speed: 45.1ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "522: 674x1280 4.5ms\n", - "Speed: 59.4ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "523: 674x1280 4.3ms\n", - "Speed: 47.0ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "524: 674x1280 4.2ms\n", - "Speed: 46.1ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "525: 674x1280 4.3ms\n", - "Speed: 48.1ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "526: 674x1280 4.1ms\n", - "Speed: 46.0ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "527: 674x1280 4.2ms\n", - "Speed: 46.4ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "528: 674x1280 4.2ms\n", - "Speed: 45.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "529: 674x1280 4.3ms\n", - "Speed: 49.2ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "530: 674x1280 4.2ms\n", - "Speed: 46.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "531: 674x1280 4.2ms\n", - "Speed: 45.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "532: 674x1280 4.2ms\n", - "Speed: 46.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "533: 674x1280 4.2ms\n", - "Speed: 45.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "534: 674x1280 4.9ms\n", - "Speed: 48.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "535: 674x1280 4.9ms\n", - "Speed: 47.8ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "536: 674x1280 4.8ms\n", - "Speed: 46.8ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "537: 674x1280 4.7ms\n", - "Speed: 46.5ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "538: 674x1280 4.7ms\n", - "Speed: 45.2ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "539: 674x1280 4.4ms\n", - "Speed: 56.6ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "540: 674x1280 4.5ms\n", - "Speed: 47.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "541: 674x1280 4.6ms\n", - "Speed: 45.5ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "542: 674x1280 4.2ms\n", - "Speed: 45.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "543: 674x1280 8.1ms\n", - "Speed: 63.9ms track, 8.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "544: 674x1280 8.0ms\n", - "Speed: 62.2ms track, 8.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "545: 674x1280 6.6ms\n", - "Speed: 61.7ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "546: 674x1280 6.8ms\n", - "Speed: 60.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "547: 674x1280 6.4ms\n", - "Speed: 60.3ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "548: 674x1280 7.2ms\n", - "Speed: 60.5ms track, 7.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "549: 674x1280 10.5ms\n", - "Speed: 62.7ms track, 10.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "550: 674x1280 6.8ms\n", - "Speed: 60.0ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "551: 674x1280 6.9ms\n", - "Speed: 60.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "552: 674x1280 8.1ms\n", - "Speed: 67.0ms track, 8.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "553: 674x1280 9.5ms\n", - "Speed: 60.3ms track, 9.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "554: 674x1280 7.6ms\n", - "Speed: 66.5ms track, 7.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "555: 674x1280 7.0ms\n", - "Speed: 61.6ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "556: 674x1280 6.4ms\n", - "Speed: 60.7ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "557: 674x1280 6.6ms\n", - "Speed: 61.3ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "558: 674x1280 6.1ms\n", - "Speed: 65.0ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "559: 674x1280 7.9ms\n", - "Speed: 67.2ms track, 7.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "560: 674x1280 8.1ms\n", - "Speed: 64.6ms track, 8.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "561: 674x1280 7.7ms\n", - "Speed: 65.5ms track, 7.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "562: 674x1280 16.9ms\n", - "Speed: 136.6ms track, 16.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "563: 674x1280 15.9ms\n", - "Speed: 193.7ms track, 15.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "564: 674x1280 31.8ms\n", - "Speed: 93.2ms track, 31.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "565: 674x1280 7.5ms\n", - "Speed: 155.7ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "566: 674x1280 4.2ms\n", - "Speed: 66.2ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "567: 674x1280 4.1ms\n", - "Speed: 51.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "568: 674x1280 4.6ms\n", - "Speed: 50.5ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "569: 674x1280 4.4ms\n", - "Speed: 50.9ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "570: 674x1280 4.5ms\n", - "Speed: 51.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "571: 674x1280 4.9ms\n", - "Speed: 51.5ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "572: 674x1280 4.2ms\n", - "Speed: 50.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "573: 674x1280 5.0ms\n", - "Speed: 52.5ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "574: 674x1280 4.0ms\n", - "Speed: 52.5ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "575: 674x1280 4.1ms\n", - "Speed: 52.5ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "576: 674x1280 4.1ms\n", - "Speed: 53.2ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "577: 674x1280 4.6ms\n", - "Speed: 53.0ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "578: 674x1280 4.2ms\n", - "Speed: 51.2ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "579: 674x1280 4.8ms\n", - "Speed: 56.5ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "580: 674x1280 4.9ms\n", - "Speed: 55.8ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "581: 674x1280 5.4ms\n", - "Speed: 51.9ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "582: 674x1280 4.8ms\n", - "Speed: 53.1ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "583: 674x1280 4.1ms\n", - "Speed: 50.8ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "584: 674x1280 4.8ms\n", - "Speed: 52.2ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "585: 674x1280 4.6ms\n", - "Speed: 50.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "586: 674x1280 4.6ms\n", - "Speed: 50.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "587: 674x1280 4.6ms\n", - "Speed: 52.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "588: 674x1280 5.0ms\n", - "Speed: 56.0ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "589: 674x1280 4.6ms\n", - "Speed: 51.0ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "590: 674x1280 4.6ms\n", - "Speed: 50.9ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "591: 674x1280 4.0ms\n", - "Speed: 49.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "592: 674x1280 4.9ms\n", - "Speed: 50.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "593: 674x1280 3.4ms\n", - "Speed: 49.7ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "594: 674x1280 3.6ms\n", - "Speed: 49.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "595: 674x1280 3.6ms\n", - "Speed: 49.7ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "596: 674x1280 3.5ms\n", - "Speed: 51.0ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "597: 674x1280 3.6ms\n", - "Speed: 51.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "598: 674x1280 3.7ms\n", - "Speed: 50.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "599: 674x1280 3.8ms\n", - "Speed: 50.4ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "600: 674x1280 3.8ms\n", - "Speed: 50.2ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "601: 674x1280 3.9ms\n", - "Speed: 51.0ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "602: 674x1280 3.7ms\n", - "Speed: 50.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "603: 674x1280 3.6ms\n", - "Speed: 53.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "604: 674x1280 4.1ms\n", - "Speed: 57.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "605: 674x1280 4.5ms\n", - "Speed: 53.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "606: 674x1280 4.3ms\n", - "Speed: 53.4ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "607: 674x1280 4.1ms\n", - "Speed: 50.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "608: 674x1280 3.7ms\n", - "Speed: 50.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "609: 674x1280 3.6ms\n", - "Speed: 51.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "610: 674x1280 3.6ms\n", - "Speed: 49.6ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "611: 674x1280 3.7ms\n", - "Speed: 50.7ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "612: 674x1280 4.4ms\n", - "Speed: 52.3ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "613: 674x1280 4.0ms\n", - "Speed: 52.1ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "614: 674x1280 4.0ms\n", - "Speed: 51.8ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "615: 674x1280 3.9ms\n", - "Speed: 50.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "616: 674x1280 4.0ms\n", - "Speed: 50.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "617: 674x1280 4.1ms\n", - "Speed: 51.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "618: 674x1280 4.0ms\n", - "Speed: 50.0ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "619: 674x1280 4.0ms\n", - "Speed: 50.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "620: 674x1280 3.9ms\n", - "Speed: 52.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "621: 674x1280 3.7ms\n", - "Speed: 49.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "622: 674x1280 3.6ms\n", - "Speed: 49.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "623: 674x1280 3.6ms\n", - "Speed: 49.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "624: 674x1280 3.6ms\n", - "Speed: 49.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "625: 674x1280 3.7ms\n", - "Speed: 50.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "626: 674x1280 3.6ms\n", - "Speed: 49.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "627: 674x1280 3.6ms\n", - "Speed: 50.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "628: 674x1280 3.7ms\n", - "Speed: 49.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "629: 674x1280 3.9ms\n", - "Speed: 49.3ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "630: 674x1280 3.6ms\n", - "Speed: 51.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "631: 674x1280 3.6ms\n", - "Speed: 47.9ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "632: 674x1280 3.5ms\n", - "Speed: 48.3ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "633: 674x1280 3.5ms\n", - "Speed: 48.7ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "634: 674x1280 7.3ms\n", - "Speed: 63.4ms track, 7.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "635: 674x1280 3.7ms\n", - "Speed: 48.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "636: 674x1280 3.9ms\n", - "Speed: 54.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "637: 674x1280 4.1ms\n", - "Speed: 48.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "638: 674x1280 4.0ms\n", - "Speed: 49.6ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "639: 674x1280 4.0ms\n", - "Speed: 47.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "640: 674x1280 4.1ms\n", - "Speed: 47.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "641: 674x1280 3.6ms\n", - "Speed: 46.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "642: 674x1280 4.5ms\n", - "Speed: 46.9ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "643: 674x1280 3.6ms\n", - "Speed: 48.2ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "644: 674x1280 3.8ms\n", - "Speed: 47.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "645: 674x1280 3.7ms\n", - "Speed: 46.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "646: 674x1280 3.8ms\n", - "Speed: 47.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "647: 674x1280 3.7ms\n", - "Speed: 47.5ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "648: 674x1280 3.7ms\n", - "Speed: 46.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "649: 674x1280 3.7ms\n", - "Speed: 47.5ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "650: 674x1280 3.7ms\n", - "Speed: 46.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "651: 674x1280 3.6ms\n", - "Speed: 45.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "652: 674x1280 3.6ms\n", - "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "653: 674x1280 3.8ms\n", - "Speed: 53.6ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "654: 674x1280 3.7ms\n", - "Speed: 46.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "655: 674x1280 3.7ms\n", - "Speed: 47.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "656: 674x1280 3.6ms\n", - "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "657: 674x1280 3.5ms\n", - "Speed: 45.7ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "658: 674x1280 3.7ms\n", - "Speed: 46.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "659: 674x1280 3.6ms\n", - "Speed: 48.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "660: 674x1280 5.5ms\n", - "Speed: 46.5ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "661: 674x1280 4.3ms\n", - "Speed: 49.0ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "662: 674x1280 3.7ms\n", - "Speed: 47.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "663: 674x1280 3.7ms\n", - "Speed: 48.1ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "664: 674x1280 3.4ms\n", - "Speed: 46.4ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "665: 674x1280 4.1ms\n", - "Speed: 48.3ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "666: 674x1280 3.9ms\n", - "Speed: 48.4ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "667: 674x1280 3.7ms\n", - "Speed: 47.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "668: 674x1280 3.6ms\n", - "Speed: 48.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "669: 674x1280 3.8ms\n", - "Speed: 48.2ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "670: 674x1280 3.8ms\n", - "Speed: 54.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "671: 674x1280 3.7ms\n", - "Speed: 48.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "672: 674x1280 3.6ms\n", - "Speed: 47.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "673: 674x1280 3.9ms\n", - "Speed: 47.2ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "674: 674x1280 3.7ms\n", - "Speed: 46.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "675: 674x1280 3.6ms\n", - "Speed: 47.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "676: 674x1280 3.6ms\n", - "Speed: 47.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "677: 674x1280 3.6ms\n", - "Speed: 46.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "678: 674x1280 3.4ms\n", - "Speed: 46.4ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "679: 674x1280 3.7ms\n", - "Speed: 46.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "680: 674x1280 3.8ms\n", - "Speed: 47.9ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "681: 674x1280 3.7ms\n", - "Speed: 45.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "682: 674x1280 3.6ms\n", - "Speed: 45.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "683: 674x1280 3.8ms\n", - "Speed: 45.4ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "684: 674x1280 3.6ms\n", - "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "685: 674x1280 3.6ms\n", - "Speed: 45.2ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "686: 674x1280 3.8ms\n", - "Speed: 48.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "687: 674x1280 3.9ms\n", - "Speed: 57.1ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "688: 674x1280 4.2ms\n", - "Speed: 45.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "689: 674x1280 4.0ms\n", - "Speed: 46.1ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "690: 674x1280 3.9ms\n", - "Speed: 46.8ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "691: 674x1280 4.2ms\n", - "Speed: 50.1ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "692: 674x1280 3.6ms\n", - "Speed: 46.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "693: 674x1280 5.1ms\n", - "Speed: 45.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "694: 674x1280 4.1ms\n", - "Speed: 54.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "695: 674x1280 3.7ms\n", - "Speed: 45.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "696: 674x1280 3.7ms\n", - "Speed: 47.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "697: 674x1280 3.6ms\n", - "Speed: 45.7ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "698: 674x1280 4.0ms\n", - "Speed: 46.1ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "699: 674x1280 3.8ms\n", - "Speed: 47.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "700: 674x1280 3.8ms\n", - "Speed: 46.5ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "701: 674x1280 3.7ms\n", - "Speed: 46.7ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "702: 674x1280 3.6ms\n", - "Speed: 46.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "703: 674x1280 4.0ms\n", - "Speed: 47.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "704: 674x1280 3.9ms\n", - "Speed: 57.6ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "705: 674x1280 3.6ms\n", - "Speed: 49.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "706: 674x1280 3.9ms\n", - "Speed: 45.0ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "707: 674x1280 3.5ms\n", - "Speed: 44.5ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "708: 674x1280 3.6ms\n", - "Speed: 44.7ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "709: 674x1280 3.7ms\n", - "Speed: 46.2ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "710: 674x1280 3.8ms\n", - "Speed: 45.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "711: 674x1280 3.7ms\n", - "Speed: 45.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "712: 674x1280 3.6ms\n", - "Speed: 46.2ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "713: 674x1280 4.4ms\n", - "Speed: 45.6ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "714: 674x1280 3.7ms\n", - "Speed: 46.1ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "715: 674x1280 3.7ms\n", - "Speed: 46.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "716: 674x1280 3.7ms\n", - "Speed: 47.1ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "717: 674x1280 3.2ms\n", - "Speed: 45.0ms track, 3.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "718: 674x1280 3.2ms\n", - "Speed: 45.6ms track, 3.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "719: 674x1280 3.8ms\n", - "Speed: 46.5ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "720: 674x1280 3.6ms\n", - "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "721: 674x1280 6.2ms\n", - "Speed: 51.8ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "722: 674x1280 4.1ms\n", - "Speed: 54.1ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "723: 674x1280 4.2ms\n", - "Speed: 46.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "724: 674x1280 4.1ms\n", - "Speed: 46.8ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "725: 674x1280 4.7ms\n", - "Speed: 46.3ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "726: 674x1280 7.1ms\n", - "Speed: 72.7ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "727: 674x1280 6.7ms\n", - "Speed: 62.7ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "728: 674x1280 6.8ms\n", - "Speed: 64.5ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "729: 674x1280 6.7ms\n", - "Speed: 63.1ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "730: 674x1280 6.3ms\n", - "Speed: 66.1ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "731: 674x1280 7.3ms\n", - "Speed: 65.6ms track, 7.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "732: 674x1280 6.7ms\n", - "Speed: 64.7ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "733: 674x1280 6.9ms\n", - "Speed: 64.5ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "734: 674x1280 7.1ms\n", - "Speed: 67.9ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "735: 674x1280 6.8ms\n", - "Speed: 65.9ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "736: 674x1280 7.4ms\n", - "Speed: 66.3ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "737: 674x1280 5.7ms\n", - "Speed: 69.4ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "738: 674x1280 5.6ms\n", - "Speed: 65.8ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "739: 674x1280 5.7ms\n", - "Speed: 67.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "740: 674x1280 6.9ms\n", - "Speed: 65.8ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "741: 674x1280 6.5ms\n", - "Speed: 65.3ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "742: 674x1280 6.7ms\n", - "Speed: 67.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "743: 674x1280 6.6ms\n", - "Speed: 67.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "744: 674x1280 6.6ms\n", - "Speed: 69.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "745: 674x1280 5.9ms\n", - "Speed: 66.7ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "746: 674x1280 6.6ms\n", - "Speed: 73.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "747: 674x1280 6.2ms\n", - "Speed: 68.9ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "748: 674x1280 6.5ms\n", - "Speed: 72.1ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "749: 674x1280 6.2ms\n", - "Speed: 67.4ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "750: 674x1280 7.1ms\n", - "Speed: 67.2ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "751: 674x1280 3.9ms\n", - "Speed: 51.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "752: 674x1280 5.2ms\n", - "Speed: 52.7ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "753: 674x1280 3.7ms\n", - "Speed: 50.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "754: 674x1280 3.7ms\n", - "Speed: 51.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "755: 674x1280 3.6ms\n", - "Speed: 50.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "756: 674x1280 4.1ms\n", - "Speed: 51.0ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "757: 674x1280 4.1ms\n", - "Speed: 50.4ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "758: 674x1280 4.2ms\n", - "Speed: 50.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "759: 674x1280 4.2ms\n", - "Speed: 49.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "760: 674x1280 4.2ms\n", - "Speed: 53.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "761: 674x1280 4.8ms\n", - "Speed: 51.1ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "762: 674x1280 4.2ms\n", - "Speed: 52.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "763: 674x1280 4.1ms\n", - "Speed: 49.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "764: 674x1280 4.1ms\n", - "Speed: 50.1ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "765: 674x1280 4.7ms\n", - "Speed: 50.2ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "766: 674x1280 4.3ms\n", - "Speed: 50.8ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "767: 674x1280 4.1ms\n", - "Speed: 51.4ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "768: 674x1280 4.2ms\n", - "Speed: 50.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "769: 674x1280 4.2ms\n", - "Speed: 51.0ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "770: 674x1280 4.3ms\n", - "Speed: 50.6ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "771: 674x1280 4.9ms\n", - "Speed: 52.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "772: 674x1280 4.6ms\n", - "Speed: 51.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "773: 674x1280 4.4ms\n", - "Speed: 52.8ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "774: 674x1280 3.7ms\n", - "Speed: 50.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "775: 674x1280 6.2ms\n", - "Speed: 54.1ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "776: 674x1280 3.8ms\n", - "Speed: 50.1ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "777: 674x1280 4.1ms\n", - "Speed: 49.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "778: 674x1280 3.8ms\n", - "Speed: 49.5ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "779: 674x1280 3.9ms\n", - "Speed: 49.9ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "780: 674x1280 3.7ms\n", - "Speed: 50.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "781: 674x1280 3.8ms\n", - "Speed: 49.9ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "782: 674x1280 3.8ms\n", - "Speed: 50.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "783: 674x1280 3.7ms\n", - "Speed: 51.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "784: 674x1280 3.7ms\n", - "Speed: 50.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "785: 674x1280 3.9ms\n", - "Speed: 51.5ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "786: 674x1280 4.0ms\n", - "Speed: 51.4ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "787: 674x1280 4.0ms\n", - "Speed: 51.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "788: 674x1280 4.0ms\n", - "Speed: 53.0ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "789: 674x1280 4.1ms\n", - "Speed: 51.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "790: 674x1280 3.8ms\n", - "Speed: 50.8ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "791: 674x1280 6.8ms\n", - "Speed: 56.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "792: 674x1280 3.7ms\n", - "Speed: 51.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "793: 674x1280 3.8ms\n", - "Speed: 50.7ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "794: 674x1280 3.7ms\n", - "Speed: 51.2ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "795: 674x1280 3.8ms\n", - "Speed: 51.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "796: 674x1280 3.7ms\n", - "Speed: 51.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "797: 674x1280 3.9ms\n", - "Speed: 51.3ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "798: 674x1280 3.9ms\n", - "Speed: 52.9ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "799: 674x1280 3.8ms\n", - "Speed: 51.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "800: 674x1280 3.9ms\n", - "Speed: 50.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "801: 674x1280 3.6ms\n", - "Speed: 50.9ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "802: 674x1280 3.7ms\n", - "Speed: 50.7ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "803: 674x1280 3.9ms\n", - "Speed: 51.3ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "804: 674x1280 3.7ms\n", - "Speed: 52.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "805: 674x1280 3.8ms\n", - "Speed: 50.6ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "806: 674x1280 3.6ms\n", - "Speed: 50.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "807: 674x1280 3.7ms\n", - "Speed: 62.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "808: 674x1280 3.4ms\n", - "Speed: 51.8ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "809: 674x1280 4.0ms\n", - "Speed: 50.7ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "810: 674x1280 4.7ms\n", - "Speed: 50.5ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "811: 674x1280 3.8ms\n", - "Speed: 49.7ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "812: 674x1280 3.7ms\n", - "Speed: 48.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "813: 674x1280 5.1ms\n", - "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "814: 674x1280 4.0ms\n", - "Speed: 48.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", - "\n", - "Video frame is empty or video processing has been successfully completed.\n" - ] - } - ] + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.69M/5.69M [00:00<00:00, 41.1MB/s]\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Set Region Coordinates\n", + "\n", + "In this step, we define the coordinates of the area to be monitored, enabling precise object tracking and efficient queue management within the video or stream. This ensures effective monitoring of objects across designated zones." + ], + "metadata": { + "id": "3wJlBXORXNsj" + } + }, + { + "cell_type": "code", + "source": [ + "# For rectangle region counting\n", + "queue_region = [\n", + " (57, 271),\n", + " (295, 669),\n", + " (879, 521),\n", + " (315, 215),\n", + "]\n", + "\n", + "# For polygon region counting\n", + "# queue_region = [\n", + "# (20, 400),\n", + "# (1080, 400),\n", + "# (1080, 360),\n", + "# (20, 360),\n", + "# (20, 400)\n", + "# ]" + ], + "metadata": { + "id": "bVCrrForXRgS" + }, + "execution_count": 12, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Initialize the QueueManager Class\n", + "\n", + "Now, let's initialize the `QueueManager` class to detect and monitor objects in every frame of the video." + ], + "metadata": { + "id": "rt3soEHzXe8c" + } + }, + { + "cell_type": "code", + "source": [ + "# Init ObjectCounter\n", + "queuemanager = solutions.QueueManager(\n", + " show=True, # Display the output\n", + " region=queue_region, # Pass region points\n", + " model=\"yolo11m.pt\", # model=\"yolo11n-obb.pt\" for object counting using YOLO11 OBB model.\n", + " classes=[0], # If you want to count specific classes i.e person COCO pretrained model.\n", + " line_width=3, # Adjust the line width for bounding boxes and text display\n", + ")" + ], + "metadata": { + "id": "Va24DpUZXTh3", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "25feb631-7394-4e03-fbca-cf0eaac530a8" + }, + "execution_count": 15, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "\"queue-management-asset\"" - ], - "metadata": { - "id": "bWskbLSKH2S5" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics Solutions: ✅ {'source': None, 'model': 'yolo11m.pt', 'classes': [0], 'show_conf': True, 'show_labels': True, 'region': [(57, 271), (295, 669), (879, 521), (315, 215)], 'colormap': 21, 'show_in': True, 'show_out': True, 'up_angle': 145.0, 'down_angle': 90, 'kpts': [6, 8, 10], 'analytics_type': 'line', 'figsize': (12.8, 7.2), 'blur_ratio': 0.5, 'vision_point': (20, 20), 'crop_dir': 'cropped-detections', 'json_file': None, 'line_width': 3, 'records': 5, 'fps': 30.0, 'max_hist': 5, 'meter_per_pixel': 0.05, 'max_speed': 120, 'show': True, 'iou': 0.7, 'conf': 0.25, 'device': None, 'max_det': 300, 'half': False, 'tracker': 'botsort.yaml', 'verbose': True, 'data': 'images'}\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Process Video Frames\n", + "\n", + "In this step, we process each frame of the video to detect and analyze objects, enabling real-time tracking and queue management based on the visual data within the frames." + ], + "metadata": { + "id": "1ewYRFFqXvtj" + } + }, + { + "cell_type": "code", + "source": [ + "# Process video\n", + "while cap.isOpened():\n", + " success, im0 = cap.read()\n", + " if not success:\n", + " print(\"Video frame is empty or video processing has been successfully completed.\")\n", + " break\n", + " results = queuemanager(im0) # queue management\n", + " video_writer.write(results.plot_im) # write the video frames\n", + "\n", + "cap.release() # Release the capture\n", + "video_writer.release()" + ], + "metadata": { + "id": "PVf1pyRtXijz", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "a7710323-2ed5-43fb-8ecf-dcb08111e2ed" + }, + "execution_count": 16, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "bwBUa5kZyZ2k" - }, - "source": [ - "Crafted with 💙 by [Ultralytics](https://ultralytics.com/) \n", - "\n", - "Explore and star the [Ultralytics Notebooks](https://github.com/ultralytics/notebooks/) to supercharge your AI journey! 🚀" - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "0: 674x1280 5.1ms\n", + "Speed: 478.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "1: 674x1280 6.0ms\n", + "Speed: 51.4ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "2: 674x1280 6.1ms\n", + "Speed: 50.7ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "3: 674x1280 6.9ms\n", + "Speed: 51.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "4: 674x1280 6.6ms\n", + "Speed: 51.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "5: 674x1280 6.3ms\n", + "Speed: 50.9ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "6: 674x1280 6.5ms\n", + "Speed: 50.7ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "7: 674x1280 6.5ms\n", + "Speed: 57.0ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "8: 674x1280 5.8ms\n", + "Speed: 52.3ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "9: 674x1280 6.7ms\n", + "Speed: 53.3ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "10: 674x1280 5.9ms\n", + "Speed: 52.0ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "11: 674x1280 5.6ms\n", + "Speed: 52.5ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "12: 674x1280 5.4ms\n", + "Speed: 50.2ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "13: 674x1280 5.6ms\n", + "Speed: 50.4ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "14: 674x1280 5.6ms\n", + "Speed: 50.9ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "15: 674x1280 5.8ms\n", + "Speed: 61.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "16: 674x1280 5.4ms\n", + "Speed: 51.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "17: 674x1280 5.5ms\n", + "Speed: 50.8ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "18: 674x1280 5.9ms\n", + "Speed: 51.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "19: 674x1280 5.9ms\n", + "Speed: 50.8ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "20: 674x1280 5.6ms\n", + "Speed: 51.8ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "21: 674x1280 5.9ms\n", + "Speed: 50.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "22: 674x1280 6.5ms\n", + "Speed: 52.5ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "23: 674x1280 6.2ms\n", + "Speed: 51.0ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "24: 674x1280 10.6ms\n", + "Speed: 69.9ms track, 10.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "25: 674x1280 9.9ms\n", + "Speed: 72.9ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "26: 674x1280 9.9ms\n", + "Speed: 67.9ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "27: 674x1280 8.5ms\n", + "Speed: 68.9ms track, 8.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "28: 674x1280 10.2ms\n", + "Speed: 70.1ms track, 10.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "29: 674x1280 9.2ms\n", + "Speed: 67.5ms track, 9.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "30: 674x1280 9.0ms\n", + "Speed: 68.8ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "31: 674x1280 9.8ms\n", + "Speed: 68.4ms track, 9.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "32: 674x1280 9.0ms\n", + "Speed: 70.8ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "33: 674x1280 8.6ms\n", + "Speed: 71.1ms track, 8.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "34: 674x1280 9.4ms\n", + "Speed: 68.7ms track, 9.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "35: 674x1280 10.0ms\n", + "Speed: 67.6ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "36: 674x1280 9.0ms\n", + "Speed: 67.1ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "37: 674x1280 9.5ms\n", + "Speed: 65.9ms track, 9.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "38: 674x1280 10.6ms\n", + "Speed: 65.7ms track, 10.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "39: 674x1280 11.5ms\n", + "Speed: 69.7ms track, 11.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "40: 674x1280 10.8ms\n", + "Speed: 67.1ms track, 10.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "41: 674x1280 11.2ms\n", + "Speed: 66.5ms track, 11.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "42: 674x1280 11.7ms\n", + "Speed: 65.7ms track, 11.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "43: 674x1280 14.3ms\n", + "Speed: 69.6ms track, 14.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "44: 674x1280 12.0ms\n", + "Speed: 67.3ms track, 12.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "45: 674x1280 13.3ms\n", + "Speed: 67.4ms track, 13.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "46: 674x1280 11.9ms\n", + "Speed: 68.2ms track, 11.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "47: 674x1280 6.5ms\n", + "Speed: 55.0ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "48: 674x1280 6.5ms\n", + "Speed: 49.9ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "49: 674x1280 7.1ms\n", + "Speed: 50.2ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "50: 674x1280 6.9ms\n", + "Speed: 49.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "51: 674x1280 9.2ms\n", + "Speed: 61.4ms track, 9.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "52: 674x1280 6.0ms\n", + "Speed: 49.6ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "53: 674x1280 6.1ms\n", + "Speed: 50.1ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "54: 674x1280 6.2ms\n", + "Speed: 50.2ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "55: 674x1280 6.0ms\n", + "Speed: 49.6ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "56: 674x1280 5.9ms\n", + "Speed: 49.4ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "57: 674x1280 6.4ms\n", + "Speed: 51.1ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "58: 674x1280 7.0ms\n", + "Speed: 50.9ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "59: 674x1280 7.4ms\n", + "Speed: 51.1ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "60: 674x1280 7.5ms\n", + "Speed: 51.8ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "61: 674x1280 7.1ms\n", + "Speed: 50.9ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "62: 674x1280 6.1ms\n", + "Speed: 50.9ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "63: 674x1280 5.9ms\n", + "Speed: 51.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "64: 674x1280 6.0ms\n", + "Speed: 53.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "65: 674x1280 6.1ms\n", + "Speed: 52.9ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "66: 674x1280 6.1ms\n", + "Speed: 51.0ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "67: 674x1280 6.0ms\n", + "Speed: 52.0ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "68: 674x1280 6.1ms\n", + "Speed: 50.7ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "69: 674x1280 5.9ms\n", + "Speed: 50.4ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "70: 674x1280 5.9ms\n", + "Speed: 51.2ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "71: 674x1280 6.1ms\n", + "Speed: 50.7ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "72: 674x1280 6.1ms\n", + "Speed: 51.1ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "73: 674x1280 6.0ms\n", + "Speed: 50.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "74: 674x1280 6.2ms\n", + "Speed: 50.1ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "75: 674x1280 6.5ms\n", + "Speed: 50.8ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "76: 674x1280 6.0ms\n", + "Speed: 51.2ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "77: 674x1280 6.0ms\n", + "Speed: 50.7ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "78: 674x1280 6.1ms\n", + "Speed: 51.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "79: 674x1280 6.9ms\n", + "Speed: 51.4ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "80: 674x1280 6.4ms\n", + "Speed: 51.7ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "81: 674x1280 7.5ms\n", + "Speed: 55.0ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "82: 674x1280 6.4ms\n", + "Speed: 60.1ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "83: 674x1280 6.8ms\n", + "Speed: 50.1ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "84: 674x1280 6.9ms\n", + "Speed: 50.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "85: 674x1280 6.9ms\n", + "Speed: 49.9ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "86: 674x1280 7.0ms\n", + "Speed: 50.4ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "87: 674x1280 7.1ms\n", + "Speed: 51.2ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "88: 674x1280 7.1ms\n", + "Speed: 51.3ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "89: 674x1280 8.3ms\n", + "Speed: 50.8ms track, 8.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "90: 674x1280 7.2ms\n", + "Speed: 52.2ms track, 7.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "91: 674x1280 6.7ms\n", + "Speed: 50.6ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "92: 674x1280 7.0ms\n", + "Speed: 50.7ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "93: 674x1280 7.0ms\n", + "Speed: 51.8ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "94: 674x1280 6.7ms\n", + "Speed: 50.6ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "95: 674x1280 7.4ms\n", + "Speed: 51.7ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "96: 674x1280 6.6ms\n", + "Speed: 53.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "97: 674x1280 6.6ms\n", + "Speed: 63.6ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "98: 674x1280 7.4ms\n", + "Speed: 51.4ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "99: 674x1280 6.3ms\n", + "Speed: 51.5ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "100: 674x1280 6.7ms\n", + "Speed: 51.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "101: 674x1280 7.5ms\n", + "Speed: 52.2ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "102: 674x1280 6.5ms\n", + "Speed: 52.1ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "103: 674x1280 6.3ms\n", + "Speed: 52.5ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "104: 674x1280 6.2ms\n", + "Speed: 52.1ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "105: 674x1280 6.4ms\n", + "Speed: 51.9ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "106: 674x1280 6.1ms\n", + "Speed: 51.3ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "107: 674x1280 5.8ms\n", + "Speed: 51.4ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "108: 674x1280 6.0ms\n", + "Speed: 51.8ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "109: 674x1280 5.9ms\n", + "Speed: 51.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "110: 674x1280 6.4ms\n", + "Speed: 52.2ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "111: 674x1280 6.6ms\n", + "Speed: 51.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "112: 674x1280 10.2ms\n", + "Speed: 60.9ms track, 10.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "113: 674x1280 6.4ms\n", + "Speed: 53.1ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "114: 674x1280 6.6ms\n", + "Speed: 53.5ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "115: 674x1280 6.3ms\n", + "Speed: 52.2ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "116: 674x1280 6.8ms\n", + "Speed: 54.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "117: 674x1280 7.4ms\n", + "Speed: 53.6ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "118: 674x1280 6.1ms\n", + "Speed: 52.9ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "119: 674x1280 14.9ms\n", + "Speed: 52.7ms track, 14.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "120: 674x1280 6.4ms\n", + "Speed: 52.3ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "121: 674x1280 7.9ms\n", + "Speed: 51.5ms track, 7.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "122: 674x1280 5.9ms\n", + "Speed: 53.9ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "123: 674x1280 6.1ms\n", + "Speed: 52.5ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "124: 674x1280 6.7ms\n", + "Speed: 56.1ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "125: 674x1280 6.3ms\n", + "Speed: 53.1ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "126: 674x1280 6.0ms\n", + "Speed: 52.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "127: 674x1280 6.3ms\n", + "Speed: 58.1ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "128: 674x1280 6.6ms\n", + "Speed: 53.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "129: 674x1280 6.2ms\n", + "Speed: 54.0ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "130: 674x1280 6.8ms\n", + "Speed: 56.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "131: 674x1280 6.2ms\n", + "Speed: 53.8ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "132: 674x1280 6.3ms\n", + "Speed: 52.7ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "133: 674x1280 7.0ms\n", + "Speed: 52.2ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "134: 674x1280 5.8ms\n", + "Speed: 52.3ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "135: 674x1280 6.2ms\n", + "Speed: 53.3ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "136: 674x1280 6.1ms\n", + "Speed: 53.4ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "137: 674x1280 6.2ms\n", + "Speed: 53.2ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "138: 674x1280 6.6ms\n", + "Speed: 53.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "139: 674x1280 6.2ms\n", + "Speed: 54.8ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "140: 674x1280 6.5ms\n", + "Speed: 52.7ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "141: 674x1280 6.3ms\n", + "Speed: 52.3ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "142: 674x1280 6.3ms\n", + "Speed: 53.9ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "143: 674x1280 6.4ms\n", + "Speed: 53.0ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "144: 674x1280 6.3ms\n", + "Speed: 53.6ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "145: 674x1280 6.7ms\n", + "Speed: 53.2ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "146: 674x1280 6.3ms\n", + "Speed: 52.4ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "147: 674x1280 6.9ms\n", + "Speed: 50.9ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "148: 674x1280 6.7ms\n", + "Speed: 50.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "149: 674x1280 6.7ms\n", + "Speed: 51.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "150: 674x1280 6.9ms\n", + "Speed: 52.1ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "151: 674x1280 6.7ms\n", + "Speed: 53.2ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "152: 674x1280 6.1ms\n", + "Speed: 51.4ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "153: 674x1280 6.3ms\n", + "Speed: 52.4ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "154: 674x1280 6.6ms\n", + "Speed: 52.0ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "155: 674x1280 6.6ms\n", + "Speed: 53.0ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "156: 674x1280 6.8ms\n", + "Speed: 52.7ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "157: 674x1280 6.8ms\n", + "Speed: 55.0ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "158: 674x1280 6.7ms\n", + "Speed: 52.4ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "159: 674x1280 7.2ms\n", + "Speed: 53.4ms track, 7.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "160: 674x1280 7.0ms\n", + "Speed: 52.1ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "161: 674x1280 6.6ms\n", + "Speed: 51.2ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "162: 674x1280 6.7ms\n", + "Speed: 51.9ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "163: 674x1280 6.9ms\n", + "Speed: 52.0ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "164: 674x1280 7.1ms\n", + "Speed: 51.1ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "165: 674x1280 6.6ms\n", + "Speed: 52.4ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "166: 674x1280 6.6ms\n", + "Speed: 51.1ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "167: 674x1280 6.1ms\n", + "Speed: 50.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "168: 674x1280 5.5ms\n", + "Speed: 54.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "169: 674x1280 5.4ms\n", + "Speed: 50.9ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "170: 674x1280 5.6ms\n", + "Speed: 50.6ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "171: 674x1280 5.6ms\n", + "Speed: 50.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "172: 674x1280 6.2ms\n", + "Speed: 55.9ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "173: 674x1280 5.7ms\n", + "Speed: 52.0ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "174: 674x1280 5.4ms\n", + "Speed: 52.1ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "175: 674x1280 5.7ms\n", + "Speed: 50.6ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "176: 674x1280 5.3ms\n", + "Speed: 49.9ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "177: 674x1280 5.5ms\n", + "Speed: 51.5ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "178: 674x1280 5.4ms\n", + "Speed: 50.3ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "179: 674x1280 5.6ms\n", + "Speed: 50.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "180: 674x1280 5.8ms\n", + "Speed: 50.4ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "181: 674x1280 6.0ms\n", + "Speed: 50.2ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "182: 674x1280 6.0ms\n", + "Speed: 50.0ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "183: 674x1280 7.6ms\n", + "Speed: 50.3ms track, 7.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "184: 674x1280 6.0ms\n", + "Speed: 52.9ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "185: 674x1280 5.5ms\n", + "Speed: 50.4ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "186: 674x1280 5.6ms\n", + "Speed: 50.5ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "187: 674x1280 9.9ms\n", + "Speed: 51.1ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "188: 674x1280 6.1ms\n", + "Speed: 50.4ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "189: 674x1280 6.1ms\n", + "Speed: 52.1ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "190: 674x1280 6.1ms\n", + "Speed: 51.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "191: 674x1280 5.6ms\n", + "Speed: 50.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "192: 674x1280 5.5ms\n", + "Speed: 50.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "193: 674x1280 5.6ms\n", + "Speed: 50.1ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "194: 674x1280 10.0ms\n", + "Speed: 68.4ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "195: 674x1280 9.6ms\n", + "Speed: 68.8ms track, 9.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "196: 674x1280 9.4ms\n", + "Speed: 69.0ms track, 9.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "197: 674x1280 9.3ms\n", + "Speed: 65.4ms track, 9.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "198: 674x1280 9.0ms\n", + "Speed: 67.5ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "199: 674x1280 10.4ms\n", + "Speed: 67.5ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "200: 674x1280 15.3ms\n", + "Speed: 70.8ms track, 15.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "201: 674x1280 8.9ms\n", + "Speed: 67.8ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "202: 674x1280 9.7ms\n", + "Speed: 65.9ms track, 9.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "203: 674x1280 8.7ms\n", + "Speed: 65.5ms track, 8.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "204: 674x1280 9.4ms\n", + "Speed: 65.9ms track, 9.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "205: 674x1280 8.0ms\n", + "Speed: 67.8ms track, 8.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "206: 674x1280 7.8ms\n", + "Speed: 68.2ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "207: 674x1280 8.4ms\n", + "Speed: 67.0ms track, 8.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "208: 674x1280 7.7ms\n", + "Speed: 65.2ms track, 7.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "209: 674x1280 8.2ms\n", + "Speed: 65.2ms track, 8.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "210: 674x1280 9.2ms\n", + "Speed: 66.9ms track, 9.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "211: 674x1280 10.0ms\n", + "Speed: 67.3ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "212: 674x1280 13.9ms\n", + "Speed: 69.9ms track, 13.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "213: 674x1280 9.9ms\n", + "Speed: 67.1ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "214: 674x1280 8.9ms\n", + "Speed: 68.1ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "215: 674x1280 10.3ms\n", + "Speed: 66.0ms track, 10.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "216: 674x1280 11.1ms\n", + "Speed: 68.3ms track, 11.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "217: 674x1280 11.0ms\n", + "Speed: 66.6ms track, 11.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "218: 674x1280 10.4ms\n", + "Speed: 68.6ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "219: 674x1280 10.0ms\n", + "Speed: 65.2ms track, 10.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "220: 674x1280 5.5ms\n", + "Speed: 52.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "221: 674x1280 5.9ms\n", + "Speed: 50.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "222: 674x1280 5.8ms\n", + "Speed: 50.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "223: 674x1280 5.8ms\n", + "Speed: 50.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "224: 674x1280 6.4ms\n", + "Speed: 49.5ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "225: 674x1280 6.6ms\n", + "Speed: 59.2ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "226: 674x1280 6.5ms\n", + "Speed: 49.7ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "227: 674x1280 6.9ms\n", + "Speed: 51.5ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "228: 674x1280 5.9ms\n", + "Speed: 50.8ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "229: 674x1280 6.0ms\n", + "Speed: 49.6ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "230: 674x1280 6.0ms\n", + "Speed: 49.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "231: 674x1280 5.7ms\n", + "Speed: 49.5ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "232: 674x1280 5.6ms\n", + "Speed: 50.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "233: 674x1280 5.1ms\n", + "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "234: 674x1280 5.8ms\n", + "Speed: 50.3ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "235: 674x1280 5.7ms\n", + "Speed: 49.8ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "236: 674x1280 5.4ms\n", + "Speed: 50.1ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "237: 674x1280 5.9ms\n", + "Speed: 50.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "238: 674x1280 5.3ms\n", + "Speed: 49.1ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "239: 674x1280 5.2ms\n", + "Speed: 52.0ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "240: 674x1280 5.2ms\n", + "Speed: 50.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "241: 674x1280 5.7ms\n", + "Speed: 52.6ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "242: 674x1280 5.6ms\n", + "Speed: 50.5ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "243: 674x1280 5.6ms\n", + "Speed: 49.9ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "244: 674x1280 5.4ms\n", + "Speed: 48.8ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "245: 674x1280 5.4ms\n", + "Speed: 49.7ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "246: 674x1280 5.8ms\n", + "Speed: 50.9ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "247: 674x1280 5.4ms\n", + "Speed: 49.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "248: 674x1280 5.6ms\n", + "Speed: 49.9ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "249: 674x1280 5.1ms\n", + "Speed: 49.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "250: 674x1280 5.1ms\n", + "Speed: 49.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "251: 674x1280 5.1ms\n", + "Speed: 49.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "252: 674x1280 5.1ms\n", + "Speed: 51.4ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "253: 674x1280 5.3ms\n", + "Speed: 50.2ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "254: 674x1280 5.3ms\n", + "Speed: 51.2ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "255: 674x1280 5.6ms\n", + "Speed: 54.2ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "256: 674x1280 10.5ms\n", + "Speed: 57.1ms track, 10.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "257: 674x1280 5.1ms\n", + "Speed: 51.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "258: 674x1280 5.0ms\n", + "Speed: 50.4ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "259: 674x1280 4.9ms\n", + "Speed: 50.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "260: 674x1280 5.0ms\n", + "Speed: 49.9ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "261: 674x1280 6.0ms\n", + "Speed: 50.4ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "262: 674x1280 5.1ms\n", + "Speed: 52.3ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "263: 674x1280 5.0ms\n", + "Speed: 50.4ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "264: 674x1280 5.1ms\n", + "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "265: 674x1280 4.6ms\n", + "Speed: 51.4ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "266: 674x1280 6.0ms\n", + "Speed: 50.4ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "267: 674x1280 5.1ms\n", + "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "268: 674x1280 5.1ms\n", + "Speed: 51.6ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "269: 674x1280 5.3ms\n", + "Speed: 50.8ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "270: 674x1280 5.2ms\n", + "Speed: 51.6ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "271: 674x1280 5.3ms\n", + "Speed: 51.1ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "272: 674x1280 5.7ms\n", + "Speed: 59.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "273: 674x1280 5.5ms\n", + "Speed: 51.5ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "274: 674x1280 5.9ms\n", + "Speed: 50.9ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "275: 674x1280 5.6ms\n", + "Speed: 50.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "276: 674x1280 5.5ms\n", + "Speed: 49.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "277: 674x1280 5.6ms\n", + "Speed: 51.1ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "278: 674x1280 5.5ms\n", + "Speed: 51.2ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "279: 674x1280 5.3ms\n", + "Speed: 49.8ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "280: 674x1280 5.5ms\n", + "Speed: 49.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "281: 674x1280 6.1ms\n", + "Speed: 51.2ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "282: 674x1280 5.5ms\n", + "Speed: 51.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "283: 674x1280 5.9ms\n", + "Speed: 52.1ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "284: 674x1280 5.9ms\n", + "Speed: 52.6ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "285: 674x1280 5.8ms\n", + "Speed: 52.8ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "286: 674x1280 6.2ms\n", + "Speed: 51.5ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "287: 674x1280 10.9ms\n", + "Speed: 59.2ms track, 10.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "288: 674x1280 5.2ms\n", + "Speed: 52.6ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "289: 674x1280 5.2ms\n", + "Speed: 51.9ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "290: 674x1280 5.3ms\n", + "Speed: 51.5ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "291: 674x1280 5.2ms\n", + "Speed: 52.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "292: 674x1280 5.0ms\n", + "Speed: 50.7ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "293: 674x1280 5.1ms\n", + "Speed: 51.6ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "294: 674x1280 5.3ms\n", + "Speed: 51.2ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "295: 674x1280 8.9ms\n", + "Speed: 52.9ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "296: 674x1280 10.7ms\n", + "Speed: 177.4ms track, 10.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "297: 674x1280 5.8ms\n", + "Speed: 78.2ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "298: 674x1280 5.2ms\n", + "Speed: 51.4ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "299: 674x1280 5.5ms\n", + "Speed: 64.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "300: 674x1280 5.0ms\n", + "Speed: 51.2ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "301: 674x1280 5.5ms\n", + "Speed: 51.1ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "302: 674x1280 5.4ms\n", + "Speed: 51.0ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "303: 674x1280 5.9ms\n", + "Speed: 50.8ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "304: 674x1280 7.3ms\n", + "Speed: 54.5ms track, 7.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "305: 674x1280 27.4ms\n", + "Speed: 145.0ms track, 27.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "306: 674x1280 12.6ms\n", + "Speed: 74.6ms track, 12.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "307: 674x1280 5.8ms\n", + "Speed: 51.9ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "308: 674x1280 6.0ms\n", + "Speed: 53.0ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "309: 674x1280 5.4ms\n", + "Speed: 51.4ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "310: 674x1280 5.6ms\n", + "Speed: 51.3ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "311: 674x1280 5.7ms\n", + "Speed: 63.4ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "312: 674x1280 5.5ms\n", + "Speed: 51.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "313: 674x1280 5.6ms\n", + "Speed: 51.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "314: 674x1280 6.0ms\n", + "Speed: 52.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "315: 674x1280 27.7ms\n", + "Speed: 188.0ms track, 27.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "316: 674x1280 6.0ms\n", + "Speed: 56.1ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "317: 674x1280 5.7ms\n", + "Speed: 52.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "318: 674x1280 5.9ms\n", + "Speed: 53.4ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "319: 674x1280 7.8ms\n", + "Speed: 52.3ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "320: 674x1280 5.1ms\n", + "Speed: 52.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "321: 674x1280 5.0ms\n", + "Speed: 50.1ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "322: 674x1280 5.1ms\n", + "Speed: 50.3ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "323: 674x1280 4.7ms\n", + "Speed: 56.7ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "324: 674x1280 5.1ms\n", + "Speed: 50.9ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "325: 674x1280 5.3ms\n", + "Speed: 50.7ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "326: 674x1280 5.4ms\n", + "Speed: 50.2ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "327: 674x1280 4.9ms\n", + "Speed: 51.0ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "328: 674x1280 4.9ms\n", + "Speed: 51.3ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "329: 674x1280 5.1ms\n", + "Speed: 50.0ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "330: 674x1280 5.2ms\n", + "Speed: 49.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "331: 674x1280 5.1ms\n", + "Speed: 49.4ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "332: 674x1280 5.0ms\n", + "Speed: 50.2ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "333: 674x1280 6.1ms\n", + "Speed: 49.8ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "334: 674x1280 5.0ms\n", + "Speed: 49.6ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "335: 674x1280 4.5ms\n", + "Speed: 49.8ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "336: 674x1280 4.5ms\n", + "Speed: 49.6ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "337: 674x1280 4.6ms\n", + "Speed: 50.9ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "338: 674x1280 4.4ms\n", + "Speed: 49.5ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "339: 674x1280 4.7ms\n", + "Speed: 53.6ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "340: 674x1280 4.5ms\n", + "Speed: 49.5ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "341: 674x1280 4.5ms\n", + "Speed: 50.8ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "342: 674x1280 4.9ms\n", + "Speed: 49.9ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "343: 674x1280 4.9ms\n", + "Speed: 49.6ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "344: 674x1280 5.5ms\n", + "Speed: 50.0ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "345: 674x1280 5.0ms\n", + "Speed: 49.0ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "346: 674x1280 5.0ms\n", + "Speed: 50.5ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "347: 674x1280 4.9ms\n", + "Speed: 49.0ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "348: 674x1280 5.0ms\n", + "Speed: 48.3ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "349: 674x1280 4.9ms\n", + "Speed: 49.3ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "350: 674x1280 4.9ms\n", + "Speed: 48.2ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "351: 674x1280 4.9ms\n", + "Speed: 47.9ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "352: 674x1280 4.9ms\n", + "Speed: 48.4ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "353: 674x1280 4.9ms\n", + "Speed: 47.8ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "354: 674x1280 4.9ms\n", + "Speed: 47.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "355: 674x1280 5.4ms\n", + "Speed: 59.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "356: 674x1280 5.5ms\n", + "Speed: 48.8ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "357: 674x1280 5.6ms\n", + "Speed: 49.0ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "358: 674x1280 5.0ms\n", + "Speed: 48.6ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "359: 674x1280 5.1ms\n", + "Speed: 50.3ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "360: 674x1280 5.1ms\n", + "Speed: 49.9ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "361: 674x1280 10.1ms\n", + "Speed: 64.2ms track, 10.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "362: 674x1280 8.9ms\n", + "Speed: 63.3ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "363: 674x1280 10.4ms\n", + "Speed: 64.7ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "364: 674x1280 9.8ms\n", + "Speed: 63.0ms track, 9.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "365: 674x1280 7.6ms\n", + "Speed: 62.2ms track, 7.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "366: 674x1280 8.4ms\n", + "Speed: 62.8ms track, 8.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "367: 674x1280 9.7ms\n", + "Speed: 68.5ms track, 9.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "368: 674x1280 8.9ms\n", + "Speed: 70.7ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "369: 674x1280 9.0ms\n", + "Speed: 69.2ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "370: 674x1280 8.3ms\n", + "Speed: 64.6ms track, 8.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "371: 674x1280 9.0ms\n", + "Speed: 64.6ms track, 9.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "372: 674x1280 8.5ms\n", + "Speed: 64.5ms track, 8.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "373: 674x1280 7.8ms\n", + "Speed: 63.5ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "374: 674x1280 7.8ms\n", + "Speed: 65.2ms track, 7.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "375: 674x1280 8.0ms\n", + "Speed: 65.1ms track, 8.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "376: 674x1280 8.3ms\n", + "Speed: 66.4ms track, 8.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "377: 674x1280 8.2ms\n", + "Speed: 64.4ms track, 8.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "378: 674x1280 9.9ms\n", + "Speed: 67.0ms track, 9.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "379: 674x1280 9.3ms\n", + "Speed: 69.8ms track, 9.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "380: 674x1280 8.5ms\n", + "Speed: 68.0ms track, 8.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "381: 674x1280 8.6ms\n", + "Speed: 65.3ms track, 8.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "382: 674x1280 10.2ms\n", + "Speed: 65.9ms track, 10.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "383: 674x1280 9.5ms\n", + "Speed: 68.6ms track, 9.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "384: 674x1280 9.6ms\n", + "Speed: 65.2ms track, 9.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "385: 674x1280 8.6ms\n", + "Speed: 65.6ms track, 8.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "386: 674x1280 10.4ms\n", + "Speed: 65.7ms track, 10.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "387: 674x1280 5.5ms\n", + "Speed: 51.8ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "388: 674x1280 5.7ms\n", + "Speed: 49.5ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "389: 674x1280 5.4ms\n", + "Speed: 50.8ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "390: 674x1280 5.8ms\n", + "Speed: 50.0ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "391: 674x1280 5.2ms\n", + "Speed: 49.2ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "392: 674x1280 4.9ms\n", + "Speed: 49.2ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "393: 674x1280 5.8ms\n", + "Speed: 49.0ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "394: 674x1280 4.6ms\n", + "Speed: 52.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "395: 674x1280 6.2ms\n", + "Speed: 49.0ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "396: 674x1280 4.7ms\n", + "Speed: 52.4ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "397: 674x1280 4.6ms\n", + "Speed: 49.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "398: 674x1280 4.5ms\n", + "Speed: 49.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "399: 674x1280 4.6ms\n", + "Speed: 48.8ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "400: 674x1280 4.5ms\n", + "Speed: 48.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "401: 674x1280 4.3ms\n", + "Speed: 48.6ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "402: 674x1280 4.2ms\n", + "Speed: 48.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "403: 674x1280 4.5ms\n", + "Speed: 49.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "404: 674x1280 4.0ms\n", + "Speed: 49.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "405: 674x1280 4.4ms\n", + "Speed: 48.7ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "406: 674x1280 4.5ms\n", + "Speed: 49.0ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "407: 674x1280 5.1ms\n", + "Speed: 48.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "408: 674x1280 4.7ms\n", + "Speed: 50.7ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "409: 674x1280 4.8ms\n", + "Speed: 50.1ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "410: 674x1280 5.9ms\n", + "Speed: 62.7ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "411: 674x1280 4.6ms\n", + "Speed: 50.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "412: 674x1280 4.6ms\n", + "Speed: 51.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "413: 674x1280 4.7ms\n", + "Speed: 49.3ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "414: 674x1280 4.6ms\n", + "Speed: 49.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "415: 674x1280 5.1ms\n", + "Speed: 49.5ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "416: 674x1280 6.0ms\n", + "Speed: 49.5ms track, 6.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "417: 674x1280 5.2ms\n", + "Speed: 48.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "418: 674x1280 6.7ms\n", + "Speed: 49.3ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "419: 674x1280 5.0ms\n", + "Speed: 48.9ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "420: 674x1280 5.0ms\n", + "Speed: 49.7ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "421: 674x1280 4.1ms\n", + "Speed: 49.3ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "422: 674x1280 4.1ms\n", + "Speed: 49.0ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "423: 674x1280 4.0ms\n", + "Speed: 48.3ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "424: 674x1280 4.0ms\n", + "Speed: 49.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "425: 674x1280 4.5ms\n", + "Speed: 48.9ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "426: 674x1280 5.2ms\n", + "Speed: 63.2ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "427: 674x1280 5.2ms\n", + "Speed: 50.5ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "428: 674x1280 4.7ms\n", + "Speed: 50.0ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "429: 674x1280 5.1ms\n", + "Speed: 50.9ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "430: 674x1280 5.0ms\n", + "Speed: 49.6ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "431: 674x1280 4.9ms\n", + "Speed: 49.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "432: 674x1280 4.5ms\n", + "Speed: 51.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "433: 674x1280 4.5ms\n", + "Speed: 50.5ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "434: 674x1280 4.9ms\n", + "Speed: 51.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "435: 674x1280 4.7ms\n", + "Speed: 51.3ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "436: 674x1280 5.1ms\n", + "Speed: 50.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "437: 674x1280 4.5ms\n", + "Speed: 51.9ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "438: 674x1280 4.6ms\n", + "Speed: 50.5ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "439: 674x1280 5.3ms\n", + "Speed: 51.5ms track, 5.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "440: 674x1280 5.8ms\n", + "Speed: 52.9ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "441: 674x1280 8.9ms\n", + "Speed: 61.7ms track, 8.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "442: 674x1280 4.8ms\n", + "Speed: 52.3ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "443: 674x1280 4.8ms\n", + "Speed: 51.2ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "444: 674x1280 4.9ms\n", + "Speed: 51.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "445: 674x1280 5.0ms\n", + "Speed: 50.8ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "446: 674x1280 5.1ms\n", + "Speed: 51.4ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "447: 674x1280 5.0ms\n", + "Speed: 51.5ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "448: 674x1280 5.1ms\n", + "Speed: 52.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "449: 674x1280 4.8ms\n", + "Speed: 53.5ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "450: 674x1280 5.7ms\n", + "Speed: 53.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "451: 674x1280 4.8ms\n", + "Speed: 52.5ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "452: 674x1280 5.2ms\n", + "Speed: 52.6ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "453: 674x1280 5.7ms\n", + "Speed: 52.6ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "454: 674x1280 4.7ms\n", + "Speed: 51.6ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "455: 674x1280 5.1ms\n", + "Speed: 51.1ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "456: 674x1280 5.8ms\n", + "Speed: 50.8ms track, 5.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "457: 674x1280 4.4ms\n", + "Speed: 54.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "458: 674x1280 4.4ms\n", + "Speed: 50.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "459: 674x1280 4.4ms\n", + "Speed: 49.5ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "460: 674x1280 4.4ms\n", + "Speed: 51.0ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "461: 674x1280 4.8ms\n", + "Speed: 49.8ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "462: 674x1280 4.3ms\n", + "Speed: 49.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "463: 674x1280 4.5ms\n", + "Speed: 50.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "464: 674x1280 4.3ms\n", + "Speed: 50.3ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "465: 674x1280 4.2ms\n", + "Speed: 49.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "466: 674x1280 4.4ms\n", + "Speed: 50.3ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "467: 674x1280 4.1ms\n", + "Speed: 50.9ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "468: 674x1280 4.2ms\n", + "Speed: 51.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "469: 674x1280 4.2ms\n", + "Speed: 50.0ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "470: 674x1280 4.3ms\n", + "Speed: 51.4ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "471: 674x1280 4.4ms\n", + "Speed: 51.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "472: 674x1280 4.7ms\n", + "Speed: 52.4ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "473: 674x1280 4.6ms\n", + "Speed: 57.0ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "474: 674x1280 4.6ms\n", + "Speed: 51.4ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "475: 674x1280 4.2ms\n", + "Speed: 50.3ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "476: 674x1280 4.4ms\n", + "Speed: 50.8ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "477: 674x1280 4.3ms\n", + "Speed: 51.2ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "478: 674x1280 4.3ms\n", + "Speed: 49.5ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "479: 674x1280 4.5ms\n", + "Speed: 51.7ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "480: 674x1280 4.3ms\n", + "Speed: 49.3ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "481: 674x1280 4.3ms\n", + "Speed: 50.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "482: 674x1280 4.3ms\n", + "Speed: 50.1ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "483: 674x1280 4.4ms\n", + "Speed: 50.7ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "484: 674x1280 4.2ms\n", + "Speed: 49.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "485: 674x1280 4.2ms\n", + "Speed: 50.3ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "486: 674x1280 4.2ms\n", + "Speed: 50.3ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "487: 674x1280 4.1ms\n", + "Speed: 51.5ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "488: 674x1280 4.4ms\n", + "Speed: 49.3ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "489: 674x1280 4.3ms\n", + "Speed: 50.8ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "490: 674x1280 4.2ms\n", + "Speed: 48.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "491: 674x1280 4.3ms\n", + "Speed: 49.2ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "492: 674x1280 4.5ms\n", + "Speed: 49.5ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "493: 674x1280 4.4ms\n", + "Speed: 49.9ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "494: 674x1280 4.5ms\n", + "Speed: 49.6ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "495: 674x1280 4.5ms\n", + "Speed: 50.8ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "496: 674x1280 4.4ms\n", + "Speed: 49.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "497: 674x1280 4.3ms\n", + "Speed: 48.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "498: 674x1280 4.2ms\n", + "Speed: 48.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "499: 674x1280 4.4ms\n", + "Speed: 48.5ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "500: 674x1280 4.3ms\n", + "Speed: 48.7ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "501: 674x1280 5.4ms\n", + "Speed: 49.6ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "502: 674x1280 5.5ms\n", + "Speed: 47.7ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "503: 674x1280 4.2ms\n", + "Speed: 48.1ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "504: 674x1280 4.4ms\n", + "Speed: 47.8ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "505: 674x1280 4.4ms\n", + "Speed: 59.4ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "506: 674x1280 4.1ms\n", + "Speed: 47.1ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "507: 674x1280 4.2ms\n", + "Speed: 46.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "508: 674x1280 4.3ms\n", + "Speed: 46.8ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "509: 674x1280 4.2ms\n", + "Speed: 46.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "510: 674x1280 4.4ms\n", + "Speed: 46.9ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "511: 674x1280 4.3ms\n", + "Speed: 48.9ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "512: 674x1280 4.2ms\n", + "Speed: 46.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "513: 674x1280 4.2ms\n", + "Speed: 47.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "514: 674x1280 4.2ms\n", + "Speed: 48.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "515: 674x1280 4.4ms\n", + "Speed: 45.1ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "516: 674x1280 4.2ms\n", + "Speed: 45.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "517: 674x1280 4.2ms\n", + "Speed: 45.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "518: 674x1280 4.4ms\n", + "Speed: 46.2ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "519: 674x1280 4.7ms\n", + "Speed: 46.2ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "520: 674x1280 4.2ms\n", + "Speed: 45.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "521: 674x1280 4.4ms\n", + "Speed: 45.1ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "522: 674x1280 4.5ms\n", + "Speed: 59.4ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "523: 674x1280 4.3ms\n", + "Speed: 47.0ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "524: 674x1280 4.2ms\n", + "Speed: 46.1ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "525: 674x1280 4.3ms\n", + "Speed: 48.1ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "526: 674x1280 4.1ms\n", + "Speed: 46.0ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "527: 674x1280 4.2ms\n", + "Speed: 46.4ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "528: 674x1280 4.2ms\n", + "Speed: 45.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "529: 674x1280 4.3ms\n", + "Speed: 49.2ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "530: 674x1280 4.2ms\n", + "Speed: 46.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "531: 674x1280 4.2ms\n", + "Speed: 45.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "532: 674x1280 4.2ms\n", + "Speed: 46.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "533: 674x1280 4.2ms\n", + "Speed: 45.7ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "534: 674x1280 4.9ms\n", + "Speed: 48.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "535: 674x1280 4.9ms\n", + "Speed: 47.8ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "536: 674x1280 4.8ms\n", + "Speed: 46.8ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "537: 674x1280 4.7ms\n", + "Speed: 46.5ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "538: 674x1280 4.7ms\n", + "Speed: 45.2ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "539: 674x1280 4.4ms\n", + "Speed: 56.6ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "540: 674x1280 4.5ms\n", + "Speed: 47.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "541: 674x1280 4.6ms\n", + "Speed: 45.5ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "542: 674x1280 4.2ms\n", + "Speed: 45.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "543: 674x1280 8.1ms\n", + "Speed: 63.9ms track, 8.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "544: 674x1280 8.0ms\n", + "Speed: 62.2ms track, 8.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "545: 674x1280 6.6ms\n", + "Speed: 61.7ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "546: 674x1280 6.8ms\n", + "Speed: 60.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "547: 674x1280 6.4ms\n", + "Speed: 60.3ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "548: 674x1280 7.2ms\n", + "Speed: 60.5ms track, 7.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "549: 674x1280 10.5ms\n", + "Speed: 62.7ms track, 10.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "550: 674x1280 6.8ms\n", + "Speed: 60.0ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "551: 674x1280 6.9ms\n", + "Speed: 60.6ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "552: 674x1280 8.1ms\n", + "Speed: 67.0ms track, 8.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "553: 674x1280 9.5ms\n", + "Speed: 60.3ms track, 9.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "554: 674x1280 7.6ms\n", + "Speed: 66.5ms track, 7.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "555: 674x1280 7.0ms\n", + "Speed: 61.6ms track, 7.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "556: 674x1280 6.4ms\n", + "Speed: 60.7ms track, 6.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "557: 674x1280 6.6ms\n", + "Speed: 61.3ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "558: 674x1280 6.1ms\n", + "Speed: 65.0ms track, 6.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "559: 674x1280 7.9ms\n", + "Speed: 67.2ms track, 7.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "560: 674x1280 8.1ms\n", + "Speed: 64.6ms track, 8.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "561: 674x1280 7.7ms\n", + "Speed: 65.5ms track, 7.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "562: 674x1280 16.9ms\n", + "Speed: 136.6ms track, 16.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "563: 674x1280 15.9ms\n", + "Speed: 193.7ms track, 15.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "564: 674x1280 31.8ms\n", + "Speed: 93.2ms track, 31.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "565: 674x1280 7.5ms\n", + "Speed: 155.7ms track, 7.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "566: 674x1280 4.2ms\n", + "Speed: 66.2ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "567: 674x1280 4.1ms\n", + "Speed: 51.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "568: 674x1280 4.6ms\n", + "Speed: 50.5ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "569: 674x1280 4.4ms\n", + "Speed: 50.9ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "570: 674x1280 4.5ms\n", + "Speed: 51.2ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "571: 674x1280 4.9ms\n", + "Speed: 51.5ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "572: 674x1280 4.2ms\n", + "Speed: 50.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "573: 674x1280 5.0ms\n", + "Speed: 52.5ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "574: 674x1280 4.0ms\n", + "Speed: 52.5ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "575: 674x1280 4.1ms\n", + "Speed: 52.5ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "576: 674x1280 4.1ms\n", + "Speed: 53.2ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "577: 674x1280 4.6ms\n", + "Speed: 53.0ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "578: 674x1280 4.2ms\n", + "Speed: 51.2ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "579: 674x1280 4.8ms\n", + "Speed: 56.5ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "580: 674x1280 4.9ms\n", + "Speed: 55.8ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "581: 674x1280 5.4ms\n", + "Speed: 51.9ms track, 5.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "582: 674x1280 4.8ms\n", + "Speed: 53.1ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "583: 674x1280 4.1ms\n", + "Speed: 50.8ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "584: 674x1280 4.8ms\n", + "Speed: 52.2ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "585: 674x1280 4.6ms\n", + "Speed: 50.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "586: 674x1280 4.6ms\n", + "Speed: 50.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "587: 674x1280 4.6ms\n", + "Speed: 52.1ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "588: 674x1280 5.0ms\n", + "Speed: 56.0ms track, 5.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "589: 674x1280 4.6ms\n", + "Speed: 51.0ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "590: 674x1280 4.6ms\n", + "Speed: 50.9ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "591: 674x1280 4.0ms\n", + "Speed: 49.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "592: 674x1280 4.9ms\n", + "Speed: 50.7ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "593: 674x1280 3.4ms\n", + "Speed: 49.7ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "594: 674x1280 3.6ms\n", + "Speed: 49.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "595: 674x1280 3.6ms\n", + "Speed: 49.7ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "596: 674x1280 3.5ms\n", + "Speed: 51.0ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "597: 674x1280 3.6ms\n", + "Speed: 51.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "598: 674x1280 3.7ms\n", + "Speed: 50.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "599: 674x1280 3.8ms\n", + "Speed: 50.4ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "600: 674x1280 3.8ms\n", + "Speed: 50.2ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "601: 674x1280 3.9ms\n", + "Speed: 51.0ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "602: 674x1280 3.7ms\n", + "Speed: 50.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "603: 674x1280 3.6ms\n", + "Speed: 53.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "604: 674x1280 4.1ms\n", + "Speed: 57.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "605: 674x1280 4.5ms\n", + "Speed: 53.1ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "606: 674x1280 4.3ms\n", + "Speed: 53.4ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "607: 674x1280 4.1ms\n", + "Speed: 50.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "608: 674x1280 3.7ms\n", + "Speed: 50.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "609: 674x1280 3.6ms\n", + "Speed: 51.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "610: 674x1280 3.6ms\n", + "Speed: 49.6ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "611: 674x1280 3.7ms\n", + "Speed: 50.7ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "612: 674x1280 4.4ms\n", + "Speed: 52.3ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "613: 674x1280 4.0ms\n", + "Speed: 52.1ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "614: 674x1280 4.0ms\n", + "Speed: 51.8ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "615: 674x1280 3.9ms\n", + "Speed: 50.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "616: 674x1280 4.0ms\n", + "Speed: 50.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "617: 674x1280 4.1ms\n", + "Speed: 51.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "618: 674x1280 4.0ms\n", + "Speed: 50.0ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "619: 674x1280 4.0ms\n", + "Speed: 50.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "620: 674x1280 3.9ms\n", + "Speed: 52.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "621: 674x1280 3.7ms\n", + "Speed: 49.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "622: 674x1280 3.6ms\n", + "Speed: 49.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "623: 674x1280 3.6ms\n", + "Speed: 49.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "624: 674x1280 3.6ms\n", + "Speed: 49.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "625: 674x1280 3.7ms\n", + "Speed: 50.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "626: 674x1280 3.6ms\n", + "Speed: 49.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "627: 674x1280 3.6ms\n", + "Speed: 50.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "628: 674x1280 3.7ms\n", + "Speed: 49.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "629: 674x1280 3.9ms\n", + "Speed: 49.3ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "630: 674x1280 3.6ms\n", + "Speed: 51.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "631: 674x1280 3.6ms\n", + "Speed: 47.9ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "632: 674x1280 3.5ms\n", + "Speed: 48.3ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "633: 674x1280 3.5ms\n", + "Speed: 48.7ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "634: 674x1280 7.3ms\n", + "Speed: 63.4ms track, 7.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "635: 674x1280 3.7ms\n", + "Speed: 48.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "636: 674x1280 3.9ms\n", + "Speed: 54.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "637: 674x1280 4.1ms\n", + "Speed: 48.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "638: 674x1280 4.0ms\n", + "Speed: 49.6ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "639: 674x1280 4.0ms\n", + "Speed: 47.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "640: 674x1280 4.1ms\n", + "Speed: 47.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "641: 674x1280 3.6ms\n", + "Speed: 46.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "642: 674x1280 4.5ms\n", + "Speed: 46.9ms track, 4.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "643: 674x1280 3.6ms\n", + "Speed: 48.2ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "644: 674x1280 3.8ms\n", + "Speed: 47.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "645: 674x1280 3.7ms\n", + "Speed: 46.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "646: 674x1280 3.8ms\n", + "Speed: 47.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "647: 674x1280 3.7ms\n", + "Speed: 47.5ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "648: 674x1280 3.7ms\n", + "Speed: 46.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "649: 674x1280 3.7ms\n", + "Speed: 47.5ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "650: 674x1280 3.7ms\n", + "Speed: 46.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "651: 674x1280 3.6ms\n", + "Speed: 45.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "652: 674x1280 3.6ms\n", + "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "653: 674x1280 3.8ms\n", + "Speed: 53.6ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "654: 674x1280 3.7ms\n", + "Speed: 46.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "655: 674x1280 3.7ms\n", + "Speed: 47.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "656: 674x1280 3.6ms\n", + "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "657: 674x1280 3.5ms\n", + "Speed: 45.7ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "658: 674x1280 3.7ms\n", + "Speed: 46.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "659: 674x1280 3.6ms\n", + "Speed: 48.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "660: 674x1280 5.5ms\n", + "Speed: 46.5ms track, 5.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "661: 674x1280 4.3ms\n", + "Speed: 49.0ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "662: 674x1280 3.7ms\n", + "Speed: 47.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "663: 674x1280 3.7ms\n", + "Speed: 48.1ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "664: 674x1280 3.4ms\n", + "Speed: 46.4ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "665: 674x1280 4.1ms\n", + "Speed: 48.3ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "666: 674x1280 3.9ms\n", + "Speed: 48.4ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "667: 674x1280 3.7ms\n", + "Speed: 47.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "668: 674x1280 3.6ms\n", + "Speed: 48.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "669: 674x1280 3.8ms\n", + "Speed: 48.2ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "670: 674x1280 3.8ms\n", + "Speed: 54.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "671: 674x1280 3.7ms\n", + "Speed: 48.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "672: 674x1280 3.6ms\n", + "Speed: 47.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "673: 674x1280 3.9ms\n", + "Speed: 47.2ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "674: 674x1280 3.7ms\n", + "Speed: 46.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "675: 674x1280 3.6ms\n", + "Speed: 47.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "676: 674x1280 3.6ms\n", + "Speed: 47.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "677: 674x1280 3.6ms\n", + "Speed: 46.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "678: 674x1280 3.4ms\n", + "Speed: 46.4ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "679: 674x1280 3.7ms\n", + "Speed: 46.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "680: 674x1280 3.8ms\n", + "Speed: 47.9ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "681: 674x1280 3.7ms\n", + "Speed: 45.4ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "682: 674x1280 3.6ms\n", + "Speed: 45.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "683: 674x1280 3.8ms\n", + "Speed: 45.4ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "684: 674x1280 3.6ms\n", + "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "685: 674x1280 3.6ms\n", + "Speed: 45.2ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "686: 674x1280 3.8ms\n", + "Speed: 48.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "687: 674x1280 3.9ms\n", + "Speed: 57.1ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "688: 674x1280 4.2ms\n", + "Speed: 45.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "689: 674x1280 4.0ms\n", + "Speed: 46.1ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "690: 674x1280 3.9ms\n", + "Speed: 46.8ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "691: 674x1280 4.2ms\n", + "Speed: 50.1ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "692: 674x1280 3.6ms\n", + "Speed: 46.4ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "693: 674x1280 5.1ms\n", + "Speed: 45.7ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "694: 674x1280 4.1ms\n", + "Speed: 54.6ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "695: 674x1280 3.7ms\n", + "Speed: 45.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "696: 674x1280 3.7ms\n", + "Speed: 47.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "697: 674x1280 3.6ms\n", + "Speed: 45.7ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "698: 674x1280 4.0ms\n", + "Speed: 46.1ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "699: 674x1280 3.8ms\n", + "Speed: 47.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "700: 674x1280 3.8ms\n", + "Speed: 46.5ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "701: 674x1280 3.7ms\n", + "Speed: 46.7ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "702: 674x1280 3.6ms\n", + "Speed: 46.3ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "703: 674x1280 4.0ms\n", + "Speed: 47.2ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "704: 674x1280 3.9ms\n", + "Speed: 57.6ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "705: 674x1280 3.6ms\n", + "Speed: 49.1ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "706: 674x1280 3.9ms\n", + "Speed: 45.0ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "707: 674x1280 3.5ms\n", + "Speed: 44.5ms track, 3.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "708: 674x1280 3.6ms\n", + "Speed: 44.7ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "709: 674x1280 3.7ms\n", + "Speed: 46.2ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "710: 674x1280 3.8ms\n", + "Speed: 45.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "711: 674x1280 3.7ms\n", + "Speed: 45.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "712: 674x1280 3.6ms\n", + "Speed: 46.2ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "713: 674x1280 4.4ms\n", + "Speed: 45.6ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "714: 674x1280 3.7ms\n", + "Speed: 46.1ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "715: 674x1280 3.7ms\n", + "Speed: 46.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "716: 674x1280 3.7ms\n", + "Speed: 47.1ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "717: 674x1280 3.2ms\n", + "Speed: 45.0ms track, 3.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "718: 674x1280 3.2ms\n", + "Speed: 45.6ms track, 3.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "719: 674x1280 3.8ms\n", + "Speed: 46.5ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "720: 674x1280 3.6ms\n", + "Speed: 46.0ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "721: 674x1280 6.2ms\n", + "Speed: 51.8ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "722: 674x1280 4.1ms\n", + "Speed: 54.1ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "723: 674x1280 4.2ms\n", + "Speed: 46.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "724: 674x1280 4.1ms\n", + "Speed: 46.8ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "725: 674x1280 4.7ms\n", + "Speed: 46.3ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "726: 674x1280 7.1ms\n", + "Speed: 72.7ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "727: 674x1280 6.7ms\n", + "Speed: 62.7ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "728: 674x1280 6.8ms\n", + "Speed: 64.5ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "729: 674x1280 6.7ms\n", + "Speed: 63.1ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "730: 674x1280 6.3ms\n", + "Speed: 66.1ms track, 6.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "731: 674x1280 7.3ms\n", + "Speed: 65.6ms track, 7.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "732: 674x1280 6.7ms\n", + "Speed: 64.7ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "733: 674x1280 6.9ms\n", + "Speed: 64.5ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "734: 674x1280 7.1ms\n", + "Speed: 67.9ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "735: 674x1280 6.8ms\n", + "Speed: 65.9ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "736: 674x1280 7.4ms\n", + "Speed: 66.3ms track, 7.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "737: 674x1280 5.7ms\n", + "Speed: 69.4ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "738: 674x1280 5.6ms\n", + "Speed: 65.8ms track, 5.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "739: 674x1280 5.7ms\n", + "Speed: 67.1ms track, 5.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "740: 674x1280 6.9ms\n", + "Speed: 65.8ms track, 6.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "741: 674x1280 6.5ms\n", + "Speed: 65.3ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "742: 674x1280 6.7ms\n", + "Speed: 67.8ms track, 6.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "743: 674x1280 6.6ms\n", + "Speed: 67.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "744: 674x1280 6.6ms\n", + "Speed: 69.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "745: 674x1280 5.9ms\n", + "Speed: 66.7ms track, 5.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "746: 674x1280 6.6ms\n", + "Speed: 73.8ms track, 6.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "747: 674x1280 6.2ms\n", + "Speed: 68.9ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "748: 674x1280 6.5ms\n", + "Speed: 72.1ms track, 6.5ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "749: 674x1280 6.2ms\n", + "Speed: 67.4ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "750: 674x1280 7.1ms\n", + "Speed: 67.2ms track, 7.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "751: 674x1280 3.9ms\n", + "Speed: 51.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "752: 674x1280 5.2ms\n", + "Speed: 52.7ms track, 5.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "753: 674x1280 3.7ms\n", + "Speed: 50.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "754: 674x1280 3.7ms\n", + "Speed: 51.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "755: 674x1280 3.6ms\n", + "Speed: 50.5ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "756: 674x1280 4.1ms\n", + "Speed: 51.0ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "757: 674x1280 4.1ms\n", + "Speed: 50.4ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "758: 674x1280 4.2ms\n", + "Speed: 50.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "759: 674x1280 4.2ms\n", + "Speed: 49.9ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "760: 674x1280 4.2ms\n", + "Speed: 53.5ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "761: 674x1280 4.8ms\n", + "Speed: 51.1ms track, 4.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "762: 674x1280 4.2ms\n", + "Speed: 52.6ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "763: 674x1280 4.1ms\n", + "Speed: 49.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "764: 674x1280 4.1ms\n", + "Speed: 50.1ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "765: 674x1280 4.7ms\n", + "Speed: 50.2ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "766: 674x1280 4.3ms\n", + "Speed: 50.8ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "767: 674x1280 4.1ms\n", + "Speed: 51.4ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "768: 674x1280 4.2ms\n", + "Speed: 50.8ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "769: 674x1280 4.2ms\n", + "Speed: 51.0ms track, 4.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "770: 674x1280 4.3ms\n", + "Speed: 50.6ms track, 4.3ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "771: 674x1280 4.9ms\n", + "Speed: 52.1ms track, 4.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "772: 674x1280 4.6ms\n", + "Speed: 51.7ms track, 4.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "773: 674x1280 4.4ms\n", + "Speed: 52.8ms track, 4.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "774: 674x1280 3.7ms\n", + "Speed: 50.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "775: 674x1280 6.2ms\n", + "Speed: 54.1ms track, 6.2ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "776: 674x1280 3.8ms\n", + "Speed: 50.1ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "777: 674x1280 4.1ms\n", + "Speed: 49.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "778: 674x1280 3.8ms\n", + "Speed: 49.5ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "779: 674x1280 3.9ms\n", + "Speed: 49.9ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "780: 674x1280 3.7ms\n", + "Speed: 50.8ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "781: 674x1280 3.8ms\n", + "Speed: 49.9ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "782: 674x1280 3.8ms\n", + "Speed: 50.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "783: 674x1280 3.7ms\n", + "Speed: 51.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "784: 674x1280 3.7ms\n", + "Speed: 50.9ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "785: 674x1280 3.9ms\n", + "Speed: 51.5ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "786: 674x1280 4.0ms\n", + "Speed: 51.4ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "787: 674x1280 4.0ms\n", + "Speed: 51.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "788: 674x1280 4.0ms\n", + "Speed: 53.0ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "789: 674x1280 4.1ms\n", + "Speed: 51.7ms track, 4.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "790: 674x1280 3.8ms\n", + "Speed: 50.8ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "791: 674x1280 6.8ms\n", + "Speed: 56.3ms track, 6.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "792: 674x1280 3.7ms\n", + "Speed: 51.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "793: 674x1280 3.8ms\n", + "Speed: 50.7ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "794: 674x1280 3.7ms\n", + "Speed: 51.2ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "795: 674x1280 3.8ms\n", + "Speed: 51.3ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "796: 674x1280 3.7ms\n", + "Speed: 51.0ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "797: 674x1280 3.9ms\n", + "Speed: 51.3ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "798: 674x1280 3.9ms\n", + "Speed: 52.9ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "799: 674x1280 3.8ms\n", + "Speed: 51.0ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "800: 674x1280 3.9ms\n", + "Speed: 50.7ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "801: 674x1280 3.6ms\n", + "Speed: 50.9ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "802: 674x1280 3.7ms\n", + "Speed: 50.7ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "803: 674x1280 3.9ms\n", + "Speed: 51.3ms track, 3.9ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "804: 674x1280 3.7ms\n", + "Speed: 52.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "805: 674x1280 3.8ms\n", + "Speed: 50.6ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "806: 674x1280 3.6ms\n", + "Speed: 50.8ms track, 3.6ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "807: 674x1280 3.7ms\n", + "Speed: 62.3ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "808: 674x1280 3.4ms\n", + "Speed: 51.8ms track, 3.4ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "809: 674x1280 4.0ms\n", + "Speed: 50.7ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "810: 674x1280 4.7ms\n", + "Speed: 50.5ms track, 4.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "811: 674x1280 3.8ms\n", + "Speed: 49.7ms track, 3.8ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "812: 674x1280 3.7ms\n", + "Speed: 48.6ms track, 3.7ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "813: 674x1280 5.1ms\n", + "Speed: 49.8ms track, 5.1ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "814: 674x1280 4.0ms\n", + "Speed: 48.9ms track, 4.0ms solution per image at shape (1, 3, 674, 1280)\n", + "\n", + "Video frame is empty or video processing has been successfully completed.\n" + ] } - ] + ] + }, + { + "cell_type": "markdown", + "source": [ + "\"queue-management-asset\"" + ], + "metadata": { + "id": "bWskbLSKH2S5" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "bwBUa5kZyZ2k" + }, + "source": [ + "Crafted with 💙 by [Ultralytics](https://ultralytics.com/) \n", + "\n", + "Explore and star the [Ultralytics Notebooks](https://github.com/ultralytics/notebooks/) to supercharge your AI journey! 🚀" + ] + } + ] } diff --git a/notebooks/how-to-monitor-workouts-using-ultralytics-yolo.ipynb b/notebooks/how-to-monitor-workouts-using-ultralytics-yolo.ipynb index 272b587..2c1d5e0 100644 --- a/notebooks/how-to-monitor-workouts-using-ultralytics-yolo.ipynb +++ b/notebooks/how-to-monitor-workouts-using-ultralytics-yolo.ipynb @@ -80,7 +80,7 @@ } ], "source": [ - "!pip install ultralytics\n", + "!uv pip install ultralytics\n", "\n", "import cv2\n", "import ultralytics\n", diff --git a/notebooks/how-to-track-the-objects-in-zone-using-ultralytics-yolo.ipynb b/notebooks/how-to-track-the-objects-in-zone-using-ultralytics-yolo.ipynb index fd49a9d..0fc992f 100644 --- a/notebooks/how-to-track-the-objects-in-zone-using-ultralytics-yolo.ipynb +++ b/notebooks/how-to-track-the-objects-in-zone-using-ultralytics-yolo.ipynb @@ -1,224 +1,223 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [], - "toc_visible": true - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "accelerator": "GPU" + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "toc_visible": true }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - " \n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Object tracking in zones using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# TrackZone using Ultralytics YOLO11\n", - "\n", - "This notebook serves as a starting point for [tracking objects in zones](https://docs.ultralytics.com/guides/trackzone/) in videos or live streams using the YOLO11 model.\n", - "\n", - "### What is TrackZone?\n", - "\n", - "TrackZone specializes in monitoring objects within designated areas of a frame instead of the whole frame. Built on [Ultralytics YOLO11](https://github.com/ultralytics/ultralytics/), it integrates object detection and tracking specifically within zones for videos and live camera feeds. YOLO11's advanced algorithms and [deep learning](https://www.ultralytics.com/glossary/deep-learning-dl) technologies make it a perfect choice for real-time use cases, offering precise and efficient object tracking in applications like crowd monitoring and surveillance.\n", - "\n", - "### Advantages of Object Tracking in Zones (TrackZone)\n", - "\n", - "- **Targeted Analysis:** Tracking objects within specific zones allows for more focused insights, enabling precise monitoring and analysis of areas of interest, such as entry points or restricted zones.\n", - "- **Improved Efficiency:** By narrowing the tracking scope to defined zones, TrackZone reduces computational overhead, ensuring faster processing and optimal performance.\n", - "- **Enhanced Security:** Zonal tracking improves surveillance by monitoring critical areas, aiding in the early detection of unusual activity or security breaches.\n", - "- **Scalable Solutions:** The ability to focus on specific zones makes TrackZone adaptable to various scenarios, from retail spaces to industrial settings, ensuring seamless integration and scalability." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "### Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG" - }, - "source": [ - "!pip install ultralytics\n", - "\n", - "import ultralytics\n", - "import cv2\n", - "from ultralytics.utils.downloads import safe_download\n", - "from ultralytics import solutions\n", - "\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Read the Video File\n", - "\n", - "- You can either read the video file directly or stream the content from an RTSP (Real-Time Streaming Protocol) source, allowing for flexible video input depending on your needs.\n", - "- We will also set up the video writer to handle the output video writing." - ], - "metadata": { - "id": "h8go3HNgN0WU" - } - }, - { - "cell_type": "code", - "source": [ - "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/solutions-ci-demo.mp4\")\n", - "cap = cv2.VideoCapture(\"solutions-ci-demo.mp4\")\n", - - "assert cap.isOpened(), \"Error reading video file\"\n", - "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,\n", - " cv2.CAP_PROP_FRAME_HEIGHT,\n", - " cv2.CAP_PROP_FPS))\n", - "\n", - "# Video writer\n", - "video_writer = cv2.VideoWriter(\"trackzone.avi\",\n", - " cv2.VideoWriter_fourcc(*\"mp4v\"),\n", - " fps, (w, h))" - ], - "metadata": { - "id": "QUgMYUvlNLvy" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Define Region Coordinates\n", - "\n", - "Here, we set the coordinates for specific regions to ensure accurate object tracking and analysis within the video or stream. This helps monitor and track objects effectively in different areas." - ], - "metadata": { - "id": "3wJlBXORXNsj" - } - }, - { - "cell_type": "code", - "source": [ - "# Define region points\n", - "# region_points = [(20, 400), (1080, 400)] # For line tracking\n", - "region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)] # For rectangle region tracking\n", - "# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360), (20, 400)] # For polygon region tracking" - ], - "metadata": { - "id": "bVCrrForXRgS" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Initialize the TrackZone Class\n", - "\n", - "- Next, let's initialize the `TrackZone` class to track objects in each frame of the video." - ], - "metadata": { - "id": "rt3soEHzXe8c" - } - }, - { - "cell_type": "code", - "source": [ - " # Init TrackZone (Object Tracking in Zones, not complete frame)\n", - "trackzone = solutions.TrackZone(\n", - " show=True, # Display the output\n", - " region=region_points, # Pass region points\n", - " model=\"yolo11n.pt\", # You can use any model that Ultralytics support, i.e. YOLOv9, YOLOv10\n", - " # line_width=2, # Adjust the line width for bounding boxes and text display\n", - " # classes=[0, 2], # If you want to track specific classes i.e. person and car with COCO pretrained model.\n", - ")" - ], - "metadata": { - "id": "Va24DpUZXTh3" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Process Video Frames\n", - "\n", - "In this step, we will process each frame of the video to detect and analyze objects. This allows for real-time tracking, based on the visual data in the frames." - ], - "metadata": { - "id": "1ewYRFFqXvtj" - } - }, - { - "cell_type": "code", - "source": [ - "# Process video\n", - "while cap.isOpened():\n", - " success, im0 = cap.read()\n", - " if not success:\n", - " print(\"Video frame is empty or video processing has been successfully completed.\")\n", - " break\n", - " results = trackzone(im0) # track the objects\n", - " video_writer.write(results.plot_im) # write the video frames\n", - "\n", - "cap.release() # Release the capture\n", - "video_writer.release()" - ], - "metadata": { - "id": "PVf1pyRtXijz" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "![Plants Tracking in Field Using Ultralytics YOLO11](https://github.com/ultralytics/docs/releases/download/0/plants-tracking-in-zone-using-ultralytics-yolo11.avif)" - ], - "metadata": { - "id": "bWskbLSKH2S5" - } - }, -{ + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + " \n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Object tracking in zones using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# TrackZone using Ultralytics YOLO11\n", + "\n", + "This notebook serves as a starting point for [tracking objects in zones](https://docs.ultralytics.com/guides/trackzone/) in videos or live streams using the YOLO11 model.\n", + "\n", + "### What is TrackZone?\n", + "\n", + "TrackZone specializes in monitoring objects within designated areas of a frame instead of the whole frame. Built on [Ultralytics YOLO11](https://github.com/ultralytics/ultralytics/), it integrates object detection and tracking specifically within zones for videos and live camera feeds. YOLO11's advanced algorithms and [deep learning](https://www.ultralytics.com/glossary/deep-learning-dl) technologies make it a perfect choice for real-time use cases, offering precise and efficient object tracking in applications like crowd monitoring and surveillance.\n", + "\n", + "### Advantages of Object Tracking in Zones (TrackZone)\n", + "\n", + "- **Targeted Analysis:** Tracking objects within specific zones allows for more focused insights, enabling precise monitoring and analysis of areas of interest, such as entry points or restricted zones.\n", + "- **Improved Efficiency:** By narrowing the tracking scope to defined zones, TrackZone reduces computational overhead, ensuring faster processing and optimal performance.\n", + "- **Enhanced Security:** Zonal tracking improves surveillance by monitoring critical areas, aiding in the early detection of unusual activity or security breaches.\n", + "- **Scalable Solutions:** The ability to focus on specific zones makes TrackZone adaptable to various scenarios, from retail spaces to industrial settings, ensuring seamless integration and scalability." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "### Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG" + }, + "source": [ + "!uv pip install ultralytics\n", + "\n", + "import ultralytics\n", + "import cv2\n", + "from ultralytics.utils.downloads import safe_download\n", + "from ultralytics import solutions\n", + "\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Read the Video File\n", + "\n", + "- You can either read the video file directly or stream the content from an RTSP (Real-Time Streaming Protocol) source, allowing for flexible video input depending on your needs.\n", + "- We will also set up the video writer to handle the output video writing." + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "code", + "source": [ + "safe_download(\"https://github.com/ultralytics/notebooks/releases/download/v0.0.0/solutions-ci-demo.mp4\")\n", + "cap = cv2.VideoCapture(\"solutions-ci-demo.mp4\")\n", + "assert cap.isOpened(), \"Error reading video file\"\n", + "w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,\n", + " cv2.CAP_PROP_FRAME_HEIGHT,\n", + " cv2.CAP_PROP_FPS))\n", + "\n", + "# Video writer\n", + "video_writer = cv2.VideoWriter(\"trackzone.avi\",\n", + " cv2.VideoWriter_fourcc(*\"mp4v\"),\n", + " fps, (w, h))" + ], + "metadata": { + "id": "QUgMYUvlNLvy" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Define Region Coordinates\n", + "\n", + "Here, we set the coordinates for specific regions to ensure accurate object tracking and analysis within the video or stream. This helps monitor and track objects effectively in different areas." + ], + "metadata": { + "id": "3wJlBXORXNsj" + } + }, + { + "cell_type": "code", + "source": [ + "# Define region points\n", + "# region_points = [(20, 400), (1080, 400)] # For line tracking\n", + "region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)] # For rectangle region tracking\n", + "# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360), (20, 400)] # For polygon region tracking" + ], + "metadata": { + "id": "bVCrrForXRgS" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Initialize the TrackZone Class\n", + "\n", + "- Next, let's initialize the `TrackZone` class to track objects in each frame of the video." + ], + "metadata": { + "id": "rt3soEHzXe8c" + } + }, + { + "cell_type": "code", + "source": [ + " # Init TrackZone (Object Tracking in Zones, not complete frame)\n", + "trackzone = solutions.TrackZone(\n", + " show=True, # Display the output\n", + " region=region_points, # Pass region points\n", + " model=\"yolo11n.pt\", # You can use any model that Ultralytics support, i.e. YOLOv9, YOLOv10\n", + " # line_width=2, # Adjust the line width for bounding boxes and text display\n", + " # classes=[0, 2], # If you want to track specific classes i.e. person and car with COCO pretrained model.\n", + ")" + ], + "metadata": { + "id": "Va24DpUZXTh3" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Process Video Frames\n", + "\n", + "In this step, we will process each frame of the video to detect and analyze objects. This allows for real-time tracking, based on the visual data in the frames." + ], + "metadata": { + "id": "1ewYRFFqXvtj" + } + }, + { + "cell_type": "code", + "source": [ + "# Process video\n", + "while cap.isOpened():\n", + " success, im0 = cap.read()\n", + " if not success:\n", + " print(\"Video frame is empty or video processing has been successfully completed.\")\n", + " break\n", + " results = trackzone(im0) # track the objects\n", + " video_writer.write(results.plot_im) # write the video frames\n", + "\n", + "cap.release() # Release the capture\n", + "video_writer.release()" + ], + "metadata": { + "id": "PVf1pyRtXijz" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "![Plants Tracking in Field Using Ultralytics YOLO11](https://github.com/ultralytics/docs/releases/download/0/plants-tracking-in-zone-using-ultralytics-yolo11.avif)" + ], + "metadata": { + "id": "bWskbLSKH2S5" + } + }, + { "cell_type": "markdown", "metadata": { "id": "bwBUa5kZyZ2k" @@ -229,5 +228,5 @@ "🌟 Explore and star the [Ultralytics Notebooks](https://github.com/ultralytics/notebooks/) to supercharge your AI journey! 🚀" ] } - ] + ] } diff --git a/notebooks/how-to-train-ultralytics-yolo-on-brain-tumor-detection-dataset.ipynb b/notebooks/how-to-train-ultralytics-yolo-on-brain-tumor-detection-dataset.ipynb index 2e74028..97ec4a7 100644 --- a/notebooks/how-to-train-ultralytics-yolo-on-brain-tumor-detection-dataset.ipynb +++ b/notebooks/how-to-train-ultralytics-yolo-on-brain-tumor-detection-dataset.ipynb @@ -1,878 +1,878 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "toc_visible": true, + "gpuType": "T4" + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + "\n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Brain-tumor detection using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Brain Tumor Detection using Ultralytics YOLO11\n", + "\n", + "This notebook serves as an initial step for training the YOLO11 model on the [brain-tumor](https://docs.ultralytics.com/datasets/detect/brain-tumor/) detection dataset." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset Structure\n", + "\n", + "The brain tumor dataset is divided into two subsets:\n", + "\n", + "- **Training set**: Consisting of 893 images, each accompanied by corresponding annotations.\n", + "- **Testing set**: Comprising 223 images, with annotations paired for each one." + ], + "metadata": { + "id": "xypoYW_oYZAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Applications\n", + "\n", + "The application of brain tumor detection using computer vision enables early diagnosis, treatment planning, and monitoring of tumor progression. By analyzing medical imaging data like MRI or CT scans, computer vision systems assist in accurately identifying brain tumors, aiding in timely medical intervention and personalized treatment strategies." + ], + "metadata": { + "id": "R4SICbq5Yalg" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG", "colab": { - "provenance": [], - "toc_visible": true, - "gpuType": "T4" - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" + "base_uri": "https://localhost:8080/" }, - "accelerator": "GPU" + "outputId": "2e1e3635-7e3c-404d-8f28-dd15f6b1bea3" + }, + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 32.7/112.6 GB disk)\n" + ] + } + ] }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - "\n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Brain-tumor detection using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Brain Tumor Detection using Ultralytics YOLO11\n", - "\n", - "This notebook serves as an initial step for training the YOLO11 model on the [brain-tumor](https://docs.ultralytics.com/datasets/detect/brain-tumor/) detection dataset." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } + { + "cell_type": "markdown", + "source": [ + "## Dataset YAML File\n", + "\n", + "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" + ], + "metadata": { + "id": "xE6ntKojSfSD" + } + }, + { + "cell_type": "markdown", + "source": [ + "```yaml\n", + "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", + "# Brain-tumor dataset by Ultralytics\n", + "# Documentation: https://docs.ultralytics.com/datasets/detect/brain-tumor/\n", + "# Example usage: yolo train data=brain-tumor.yaml\n", + "# parent\n", + "# ├── ultralytics\n", + "# └── datasets\n", + "# └── brain-tumor ← downloads here (4.21 MB)\n", + "\n", + "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", + "path: brain-tumor # dataset root dir\n", + "train: images/train # train images (relative to 'path') 893 images\n", + "val: images/val # val images (relative to 'path') 223 images\n", + "\n", + "# Classes\n", + "names:\n", + " 0: negative\n", + " 1: positive\n", + "\n", + "# Download script/URL (optional)\n", + "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/brain-tumor.zip\n", + "```" + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Train\n", + "\n", + "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." + ], + "metadata": { + "id": "fMV-sNfiSt_X" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "model = YOLO(\"yolo11n.pt\") # load a pretrained model (recommended for training)\n", + "\n", + "# Train the model\n", + "results = model.train(data=\"brain-tumor.yaml\", epochs=10, imgsz=640)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "QUgMYUvlNLvy", + "outputId": "8825cf04-d878-471e-90f6-25d214ab8c86" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "## Dataset Structure\n", - "\n", - "The brain tumor dataset is divided into two subsets:\n", - "\n", - "- **Training set**: Consisting of 893 images, each accompanied by corresponding annotations.\n", - "- **Testing set**: Comprising 223 images, with annotations paired for each one." - ], - "metadata": { - "id": "xypoYW_oYZAf" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Applications\n", - "\n", - "The application of brain tumor detection using computer vision enables early diagnosis, treatment planning, and monitoring of tumor progression. By analyzing medical imaging data like MRI or CT scans, computer vision systems assist in accurately identifying brain tumors, aiding in timely medical intervention and personalized treatment strategies." - ], - "metadata": { - "id": "R4SICbq5Yalg" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.35M/5.35M [00:00<00:00, 97.2MB/s]\n" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "2e1e3635-7e3c-404d-8f28-dd15f6b1bea3" - }, - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 32.7/112.6 GB disk)\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Dataset YAML File\n", - "\n", - "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" - ], - "metadata": { - "id": "xE6ntKojSfSD" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "\u001B[34m\u001B[1mengine/trainer: \u001B[0mtask=detect, mode=train, model=yolo11n.pt, data=brain-tumor.yaml, epochs=10, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train\n", + "\n", + "Dataset 'brain-tumor.yaml' images not found ⚠️, missing path '/content/datasets/brain-tumor/valid/images'\n", + "Downloading https://ultralytics.com/assets/brain-tumor.zip to '/content/datasets/brain-tumor.zip'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "```yaml\n", - "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", - "# Brain-tumor dataset by Ultralytics\n", - "# Documentation: https://docs.ultralytics.com/datasets/detect/brain-tumor/\n", - "# Example usage: yolo train data=brain-tumor.yaml\n", - "# parent\n", - "# ├── ultralytics\n", - "# └── datasets\n", - "# └── brain-tumor ← downloads here (4.21 MB)\n", - "\n", - "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", - "path: brain-tumor # dataset root dir\n", - "train: images/train # train images (relative to 'path') 893 images\n", - "val: images/val # val images (relative to 'path') 223 images\n", - "\n", - "# Classes\n", - "names:\n", - " 0: negative\n", - " 1: positive\n", - "\n", - "# Download script/URL (optional)\n", - "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/brain-tumor.zip\n", - "```" - ], - "metadata": { - "id": "h8go3HNgN0WU" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 4.05M/4.05M [00:00<00:00, 84.0MB/s]\n", + "Unzipping /content/datasets/brain-tumor.zip to /content/datasets/brain-tumor...: 100%|██████████| 2217/2217 [00:00<00:00, 4687.77file/s]" + ] }, { - "cell_type": "markdown", - "source": [ - "## Train\n", - "\n", - "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." - ], - "metadata": { - "id": "fMV-sNfiSt_X" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset download success ✅ (1.3s), saved to \u001B[1m/content/datasets\u001B[0m\n", + "\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "model = YOLO(\"yolo11n.pt\") # load a pretrained model (recommended for training)\n", - "\n", - "# Train the model\n", - "results = model.train(data=\"brain-tumor.yaml\", epochs=10, imgsz=640)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "QUgMYUvlNLvy", - "outputId": "8825cf04-d878-471e-90f6-25d214ab8c86" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.35M/5.35M [00:00<00:00, 97.2MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "\u001b[34m\u001b[1mengine/trainer: \u001b[0mtask=detect, mode=train, model=yolo11n.pt, data=brain-tumor.yaml, epochs=10, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train\n", - "\n", - "Dataset 'brain-tumor.yaml' images not found ⚠️, missing path '/content/datasets/brain-tumor/valid/images'\n", - "Downloading https://ultralytics.com/assets/brain-tumor.zip to '/content/datasets/brain-tumor.zip'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 4.05M/4.05M [00:00<00:00, 84.0MB/s]\n", - "Unzipping /content/datasets/brain-tumor.zip to /content/datasets/brain-tumor...: 100%|██████████| 2217/2217 [00:00<00:00, 4687.77file/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Dataset download success ✅ (1.3s), saved to \u001b[1m/content/datasets\u001b[0m\n", - "\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 755k/755k [00:00<00:00, 24.9MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Overriding model.yaml nc=80 with nc=2\n", - "\n", - " from n params module arguments \n", - " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", - " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", - " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", - " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", - " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", - " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", - " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", - " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", - " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", - " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", - " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", - " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", - " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", - " 23 [16, 19, 22] 1 431062 ultralytics.nn.modules.head.Detect [2, [64, 128, 256]] \n", - "YOLO11n summary: 319 layers, 2,590,230 parameters, 2,590,214 gradients, 6.4 GFLOPs\n", - "\n", - "Transferred 448/499 items from pretrained weights\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/\n", - "Freezing layer 'model.23.dfl.conv.weight'\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks...\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mScanning /content/datasets/brain-tumor/train/labels... 878 images, 15 backgrounds, 0 corrupt: 100%|██████████| 893/893 [00:00<00:00, 2024.08it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /content/datasets/brain-tumor/train/labels.cache\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "/usr/local/lib/python3.10/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 1.4.24 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", - " check_for_updates()\n", - "\u001b[34m\u001b[1mval: \u001b[0mScanning /content/datasets/brain-tumor/valid/labels... 223 images, 0 backgrounds, 0 corrupt: 100%|██████████| 223/223 [00:00<00:00, 1694.68it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /content/datasets/brain-tumor/valid/labels.cache\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Plotting labels to runs/detect/train/labels.jpg... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.001667, momentum=0.9) with parameter groups 81 weight(decay=0.0), 88 weight(decay=0.0005), 87 bias(decay=0.0)\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mmodel graph visualization added ✅\n", - "Image sizes 640 train, 640 val\n", - "Using 2 dataloader workers\n", - "Logging results to \u001b[1mruns/detect/train\u001b[0m\n", - "Starting training for 10 epochs...\n", - "Closing dataloader mosaic\n", - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 1/10 2.43G 1.296 3.774 1.194 12 640: 100%|██████████| 56/56 [00:20<00:00, 2.71it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:03<00:00, 2.13it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.41 0.0468 0.0968 0.0615\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 2/10 2.37G 1.187 2.738 1.111 13 640: 100%|██████████| 56/56 [00:17<00:00, 3.16it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 3.84it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.235 0.285 0.192 0.137\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 3/10 2.36G 1.197 2.328 1.145 13 640: 100%|██████████| 56/56 [00:17<00:00, 3.13it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:02<00:00, 2.85it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.427 0.626 0.434 0.291\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 4/10 2.37G 1.11 1.998 1.097 14 640: 100%|██████████| 56/56 [00:16<00:00, 3.44it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:03<00:00, 2.30it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.425 0.705 0.442 0.299\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 5/10 2.37G 1.089 1.787 1.108 13 640: 100%|██████████| 56/56 [00:16<00:00, 3.48it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:02<00:00, 3.43it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.463 0.796 0.482 0.337\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 6/10 2.37G 1.055 1.603 1.083 17 640: 100%|██████████| 56/56 [00:16<00:00, 3.42it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.07it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.464 0.786 0.49 0.339\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 7/10 2.37G 1.008 1.491 1.055 15 640: 100%|██████████| 56/56 [00:16<00:00, 3.37it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.01it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.453 0.839 0.472 0.333\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 8/10 2.37G 0.9694 1.403 1.02 13 640: 100%|██████████| 56/56 [00:16<00:00, 3.43it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.21it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.47 0.763 0.512 0.378\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 9/10 2.37G 0.9562 1.329 1.019 13 640: 100%|██████████| 56/56 [00:16<00:00, 3.42it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.29it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.456 0.879 0.503 0.367\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 10/10 2.37G 0.9013 1.269 1.001 12 640: 100%|██████████| 56/56 [00:16<00:00, 3.41it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:02<00:00, 2.83it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.471 0.869 0.492 0.363\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "10 epochs completed in 0.058 hours.\n", - "Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB\n", - "Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB\n", - "\n", - "Validating runs/detect/train/weights/best.pt...\n", - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "YOLO11n summary (fused): 238 layers, 2,582,542 parameters, 0 gradients, 6.3 GFLOPs\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:04<00:00, 1.62it/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 223 241 0.468 0.763 0.512 0.379\n", - " negative 142 154 0.587 0.721 0.592 0.431\n", - " positive 81 87 0.349 0.805 0.431 0.326\n", - "Speed: 0.3ms preprocess, 3.4ms inference, 0.0ms loss, 5.7ms postprocess per image\n", - "Results saved to \u001b[1mruns/detect/train\u001b[0m\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "![Brain tumor dataset sample image](https://github.com/ultralytics/docs/releases/download/0/brain-tumor-dataset-sample-image.avif)" - ], - "metadata": { - "id": "_Hapx6WkS--T" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Predict\n", - "\n", - "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." - ], - "metadata": { - "id": "mKAUvDAbTEjQ" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Inference using the model (img/video/stream)\n", - "prediction_results = modelp.predict(\"https://ultralytics.com/assets/brain-tumor-sample.jpg\", save=True)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "nzTbeqK_TB6t", - "outputId": "f2df2be1-25ec-49c8-b6df-4ce1a7bd0c8d" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Downloading https://ultralytics.com/assets/brain-tumor-sample.jpg to 'brain-tumor-sample.jpg'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.49k/5.49k [00:00<00:00, 6.00MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "image 1/1 /content/brain-tumor-sample.jpg: 640x640 1 positive, 16.4ms\n", - "Speed: 3.1ms preprocess, 16.4ms inference, 2.5ms postprocess per image at shape (1, 3, 640, 640)\n", - "Results saved to \u001b[1mruns/detect/predict\u001b[0m\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "        \n", - "" - ], - "metadata": { - "id": "lmNKY3rWWsvj" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 755k/755k [00:00<00:00, 24.9MB/s]\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Export\n", - "\n", - "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", - "\n", - "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", - "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", - "\n", - "| Format | `format` Argument | Model | Metadata | Arguments |\n", - "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", - "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", - "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", - "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", - "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", - "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", - "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", - "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", - "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", - "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", - "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", - "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", - "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", - "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", - "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" - ], - "metadata": { - "id": "vWBYYdXhTkN7" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Overriding model.yaml nc=80 with nc=2\n", + "\n", + " from n params module arguments \n", + " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", + " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", + " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", + " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", + " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", + " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", + " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", + " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", + " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", + " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", + " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", + " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", + " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", + " 23 [16, 19, 22] 1 431062 ultralytics.nn.modules.head.Detect [2, [64, 128, 256]] \n", + "YOLO11n summary: 319 layers, 2,590,230 parameters, 2,590,214 gradients, 6.4 GFLOPs\n", + "\n", + "Transferred 448/499 items from pretrained weights\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mStart with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/\n", + "Freezing layer 'model.23.dfl.conv.weight'\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mrunning Automatic Mixed Precision (AMP) checks...\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mchecks passed ✅\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Export the model\n", - "modele.export(format=\"onnx\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 298 - }, - "id": "S4nWG40CTlOD", - "outputId": "714e2750-9c39-40c7-f402-0492aaff3e5b" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", - "YOLO11n summary (fused): 238 layers, 2,582,542 parameters, 0 gradients, 6.3 GFLOPs\n", - "\n", - "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from '/content/runs/detect/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 6, 8400) (5.2 MB)\n", - "\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.17.0 opset 19...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m slimming with onnxslim 0.1.46...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m export success ✅ 1.5s, saved as '/content/runs/detect/train/weights/best.onnx' (10.1 MB)\n", - "\n", - "Export complete (2.2s)\n", - "Results saved to \u001b[1m/content/runs/detect/train/weights\u001b[0m\n", - "Predict: yolo predict task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 \n", - "Validate: yolo val task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 data=/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/datasets/brain-tumor.yaml \n", - "Visualize: https://netron.app\n" - ] - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "'/content/runs/detect/train/weights/best.onnx'" - ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - } - }, - "metadata": {}, - "execution_count": 6 - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Citation\n", - "\n", - "```bibtex\n", - "@dataset{Jocher_Ultralytics_Datasets_2024,\n", - " author = {Jocher, Glenn and Rizwan, Muhammad},\n", - " license = {AGPL-3.0},\n", - " month = {March},\n", - " title = {Ultralytics Datasets:Brain-tumor Detection Dataset},\n", - " url = {https://docs.ultralytics.com/datasets/detect/brain-tumor/},\n", - " version = {1.0.0},\n", - " year = {2024}\n", - "}\n" + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mScanning /content/datasets/brain-tumor/train/labels... 878 images, 15 backgrounds, 0 corrupt: 100%|██████████| 893/893 [00:00<00:00, 2024.08it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mNew cache created: /content/datasets/brain-tumor/train/labels.cache\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.10/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 1.4.24 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", + " check_for_updates()\n", + "\u001B[34m\u001B[1mval: \u001B[0mScanning /content/datasets/brain-tumor/valid/labels... 223 images, 0 backgrounds, 0 corrupt: 100%|██████████| 223/223 [00:00<00:00, 1694.68it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mNew cache created: /content/datasets/brain-tumor/valid/labels.cache\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Plotting labels to runs/detect/train/labels.jpg... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m AdamW(lr=0.001667, momentum=0.9) with parameter groups 81 weight(decay=0.0), 88 weight(decay=0.0005), 87 bias(decay=0.0)\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mmodel graph visualization added ✅\n", + "Image sizes 640 train, 640 val\n", + "Using 2 dataloader workers\n", + "Logging results to \u001B[1mruns/detect/train\u001B[0m\n", + "Starting training for 10 epochs...\n", + "Closing dataloader mosaic\n", + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 1/10 2.43G 1.296 3.774 1.194 12 640: 100%|██████████| 56/56 [00:20<00:00, 2.71it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:03<00:00, 2.13it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.41 0.0468 0.0968 0.0615\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 2/10 2.37G 1.187 2.738 1.111 13 640: 100%|██████████| 56/56 [00:17<00:00, 3.16it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 3.84it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.235 0.285 0.192 0.137\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 3/10 2.36G 1.197 2.328 1.145 13 640: 100%|██████████| 56/56 [00:17<00:00, 3.13it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:02<00:00, 2.85it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.427 0.626 0.434 0.291\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 4/10 2.37G 1.11 1.998 1.097 14 640: 100%|██████████| 56/56 [00:16<00:00, 3.44it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:03<00:00, 2.30it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.425 0.705 0.442 0.299\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 5/10 2.37G 1.089 1.787 1.108 13 640: 100%|██████████| 56/56 [00:16<00:00, 3.48it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:02<00:00, 3.43it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.463 0.796 0.482 0.337\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 6/10 2.37G 1.055 1.603 1.083 17 640: 100%|██████████| 56/56 [00:16<00:00, 3.42it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.07it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.464 0.786 0.49 0.339\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 7/10 2.37G 1.008 1.491 1.055 15 640: 100%|██████████| 56/56 [00:16<00:00, 3.37it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.01it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.453 0.839 0.472 0.333\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 8/10 2.37G 0.9694 1.403 1.02 13 640: 100%|██████████| 56/56 [00:16<00:00, 3.43it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.21it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.47 0.763 0.512 0.378\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 9/10 2.37G 0.9562 1.329 1.019 13 640: 100%|██████████| 56/56 [00:16<00:00, 3.42it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:01<00:00, 4.29it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.456 0.879 0.503 0.367\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 10/10 2.37G 0.9013 1.269 1.001 12 640: 100%|██████████| 56/56 [00:16<00:00, 3.41it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:02<00:00, 2.83it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.471 0.869 0.492 0.363\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "10 epochs completed in 0.058 hours.\n", + "Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB\n", + "Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB\n", + "\n", + "Validating runs/detect/train/weights/best.pt...\n", + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "YOLO11n summary (fused): 238 layers, 2,582,542 parameters, 0 gradients, 6.3 GFLOPs\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:04<00:00, 1.62it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 223 241 0.468 0.763 0.512 0.379\n", + " negative 142 154 0.587 0.721 0.592 0.431\n", + " positive 81 87 0.349 0.805 0.431 0.326\n", + "Speed: 0.3ms preprocess, 3.4ms inference, 0.0ms loss, 5.7ms postprocess per image\n", + "Results saved to \u001B[1mruns/detect/train\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Brain tumor dataset sample image](https://github.com/ultralytics/docs/releases/download/0/brain-tumor-dataset-sample-image.avif)" + ], + "metadata": { + "id": "_Hapx6WkS--T" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Predict\n", + "\n", + "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." + ], + "metadata": { + "id": "mKAUvDAbTEjQ" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Inference using the model (img/video/stream)\n", + "prediction_results = modelp.predict(\"https://ultralytics.com/assets/brain-tumor-sample.jpg\", save=True)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "nzTbeqK_TB6t", + "outputId": "f2df2be1-25ec-49c8-b6df-4ce1a7bd0c8d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Downloading https://ultralytics.com/assets/brain-tumor-sample.jpg to 'brain-tumor-sample.jpg'...\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.49k/5.49k [00:00<00:00, 6.00MB/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "image 1/1 /content/brain-tumor-sample.jpg: 640x640 1 positive, 16.4ms\n", + "Speed: 3.1ms preprocess, 16.4ms inference, 2.5ms postprocess per image at shape (1, 3, 640, 640)\n", + "Results saved to \u001B[1mruns/detect/predict\u001B[0m\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "        \n", + "" + ], + "metadata": { + "id": "lmNKY3rWWsvj" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Export\n", + "\n", + "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", + "\n", + "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", + "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", + "\n", + "| Format | `format` Argument | Model | Metadata | Arguments |\n", + "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", + "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", + "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", + "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", + "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", + "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", + "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", + "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", + "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", + "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", + "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", + "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", + "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", + "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", + "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" + ], + "metadata": { + "id": "vWBYYdXhTkN7" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Export the model\n", + "modele.export(format=\"onnx\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 298 + }, + "id": "S4nWG40CTlOD", + "outputId": "714e2750-9c39-40c7-f402-0492aaff3e5b" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", + "YOLO11n summary (fused): 238 layers, 2,582,542 parameters, 0 gradients, 6.3 GFLOPs\n", + "\n", + "\u001B[34m\u001B[1mPyTorch:\u001B[0m starting from '/content/runs/detect/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 6, 8400) (5.2 MB)\n", + "\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m starting export with onnx 1.17.0 opset 19...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m slimming with onnxslim 0.1.46...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m export success ✅ 1.5s, saved as '/content/runs/detect/train/weights/best.onnx' (10.1 MB)\n", + "\n", + "Export complete (2.2s)\n", + "Results saved to \u001B[1m/content/runs/detect/train/weights\u001B[0m\n", + "Predict: yolo predict task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 \n", + "Validate: yolo val task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 data=/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/datasets/brain-tumor.yaml \n", + "Visualize: https://netron.app\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/runs/detect/train/weights/best.onnx'" ], - "metadata": { - "id": "vlHp09Nueb3d" + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" } + }, + "metadata": {}, + "execution_count": 6 } - ] + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Citation\n", + "\n", + "```bibtex\n", + "@dataset{Jocher_Ultralytics_Datasets_2024,\n", + " author = {Jocher, Glenn and Rizwan, Muhammad},\n", + " license = {AGPL-3.0},\n", + " month = {March},\n", + " title = {Ultralytics Datasets:Brain-tumor Detection Dataset},\n", + " url = {https://docs.ultralytics.com/datasets/detect/brain-tumor/},\n", + " version = {1.0.0},\n", + " year = {2024}\n", + "}\n" + ], + "metadata": { + "id": "vlHp09Nueb3d" + } + } + ] } diff --git a/notebooks/how-to-train-ultralytics-yolo-on-carparts-segmentation-dataset.ipynb b/notebooks/how-to-train-ultralytics-yolo-on-carparts-segmentation-dataset.ipynb index 4bf9bcb..855f91f 100644 --- a/notebooks/how-to-train-ultralytics-yolo-on-carparts-segmentation-dataset.ipynb +++ b/notebooks/how-to-train-ultralytics-yolo-on-carparts-segmentation-dataset.ipynb @@ -1,754 +1,754 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + "\n", + "\n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Carparts segmentation using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Carparts Segmentation using Ultralytics YOLO11\n", + "\n", + "This notebook serves as a starting point for training the YOLO11 model on [carparts](https://docs.ultralytics.com/datasets/segment/carparts-seg/) segmentation dataset." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset Structure\n", + "\n", + "The data distribution within the Carparts Segmentation Dataset is organized as outlined below:\n", + "\n", + "- **Training set**: Includes 3156 images, each accompanied by its corresponding annotations.\n", + "- **Testing set**: Comprises 276 images, with each one paired with its respective annotations.\n", + "- **Validation set**: Consists of 401 images, each having corresponding annotations." + ], + "metadata": { + "id": "xypoYW_oYZAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Applications\n", + "\n", + "Carparts Segmentation finds applications in automotive quality control, auto repair, e-commerce cataloging, traffic monitoring, autonomous vehicles, insurance processing, recycling, and smart city initiatives. It streamlines processes by accurately identifying and categorizing different vehicle components, contributing to efficiency and automation in various industries." + ], + "metadata": { + "id": "R4SICbq5Yalg" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG" + }, + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset YAML File\n", + "\n", + "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" + ], + "metadata": { + "id": "xE6ntKojSfSD" + } + }, + { + "cell_type": "markdown", + "source": [ + "```yaml\n", + "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", + "# Carparts-seg dataset by Ultralytics\n", + "# Documentation: https://docs.ultralytics.com/datasets/segment/carparts-seg/\n", + "# Example usage: yolo train data=carparts-seg.yaml\n", + "# parent\n", + "# ├── ultralytics\n", + "# └── datasets\n", + "# └── carparts-seg ← downloads here (133 MB)\n", + "\n", + "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", + "path: carparts-seg # dataset root dir\n", + "train: images/train # train images (relative to 'path') 3516 images\n", + "val: images/val # val images (relative to 'path') 276 images\n", + "test: images/test # test images (relative to 'path') 401 images\n", + "\n", + "# Classes\n", + "names:\n", + " 0: back_bumper\n", + " 1: back_door\n", + " 2: back_glass\n", + " 3: back_left_door\n", + " 4: back_left_light\n", + " 5: back_light\n", + " 6: back_right_door\n", + " 7: back_right_light\n", + " 8: front_bumper\n", + " 9: front_door\n", + " 10: front_glass\n", + " 11: front_left_door\n", + " 12: front_left_light\n", + " 13: front_light\n", + " 14: front_right_door\n", + " 15: front_right_light\n", + " 16: hood\n", + " 17: left_mirror\n", + " 18: object\n", + " 19: right_mirror\n", + " 20: tailgate\n", + " 21: trunk\n", + " 22: wheel\n", + "\n", + "# Download script/URL (optional)\n", + "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/carparts-seg.zip\n", + "```" + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Train\n", + "\n", + "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." + ], + "metadata": { + "id": "fMV-sNfiSt_X" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "model = YOLO(\"yolo11n-seg.pt\") # load a pretrained model (recommended for training)\n", + "\n", + "# Train the model\n", + "results = model.train(data=\"carparts-seg.yaml\", epochs=10, imgsz=640, batch=32, workers=64)" + ], + "metadata": { "colab": { - "provenance": [] + "base_uri": "https://localhost:8080/" }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" + "id": "QUgMYUvlNLvy", + "outputId": "3f34e40b-3abb-4156-cca4-b0de0b9f7334" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n-seg.pt to 'yolo11n-seg.pt'...\n" + ] }, - "accelerator": "GPU" - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - "\n", - "\n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Carparts segmentation using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Carparts Segmentation using Ultralytics YOLO11\n", - "\n", - "This notebook serves as a starting point for training the YOLO11 model on [carparts](https://docs.ultralytics.com/datasets/segment/carparts-seg/) segmentation dataset." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.90M/5.90M [00:00<00:00, 115MB/s]" + ] }, { - "cell_type": "markdown", - "source": [ - "## Dataset Structure\n", - "\n", - "The data distribution within the Carparts Segmentation Dataset is organized as outlined below:\n", - "\n", - "- **Training set**: Includes 3156 images, each accompanied by its corresponding annotations.\n", - "- **Testing set**: Comprises 276 images, with each one paired with its respective annotations.\n", - "- **Validation set**: Consists of 401 images, each having corresponding annotations." - ], - "metadata": { - "id": "xypoYW_oYZAf" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "\u001B[34m\u001B[1mengine/trainer: \u001B[0mtask=segment, mode=train, model=yolo11n-seg.pt, data=carparts-seg.yaml, epochs=10, time=None, patience=100, batch=32, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=64, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/segment/train\n", + "Overriding model.yaml nc=80 with nc=23\n", + "\n", + " from n params module arguments \n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Applications\n", - "\n", - "Carparts Segmentation finds applications in automotive quality control, auto repair, e-commerce cataloging, traffic monitoring, autonomous vehicles, insurance processing, recycling, and smart city initiatives. It streamlines processes by accurately identifying and categorizing different vehicle components, contributing to efficiency and automation in various industries." - ], - "metadata": { - "id": "R4SICbq5Yalg" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG" - }, - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [] + "output_type": "stream", + "name": "stdout", + "text": [ + " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", + " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", + " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", + " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", + " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", + " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", + " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", + " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", + " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", + " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", + " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", + " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", + " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", + " 23 [16, 19, 22] 1 687925 ultralytics.nn.modules.head.Segment [23, 32, 64, [64, 128, 256]] \n", + "YOLO11n-seg summary: 355 layers, 2,847,093 parameters, 2,847,077 gradients, 10.4 GFLOPs\n", + "\n", + "Transferred 510/561 items from pretrained weights\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mStart with 'tensorboard --logdir runs/segment/train', view at http://localhost:6006/\n", + "Freezing layer 'model.23.dfl.conv.weight'\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mrunning Automatic Mixed Precision (AMP) checks...\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mchecks passed ✅\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Dataset YAML File\n", - "\n", - "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" - ], - "metadata": { - "id": "xE6ntKojSfSD" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mScanning /content/datasets/carparts-seg/train/labels.cache... 3156 images, 116 backgrounds, 0 corrupt: 100%|██████████| 3156/3156 [00:00" - ], - "metadata": { - "id": "lmNKY3rWWsvj" - } + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.914 0.0768 0.131 0.0946 0.914 0.0761 0.132 0.09\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Export\n", - "\n", - "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", - "\n", - "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", - "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", - "\n", - "| Format | `format` Argument | Model | Metadata | Arguments |\n", - "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", - "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", - "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", - "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", - "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", - "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", - "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", - "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", - "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", - "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", - "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", - "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", - "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", - "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", - "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" - ], - "metadata": { - "id": "vWBYYdXhTkN7" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 2/10 6.09G 1.066 1.904 2.492 1.232 106 640: 100%|██████████| 99/99 [01:12<00:00, 1.37it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:06<00:00, 1.15it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.517 0.361 0.318 0.229 0.517 0.362 0.319 0.217\n", + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 3/10 6.2G 0.9372 1.651 1.655 1.134 88 640: 100%|██████████| 99/99 [01:15<00:00, 1.32it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:06<00:00, 1.07it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.508 0.555 0.47 0.354 0.466 0.6 0.473 0.332\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 4/10 6.1G 0.873 1.529 1.386 1.091 102 640: 100%|██████████| 99/99 [01:10<00:00, 1.39it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:06<00:00, 1.05it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.582 0.542 0.551 0.429 0.592 0.525 0.554 0.402\n", + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 5/10 6.18G 0.8182 1.407 1.205 1.057 99 640: 100%|██████████| 99/99 [01:10<00:00, 1.41it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:06<00:00, 1.13it/s]\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Export the model\n", - "modele.export(format=\"onnx\")" + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.562 0.652 0.613 0.469 0.544 0.653 0.61 0.439\n", + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 6/10 6.2G 0.7859 1.328 1.111 1.035 109 640: 100%|██████████| 99/99 [01:13<00:00, 1.35it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:05<00:00, 1.36it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.54 0.683 0.611 0.484 0.542 0.689 0.619 0.462\n", + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 7/10 6.11G 0.7399 1.248 1.015 1.009 82 640: 100%|██████████| 99/99 [01:10<00:00, 1.41it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:06<00:00, 1.02it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.59 0.735 0.647 0.522 0.593 0.734 0.655 0.501\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 8/10 6.09G 0.7107 1.193 0.9572 0.9904 94 640: 100%|██████████| 99/99 [01:10<00:00, 1.40it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:05<00:00, 1.36it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.595 0.755 0.646 0.534 0.597 0.757 0.656 0.509\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 9/10 6.22G 0.6806 1.144 0.9086 0.9789 116 640: 100%|██████████| 99/99 [01:12<00:00, 1.36it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:07<00:00, 1.08s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.564 0.731 0.637 0.523 0.563 0.729 0.644 0.497\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 10/10 6.15G 0.6523 1.103 0.8649 0.9568 87 640: 100%|██████████| 99/99 [01:10<00:00, 1.40it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:05<00:00, 1.32it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.601 0.789 0.676 0.561 0.604 0.787 0.686 0.536\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "10 epochs completed in 0.229 hours.\n", + "Optimizer stripped from runs/segment/train/weights/last.pt, 6.0MB\n", + "Optimizer stripped from runs/segment/train/weights/best.pt, 6.0MB\n", + "\n", + "Validating runs/segment/train/weights/best.pt...\n", + "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "YOLO11n-seg summary (fused): 265 layers, 2,839,053 parameters, 0 gradients, 10.2 GFLOPs\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 7/7 [00:13<00:00, 1.88s/it]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 401 2042 0.6 0.789 0.676 0.56 0.603 0.787 0.686 0.534\n", + " back_bumper 94 94 0.885 0.978 0.926 0.742 0.884 0.977 0.926 0.703\n", + " back_door 158 159 0.797 0.887 0.9 0.787 0.798 0.887 0.899 0.753\n", + " back_glass 114 115 0.884 0.913 0.934 0.801 0.886 0.913 0.934 0.767\n", + " back_left_door 15 15 0.518 0.86 0.615 0.535 0.516 0.853 0.615 0.481\n", + " back_left_light 19 19 0.538 0.737 0.611 0.476 0.552 0.737 0.611 0.431\n", + " back_light 161 226 0.815 0.81 0.83 0.6 0.825 0.819 0.839 0.581\n", + " back_right_door 12 12 0.369 0.833 0.607 0.532 0.369 0.833 0.607 0.504\n", + " back_right_light 13 13 0.427 0.745 0.565 0.455 0.419 0.722 0.565 0.46\n", + " front_bumper 208 208 0.913 0.981 0.954 0.872 0.913 0.981 0.954 0.857\n", + " front_door 167 167 0.83 0.922 0.924 0.817 0.831 0.922 0.924 0.795\n", + " front_glass 214 214 0.934 0.986 0.97 0.898 0.934 0.985 0.97 0.896\n", + " front_left_door 15 15 0.526 1 0.794 0.718 0.53 1 0.794 0.645\n", + " front_left_light 30 30 0.484 0.6 0.542 0.37 0.49 0.6 0.542 0.37\n", + " front_light 248 373 0.871 0.851 0.883 0.678 0.879 0.855 0.888 0.649\n", + " front_right_door 12 12 0.389 0.833 0.451 0.398 0.391 0.833 0.451 0.336\n", + " front_right_light 26 26 0.498 0.731 0.524 0.433 0.504 0.731 0.524 0.419\n", + " hood 214 214 0.916 0.973 0.944 0.842 0.916 0.972 0.944 0.846\n", + " left_mirror 31 31 0.451 0.581 0.429 0.291 0.453 0.581 0.427 0.267\n", + " object 1 1 0 0 0 0 0 0 0 0\n", + " right_mirror 31 31 0.509 0.742 0.54 0.372 0.506 0.728 0.54 0.347\n", + " tailgate 5 5 0.467 0.8 0.513 0.405 0.471 0.8 0.558 0.428\n", + " trunk 9 9 0.416 0.889 0.716 0.601 0.366 0.778 0.662 0.486\n", + " wheel 34 53 0.368 0.494 0.387 0.26 0.441 0.585 0.603 0.271\n", + "Speed: 0.3ms preprocess, 3.4ms inference, 0.0ms loss, 5.6ms postprocess per image\n", + "Results saved to \u001B[1mruns/segment/train\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Dataset sample image](https://github.com/ultralytics/docs/releases/download/0/dataset-sample-image.avif)" + ], + "metadata": { + "id": "_Hapx6WkS--T" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Predict\n", + "\n", + "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." + ], + "metadata": { + "id": "mKAUvDAbTEjQ" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Inference using the model (img/video/stream)\n", + "prediction_results = modelp.predict(\"https://github.com/ultralytics/assets/releases/download/v0.0.0/carparts-image.jpg\", save=True)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "nzTbeqK_TB6t", + "outputId": "8855b131-ff07-4b68-ad67-fd215c694f20" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Found https://github.com/ultralytics/assets/releases/download/v0.0.0/carparts-image.jpg locally at carparts-image.jpg\n", + "image 1/1 /content/carparts-image.jpg: 384x640 1 front_bumper, 1 front_glass, 1 front_left_door, 1 front_right_door, 1 front_right_light, 1 hood, 5 wheels, 80.5ms\n", + "Speed: 2.2ms preprocess, 80.5ms inference, 7.9ms postprocess per image at shape (1, 3, 384, 640)\n", + "Results saved to \u001B[1mruns/segment/predict\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "        \n", + "" + ], + "metadata": { + "id": "lmNKY3rWWsvj" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Export\n", + "\n", + "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", + "\n", + "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", + "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", + "\n", + "| Format | `format` Argument | Model | Metadata | Arguments |\n", + "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", + "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", + "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", + "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", + "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", + "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", + "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", + "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", + "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", + "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", + "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", + "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", + "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", + "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", + "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" + ], + "metadata": { + "id": "vWBYYdXhTkN7" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Export the model\n", + "modele.export(format=\"onnx\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 278 + }, + "id": "S4nWG40CTlOD", + "outputId": "c727cbf1-7fad-4c32-9872-2501309e765f" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", + "YOLO11n-seg summary (fused): 265 layers, 2,839,053 parameters, 0 gradients, 10.2 GFLOPs\n", + "\n", + "\u001B[34m\u001B[1mPyTorch:\u001B[0m starting from '/content/runs/segment/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 59, 8400), (1, 32, 160, 160)) (5.7 MB)\n", + "\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m starting export with onnx 1.17.0 opset 19...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m slimming with onnxslim 0.1.47...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m export success ✅ 2.7s, saved as '/content/runs/segment/train/weights/best.onnx' (11.1 MB)\n", + "\n", + "Export complete (4.6s)\n", + "Results saved to \u001B[1m/content/runs/segment/train/weights\u001B[0m\n", + "Predict: yolo predict task=segment model=/content/runs/segment/train/weights/best.onnx imgsz=640 \n", + "Validate: yolo val task=segment model=/content/runs/segment/train/weights/best.onnx imgsz=640 data=/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/datasets/carparts-seg.yaml \n", + "Visualize: https://netron.app\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/runs/segment/train/weights/best.onnx'" ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 278 - }, - "id": "S4nWG40CTlOD", - "outputId": "c727cbf1-7fad-4c32-9872-2501309e765f" - }, - "execution_count": 8, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", - "YOLO11n-seg summary (fused): 265 layers, 2,839,053 parameters, 0 gradients, 10.2 GFLOPs\n", - "\n", - "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from '/content/runs/segment/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 59, 8400), (1, 32, 160, 160)) (5.7 MB)\n", - "\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.17.0 opset 19...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m slimming with onnxslim 0.1.47...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m export success ✅ 2.7s, saved as '/content/runs/segment/train/weights/best.onnx' (11.1 MB)\n", - "\n", - "Export complete (4.6s)\n", - "Results saved to \u001b[1m/content/runs/segment/train/weights\u001b[0m\n", - "Predict: yolo predict task=segment model=/content/runs/segment/train/weights/best.onnx imgsz=640 \n", - "Validate: yolo val task=segment model=/content/runs/segment/train/weights/best.onnx imgsz=640 data=/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/datasets/carparts-seg.yaml \n", - "Visualize: https://netron.app\n" - ] - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "'/content/runs/segment/train/weights/best.onnx'" - ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - } - }, - "metadata": {}, - "execution_count": 8 - } - ] + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 8 } - ] + ] + } + ] } diff --git a/notebooks/how-to-train-ultralytics-yolo-on-crack-segmentation-dataset.ipynb b/notebooks/how-to-train-ultralytics-yolo-on-crack-segmentation-dataset.ipynb index 95bb7a9..a4db5f9 100644 --- a/notebooks/how-to-train-ultralytics-yolo-on-crack-segmentation-dataset.ipynb +++ b/notebooks/how-to-train-ultralytics-yolo-on-crack-segmentation-dataset.ipynb @@ -1,602 +1,602 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "gpuType": "T4" + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + "\n", + "\n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Crack segmentation with Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Crack Segmentation using Ultralytics YOLO11\n", + "\n", + "This notebook acts as a starting point for training the YOLO11 model using the [crack segmentation dataset](https://docs.ultralytics.com/datasets/segment/crack-seg/)." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset Structure\n", + "\n", + "The division of data within the Crack Segmentation Dataset is outlined as follows:\n", + "\n", + "- **Training set**: Consists of 3717 images with corresponding annotations.\n", + "\n", + "- **Testing set**: Comprises 112 images along with their respective annotations.\n", + "\n", + "- **Validation set**: Includes 200 images with their corresponding annotations." + ], + "metadata": { + "id": "xypoYW_oYZAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Applications\n", + "\n", + "Crack segmentation finds practical applications in infrastructure maintenance, aiding in the identification and assessment of structural damage. It also plays a crucial role in enhancing road safety by enabling automated systems to detect and address pavement cracks for timely repairs.\n" + ], + "metadata": { + "id": "R4SICbq5Yalg" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG" + }, + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset YAML File\n", + "\n", + "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" + ], + "metadata": { + "id": "xE6ntKojSfSD" + } + }, + { + "cell_type": "markdown", + "source": [ + "```yaml\n", + "# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license\n", + "\n", + "# Crack-seg dataset by Ultralytics\n", + "# Documentation: https://docs.ultralytics.com/datasets/segment/crack-seg/\n", + "# Example usage: yolo train data=crack-seg.yaml\n", + "# parent\n", + "# ├── ultralytics\n", + "# └── datasets\n", + "# └── crack-seg ← downloads here (91.6 MB)\n", + "\n", + "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", + "path: crack-seg # dataset root dir\n", + "train: images/train # train images (relative to 'path') 3717 images\n", + "val: images/val # val images (relative to 'path') 112 images\n", + "test: images/test # test images (relative to 'path') 200 images\n", + "\n", + "# Classes\n", + "names:\n", + " 0: crack\n", + "\n", + "# Download script/URL (optional)\n", + "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-seg.zip\n", + "```" + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Train\n", + "\n", + "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." + ], + "metadata": { + "id": "fMV-sNfiSt_X" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "model = YOLO(\"yolo11n-seg.pt\") # load a pretrained model (recommended for training)\n", + "\n", + "# Train the model\n", + "results = model.train(data=\"crack-seg.yaml\", epochs=3, imgsz=640, batch=64, workers=64)" + ], + "metadata": { "colab": { - "provenance": [], - "gpuType": "T4" + "base_uri": "https://localhost:8080/" }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" + "id": "QUgMYUvlNLvy", + "outputId": "fd8387d4-b9c9-406c-a7f7-61a28c60d241" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n-seg.pt to 'yolo11n-seg.pt'...\n" + ] }, - "accelerator": "GPU" - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - "\n", - "\n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Crack segmentation with Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Crack Segmentation using Ultralytics YOLO11\n", - "\n", - "This notebook acts as a starting point for training the YOLO11 model using the [crack segmentation dataset](https://docs.ultralytics.com/datasets/segment/crack-seg/)." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.90M/5.90M [00:00<00:00, 99.5MB/s]\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Dataset Structure\n", - "\n", - "The division of data within the Crack Segmentation Dataset is outlined as follows:\n", - "\n", - "- **Training set**: Consists of 3717 images with corresponding annotations.\n", - "\n", - "- **Testing set**: Comprises 112 images along with their respective annotations.\n", - "\n", - "- **Validation set**: Includes 200 images with their corresponding annotations." - ], - "metadata": { - "id": "xypoYW_oYZAf" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.70 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", + "\u001B[34m\u001B[1mengine/trainer: \u001B[0mtask=segment, mode=train, model=yolo11n-seg.pt, data=crack-seg.yaml, epochs=3, time=None, patience=100, batch=64, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=64, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/segment/train\n", + "\n", + "Dataset 'crack-seg.yaml' images not found ⚠️, missing path '/content/datasets/crack-seg/valid/images'\n", + "Downloading https://ultralytics.com/assets/crack-seg.zip to '/content/datasets/crack-seg.zip'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Applications\n", - "\n", - "Crack segmentation finds practical applications in infrastructure maintenance, aiding in the identification and assessment of structural damage. It also plays a crucial role in enhancing road safety by enabling automated systems to detect and address pavement cracks for timely repairs.\n" - ], - "metadata": { - "id": "R4SICbq5Yalg" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 91.1M/91.1M [00:02<00:00, 40.2MB/s]\n", + "Unzipping /content/datasets/crack-seg.zip to /content/datasets/crack-seg...: 100%|██████████| 8061/8061 [00:01<00:00, 4783.99file/s]" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG" - }, - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [] + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset download success ✅ (5.0s), saved to \u001B[1m/content/datasets\u001B[0m\n", + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Dataset YAML File\n", - "\n", - "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" - ], - "metadata": { - "id": "xE6ntKojSfSD" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "```yaml\n", - "# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license\n", - "\n", - "# Crack-seg dataset by Ultralytics\n", - "# Documentation: https://docs.ultralytics.com/datasets/segment/crack-seg/\n", - "# Example usage: yolo train data=crack-seg.yaml\n", - "# parent\n", - "# ├── ultralytics\n", - "# └── datasets\n", - "# └── crack-seg ← downloads here (91.6 MB)\n", - "\n", - "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", - "path: crack-seg # dataset root dir\n", - "train: images/train # train images (relative to 'path') 3717 images\n", - "val: images/val # val images (relative to 'path') 112 images\n", - "test: images/test # test images (relative to 'path') 200 images\n", - "\n", - "# Classes\n", - "names:\n", - " 0: crack\n", - "\n", - "# Download script/URL (optional)\n", - "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-seg.zip\n", - "```" - ], - "metadata": { - "id": "h8go3HNgN0WU" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Train\n", - "\n", - "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." - ], - "metadata": { - "id": "fMV-sNfiSt_X" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 755k/755k [00:00<00:00, 41.6MB/s]\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "model = YOLO(\"yolo11n-seg.pt\") # load a pretrained model (recommended for training)\n", - "\n", - "# Train the model\n", - "results = model.train(data=\"crack-seg.yaml\", epochs=3, imgsz=640, batch=64, workers=64)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "QUgMYUvlNLvy", - "outputId": "fd8387d4-b9c9-406c-a7f7-61a28c60d241" - }, - "execution_count": 2, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n-seg.pt to 'yolo11n-seg.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.90M/5.90M [00:00<00:00, 99.5MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.70 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", - "\u001b[34m\u001b[1mengine/trainer: \u001b[0mtask=segment, mode=train, model=yolo11n-seg.pt, data=crack-seg.yaml, epochs=3, time=None, patience=100, batch=64, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=64, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/segment/train\n", - "\n", - "Dataset 'crack-seg.yaml' images not found ⚠️, missing path '/content/datasets/crack-seg/valid/images'\n", - "Downloading https://ultralytics.com/assets/crack-seg.zip to '/content/datasets/crack-seg.zip'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 91.1M/91.1M [00:02<00:00, 40.2MB/s]\n", - "Unzipping /content/datasets/crack-seg.zip to /content/datasets/crack-seg...: 100%|██████████| 8061/8061 [00:01<00:00, 4783.99file/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Dataset download success ✅ (5.0s), saved to \u001b[1m/content/datasets\u001b[0m\n", - "\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 755k/755k [00:00<00:00, 41.6MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Overriding model.yaml nc=80 with nc=1\n", - "\n", - " from n params module arguments \n", - " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", - " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", - " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", - " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", - " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", - " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", - " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", - " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", - " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", - " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", - " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", - " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", - " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", - " 23 [16, 19, 22] 1 683635 ultralytics.nn.modules.head.Segment [1, 32, 64, [64, 128, 256]] \n", - "YOLO11n-seg summary: 355 layers, 2,842,803 parameters, 2,842,787 gradients, 10.4 GFLOPs\n", - "\n", - "Transferred 510/561 items from pretrained weights\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs/segment/train', view at http://localhost:6006/\n", - "Freezing layer 'model.23.dfl.conv.weight'\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks...\n", - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.35M/5.35M [00:00<00:00, 123MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mScanning /content/datasets/crack-seg/train/labels... 3717 images, 0 backgrounds, 0 corrupt: 100%|██████████| 3717/3717 [00:03<00:00, 1105.57it/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /content/datasets/crack-seg/train/labels.cache\n", - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "/usr/local/lib/python3.11/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 2.0.3 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", - " check_for_updates()\n", - "\u001b[34m\u001b[1mval: \u001b[0mScanning /content/datasets/crack-seg/valid/labels... 200 images, 1 backgrounds, 0 corrupt: 100%|██████████| 200/200 [00:00<00:00, 706.43it/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /content/datasets/crack-seg/valid/labels.cache\n", - "Plotting labels to runs/segment/train/labels.jpg... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.002, momentum=0.9) with parameter groups 90 weight(decay=0.0), 101 weight(decay=0.0005), 100 bias(decay=0.0)\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mmodel graph visualization added ✅\n", - "Image sizes 640 train, 640 val\n", - "Using 2 dataloader workers\n", - "Logging results to \u001b[1mruns/segment/train\u001b[0m\n", - "Starting training for 3 epochs...\n", - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 1/3 11.3G 1.349 2.3 2.286 1.316 15 640: 100%|██████████| 59/59 [01:34<00:00, 1.61s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.14s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 200 249 0.405 0.437 0.361 0.129 0.293 0.317 0.208 0.0421\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 2/3 11.3G 1.221 1.656 1.575 1.213 5 640: 100%|██████████| 59/59 [01:28<00:00, 1.49s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:06<00:00, 3.37s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 200 249 0.484 0.47 0.372 0.162 0.426 0.402 0.247 0.0643\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 3/3 11.5G 1.155 1.627 1.323 1.185 11 640: 100%|██████████| 59/59 [01:27<00:00, 1.48s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:06<00:00, 3.41s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 200 249 0.386 0.481 0.369 0.141 0.267 0.333 0.156 0.0343\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "3 epochs completed in 0.083 hours.\n", - "Optimizer stripped from runs/segment/train/weights/last.pt, 6.0MB\n", - "Optimizer stripped from runs/segment/train/weights/best.pt, 6.0MB\n", - "\n", - "Validating runs/segment/train/weights/best.pt...\n", - "Ultralytics 8.3.70 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", - "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.02s/it]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 200 249 0.485 0.476 0.371 0.161 0.42 0.398 0.243 0.0637\n", - "Speed: 0.2ms preprocess, 3.1ms inference, 0.0ms loss, 3.7ms postprocess per image\n", - "Results saved to \u001b[1mruns/segment/train\u001b[0m\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "![Dataset sample image](https://github.com/ultralytics/docs/releases/download/0/crack-segmentation-sample.avif)" - ], - "metadata": { - "id": "_Hapx6WkS--T" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Overriding model.yaml nc=80 with nc=1\n", + "\n", + " from n params module arguments \n", + " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", + " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", + " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", + " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", + " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", + " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", + " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", + " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", + " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", + " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", + " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", + " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", + " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", + " 23 [16, 19, 22] 1 683635 ultralytics.nn.modules.head.Segment [1, 32, 64, [64, 128, 256]] \n", + "YOLO11n-seg summary: 355 layers, 2,842,803 parameters, 2,842,787 gradients, 10.4 GFLOPs\n", + "\n", + "Transferred 510/561 items from pretrained weights\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mStart with 'tensorboard --logdir runs/segment/train', view at http://localhost:6006/\n", + "Freezing layer 'model.23.dfl.conv.weight'\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mrunning Automatic Mixed Precision (AMP) checks...\n", + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Predict\n", - "\n", - "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." - ], - "metadata": { - "id": "mKAUvDAbTEjQ" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.35M/5.35M [00:00<00:00, 123MB/s]\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Inference using the model (img/video/stream)\n", - "prediction_results = modelp.predict(\"https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-on-wall.jpg\", save=True)" - ], - "metadata": { - "id": "nzTbeqK_TB6t", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "b447bde9-2847-4863-d658-181c78d35258" - }, - "execution_count": 12, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Found https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-on-wall.jpg locally at crack-on-wall.jpg\n", - "image 1/1 /content/crack-on-wall.jpg: 384x640 1 crack, 10.7ms\n", - "Speed: 2.3ms preprocess, 10.7ms inference, 3.3ms postprocess per image at shape (1, 3, 384, 640)\n", - "Results saved to \u001b[1mruns/segment/predict\u001b[0m\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "        \n", - "" - ], - "metadata": { - "id": "lmNKY3rWWsvj" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mAMP: \u001B[0mchecks passed ✅\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Export\n", - "\n", - "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", - "\n", - "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", - "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", - "\n", - "| Format | `format` Argument | Model | Metadata | Arguments |\n", - "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", - "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", - "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", - "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", - "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", - "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", - "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", - "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", - "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", - "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", - "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", - "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", - "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", - "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", - "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" - ], - "metadata": { - "id": "vWBYYdXhTkN7" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mScanning /content/datasets/crack-seg/train/labels... 3717 images, 0 backgrounds, 0 corrupt: 100%|██████████| 3717/3717 [00:03<00:00, 1105.57it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mNew cache created: /content/datasets/crack-seg/train/labels.cache\n", + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.11/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 2.0.3 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", + " check_for_updates()\n", + "\u001B[34m\u001B[1mval: \u001B[0mScanning /content/datasets/crack-seg/valid/labels... 200 images, 1 backgrounds, 0 corrupt: 100%|██████████| 200/200 [00:00<00:00, 706.43it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mNew cache created: /content/datasets/crack-seg/valid/labels.cache\n", + "Plotting labels to runs/segment/train/labels.jpg... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m AdamW(lr=0.002, momentum=0.9) with parameter groups 90 weight(decay=0.0), 101 weight(decay=0.0005), 100 bias(decay=0.0)\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mmodel graph visualization added ✅\n", + "Image sizes 640 train, 640 val\n", + "Using 2 dataloader workers\n", + "Logging results to \u001B[1mruns/segment/train\u001B[0m\n", + "Starting training for 3 epochs...\n", + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Export the model\n", - "modele.export(format=\"torchscript\")" + "output_type": "stream", + "name": "stderr", + "text": [ + " 1/3 11.3G 1.349 2.3 2.286 1.316 15 640: 100%|██████████| 59/59 [01:34<00:00, 1.61s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.14s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 200 249 0.405 0.437 0.361 0.129 0.293 0.317 0.208 0.0421\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 2/3 11.3G 1.221 1.656 1.575 1.213 5 640: 100%|██████████| 59/59 [01:28<00:00, 1.49s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:06<00:00, 3.37s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 200 249 0.484 0.47 0.372 0.162 0.426 0.402 0.247 0.0643\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 3/3 11.5G 1.155 1.627 1.323 1.185 11 640: 100%|██████████| 59/59 [01:27<00:00, 1.48s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:06<00:00, 3.41s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 200 249 0.386 0.481 0.369 0.141 0.267 0.333 0.156 0.0343\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "3 epochs completed in 0.083 hours.\n", + "Optimizer stripped from runs/segment/train/weights/last.pt, 6.0MB\n", + "Optimizer stripped from runs/segment/train/weights/best.pt, 6.0MB\n", + "\n", + "Validating runs/segment/train/weights/best.pt...\n", + "Ultralytics 8.3.70 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", + "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.02s/it]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 200 249 0.485 0.476 0.371 0.161 0.42 0.398 0.243 0.0637\n", + "Speed: 0.2ms preprocess, 3.1ms inference, 0.0ms loss, 3.7ms postprocess per image\n", + "Results saved to \u001B[1mruns/segment/train\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Dataset sample image](https://github.com/ultralytics/docs/releases/download/0/crack-segmentation-sample.avif)" + ], + "metadata": { + "id": "_Hapx6WkS--T" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Predict\n", + "\n", + "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." + ], + "metadata": { + "id": "mKAUvDAbTEjQ" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Inference using the model (img/video/stream)\n", + "prediction_results = modelp.predict(\"https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-on-wall.jpg\", save=True)" + ], + "metadata": { + "id": "nzTbeqK_TB6t", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "b447bde9-2847-4863-d658-181c78d35258" + }, + "execution_count": 12, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Found https://github.com/ultralytics/assets/releases/download/v0.0.0/crack-on-wall.jpg locally at crack-on-wall.jpg\n", + "image 1/1 /content/crack-on-wall.jpg: 384x640 1 crack, 10.7ms\n", + "Speed: 2.3ms preprocess, 10.7ms inference, 3.3ms postprocess per image at shape (1, 3, 384, 640)\n", + "Results saved to \u001B[1mruns/segment/predict\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "        \n", + "" + ], + "metadata": { + "id": "lmNKY3rWWsvj" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Export\n", + "\n", + "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", + "\n", + "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", + "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", + "\n", + "| Format | `format` Argument | Model | Metadata | Arguments |\n", + "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", + "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", + "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", + "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", + "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", + "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", + "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", + "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", + "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", + "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", + "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", + "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", + "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", + "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", + "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" + ], + "metadata": { + "id": "vWBYYdXhTkN7" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Export the model\n", + "modele.export(format=\"torchscript\")" + ], + "metadata": { + "id": "S4nWG40CTlOD", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 273 + }, + "outputId": "c3db12b5-4f21-4c79-eea1-484057f2c7a4" + }, + "execution_count": 15, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.70 🚀 Python-3.11.11 torch-2.5.1+cu124 CPU (Intel Xeon 2.00GHz)\n", + "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n", + "\n", + "\u001B[34m\u001B[1mPyTorch:\u001B[0m starting from '/content/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 37, 8400), (1, 32, 160, 160)) (5.7 MB)\n", + "\n", + "\u001B[34m\u001B[1mTorchScript:\u001B[0m starting export with torch 2.5.1+cu124...\n", + "\u001B[34m\u001B[1mTorchScript:\u001B[0m export success ✅ 4.8s, saved as '/content/best.torchscript' (11.4 MB)\n", + "\n", + "Export complete (5.7s)\n", + "Results saved to \u001B[1m/content\u001B[0m\n", + "Predict: yolo predict task=segment model=/content/best.torchscript imgsz=640 \n", + "Validate: yolo val task=segment model=/content/best.torchscript imgsz=640 data=/usr/local/lib/python3.11/dist-packages/ultralytics/cfg/datasets/crack-seg.yaml \n", + "Visualize: https://netron.app\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/best.torchscript'" ], - "metadata": { - "id": "S4nWG40CTlOD", - "colab": { - "base_uri": "https://localhost:8080/", - "height": 273 - }, - "outputId": "c3db12b5-4f21-4c79-eea1-484057f2c7a4" - }, - "execution_count": 15, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.70 🚀 Python-3.11.11 torch-2.5.1+cu124 CPU (Intel Xeon 2.00GHz)\n", - "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n", - "\n", - "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from '/content/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 37, 8400), (1, 32, 160, 160)) (5.7 MB)\n", - "\n", - "\u001b[34m\u001b[1mTorchScript:\u001b[0m starting export with torch 2.5.1+cu124...\n", - "\u001b[34m\u001b[1mTorchScript:\u001b[0m export success ✅ 4.8s, saved as '/content/best.torchscript' (11.4 MB)\n", - "\n", - "Export complete (5.7s)\n", - "Results saved to \u001b[1m/content\u001b[0m\n", - "Predict: yolo predict task=segment model=/content/best.torchscript imgsz=640 \n", - "Validate: yolo val task=segment model=/content/best.torchscript imgsz=640 data=/usr/local/lib/python3.11/dist-packages/ultralytics/cfg/datasets/crack-seg.yaml \n", - "Visualize: https://netron.app\n" - ] - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "'/content/best.torchscript'" - ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - } - }, - "metadata": {}, - "execution_count": 15 - } - ] + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 15 } - ] + ] + } + ] } diff --git a/notebooks/how-to-train-ultralytics-yolo-on-homeobjects-dataset.ipynb b/notebooks/how-to-train-ultralytics-yolo-on-homeobjects-dataset.ipynb index 835a01e..f889815 100644 --- a/notebooks/how-to-train-ultralytics-yolo-on-homeobjects-dataset.ipynb +++ b/notebooks/how-to-train-ultralytics-yolo-on-homeobjects-dataset.ipynb @@ -1,675 +1,675 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - " \n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the HomeObjects-3K object detection using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7EM2nwU4jshF" - }, - "source": [ - "# HomeObjects-3K Object Detection using Ultralytics YOLO11\n", - "\n", - "This notebook serves as a starting point for training the YOLO11 model on [home objects](https://docs.ultralytics.com/datasets/detect/homeobjects-3k/) detection dataset." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "xypoYW_oYZAf" - }, - "source": [ - "## Dataset Structure\n", - "\n", - "The HomeObjects-3K dataset is organized into the following subsets:\n", - "\n", - "- **Training Set**: Comprises 2,285 annotated images featuring objects such as sofas, chairs, tables, lamps, and more.\n", - "\n", - "- **Validation Set**: Includes 404 annotated images designated for evaluating model performance.\n", - "\n", - "## Applications\n", - "\n", - "HomeObjects-3K unlocks a broad range of use cases in indoor computer vision, supporting both cutting-edge research and real-world applications:\n", - "\n", - "- ✅ **Indoor Object Detection**: Leverage models such as Ultralytics YOLO11 to accurately detect and localize everyday household items—like beds, chairs, lamps, and laptops. This enables real-time scene comprehension for indoor environments.\n", - "\n", - "- ✅ **Scene Layout Parsing**: Essential for robotics and smart home systems, this capability allows intelligent devices to interpret room layouts by identifying the placement of doors, windows, and furniture, enhancing navigation and interaction.\n", - "\n", - "- ✅ **Augmented Reality (AR)**: Power object-aware AR applications by recognizing items such as TVs or wardrobes and overlaying contextual information or visual effects in real time." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "wbvMlHd_QwMG" - }, - "outputs": [], - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "xE6ntKojSfSD" - }, - "source": [ - "## Dataset YAML File\n", - "\n", - "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "h8go3HNgN0WU" - }, - "source": [ - "```yaml\n", - "# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license\n", - "\n", - "# HomeObjects-3K dataset by Ultralytics\n", - "# Documentation: https://docs.ultralytics.com/datasets/detect/homeobjects-3k/\n", - "# Example usage: yolo train data=HomeObjects-3K.yaml\n", - "# parent\n", - "# ├── ultralytics\n", - "# └── datasets\n", - "# └── homeobjects-3K ← downloads here (390 MB)\n", - "\n", - "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", - "path: homeobjects-3K # dataset root dir\n", - "train: images/train # train images (relative to 'path') 2285 images\n", - "val: images/val # val images (relative to 'path') 404 images\n", - "\n", - "# Classes\n", - "names:\n", - " 0: bed\n", - " 1: sofa\n", - " 2: chair\n", - " 3: table\n", - " 4: lamp\n", - " 5: tv\n", - " 6: laptop\n", - " 7: wardrobe\n", - " 8: window\n", - " 9: door\n", - " 10: potted plant\n", - " 11: photo frame\n", - "\n", - "# Download script/URL (optional)\n", - "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/homeobjects-3K.zip\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "fMV-sNfiSt_X" - }, - "source": [ - "## Train\n", - "\n", - "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "id": "QUgMYUvlNLvy", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "018636ae-e858-4acb-f3db-ce777e2a588a" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.35M/5.35M [00:00<00:00, 301MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.140 🚀 Python-3.11.12 torch-2.6.0+cu124 CUDA:0 (NVIDIA L4, 22693MiB)\n", - "\u001b[34m\u001b[1mengine/trainer: \u001b[0magnostic_nms=False, amp=True, augment=False, auto_augment=randaugment, batch=16, bgr=0.0, box=7.5, cache=False, cfg=None, classes=None, close_mosaic=10, cls=0.5, conf=None, copy_paste=0.0, copy_paste_mode=flip, cos_lr=False, cutmix=0.0, data=HomeObjects-3K.yaml, degrees=0.0, deterministic=True, device=None, dfl=1.5, dnn=False, dropout=0.0, dynamic=False, embed=None, epochs=3, erasing=0.4, exist_ok=False, fliplr=0.5, flipud=0.0, format=torchscript, fraction=1.0, freeze=None, half=False, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, imgsz=640, int8=False, iou=0.7, keras=False, kobj=1.0, line_width=None, lr0=0.01, lrf=0.01, mask_ratio=4, max_det=300, mixup=0.0, mode=train, model=yolo11n.pt, momentum=0.937, mosaic=1.0, multi_scale=False, name=train, nbs=64, nms=False, opset=None, optimize=False, optimizer=auto, overlap_mask=True, patience=100, perspective=0.0, plots=True, pose=12.0, pretrained=True, profile=False, project=None, rect=False, resume=False, retina_masks=False, save=True, save_conf=False, save_crop=False, save_dir=runs/detect/train, save_frames=False, save_json=False, save_period=-1, save_txt=False, scale=0.5, seed=0, shear=0.0, show=False, show_boxes=True, show_conf=True, show_labels=True, simplify=True, single_cls=False, source=None, split=val, stream_buffer=False, task=detect, time=None, tracker=botsort.yaml, translate=0.1, val=True, verbose=True, vid_stride=1, visualize=False, warmup_bias_lr=0.1, warmup_epochs=3.0, warmup_momentum=0.8, weight_decay=0.0005, workers=8, workspace=None\n", - "\n", - "WARNING ⚠️ Dataset 'HomeObjects-3K.yaml' images not found, missing path '/content/datasets/homeobjects-3K/valid/images'\n", - "Downloading https://ultralytics.com/assets/homeobjects-3K.zip to '/content/datasets/homeobjects-3K.zip'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n", - "100%|██████████| 390M/390M [00:33<00:00, 12.4MB/s]\n", - "Unzipping /content/datasets/homeobjects-3K.zip to /content/datasets/homeobjects-3K...: 100%|██████████| 5384/5384 [00:02<00:00, 1875.46file/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Dataset download success ✅ (38.0s), saved to \u001b[1m/content/datasets\u001b[0m\n", - "\n", - "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 755k/755k [00:00<00:00, 126MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Overriding model.yaml nc=80 with nc=12\n", - "\n", - " from n params module arguments \n", - " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", - " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", - " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", - " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", - " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", - " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", - " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", - " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", - " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", - " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", - " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", - " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", - " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " 23 [16, 19, 22] 1 433012 ultralytics.nn.modules.head.Detect [12, [64, 128, 256]] \n", - "YOLO11n summary: 181 layers, 2,592,180 parameters, 2,592,164 gradients, 6.5 GFLOPs\n", - "\n", - "Transferred 448/499 items from pretrained weights\n", - "Freezing layer 'model.23.dfl.conv.weight'\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks...\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n", - "\u001b[34m\u001b[1mtrain: \u001b[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 2696.1±1335.8 MB/s, size: 185.7 KB)\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mScanning /content/datasets/homeobjects-3K/train/labels... 2285 images, 0 backgrounds, 0 corrupt: 100%|██████████| 2285/2285 [00:01<00:00, 1518.21it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0m/content/datasets/homeobjects-3K/train/images/living_room_1303.jpg: 1 duplicate labels removed\n", - "\u001b[34m\u001b[1mtrain: \u001b[0m/content/datasets/homeobjects-3K/train/images/living_room_1675.jpg: 1 duplicate labels removed\n", - "\u001b[34m\u001b[1mtrain: \u001b[0m/content/datasets/homeobjects-3K/train/images/living_room_1795.jpg: 1 duplicate labels removed\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /content/datasets/homeobjects-3K/train/labels.cache\n", - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method='weighted_average', num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", - "\u001b[34m\u001b[1mval: \u001b[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 1660.2±1293.4 MB/s, size: 154.5 KB)\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mScanning /content/datasets/homeobjects-3K/valid/labels... 404 images, 0 backgrounds, 0 corrupt: 100%|██████████| 404/404 [00:00<00:00, 1245.30it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /content/datasets/homeobjects-3K/valid/labels.cache\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Plotting labels to runs/detect/train/labels.jpg... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.000625, momentum=0.9) with parameter groups 81 weight(decay=0.0), 88 weight(decay=0.0005), 87 bias(decay=0.0)\n", - "Image sizes 640 train, 640 val\n", - "Using 8 dataloader workers\n", - "Logging results to \u001b[1mruns/detect/train\u001b[0m\n", - "Starting training for 3 epochs...\n", - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 1/3 2.88G 1.316 3.312 1.258 197 640: 100%|██████████| 143/143 [00:19<00:00, 7.19it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:03<00:00, 3.59it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 404 3466 0.5 0.324 0.314 0.203\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 2/3 2.9G 1.297 2.003 1.274 214 640: 100%|██████████| 143/143 [00:17<00:00, 8.26it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:02<00:00, 6.02it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 404 3466 0.499 0.553 0.506 0.334\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 3/3 2.91G 1.234 1.662 1.247 214 640: 100%|██████████| 143/143 [00:16<00:00, 8.50it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:02<00:00, 6.33it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 404 3466 0.568 0.559 0.57 0.388\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "3 epochs completed in 0.018 hours.\n", - "Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB\n", - "Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB\n", - "\n", - "Validating runs/detect/train/weights/best.pt...\n", - "Ultralytics 8.3.140 🚀 Python-3.11.12 torch-2.6.0+cu124 CUDA:0 (NVIDIA L4, 22693MiB)\n", - "YOLO11n summary (fused): 100 layers, 2,584,492 parameters, 0 gradients, 6.3 GFLOPs\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:03<00:00, 3.55it/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 404 3466 0.571 0.556 0.57 0.389\n", - " bed 22 22 0.689 0.364 0.533 0.375\n", - " sofa 286 398 0.709 0.781 0.833 0.593\n", - " chair 154 305 0.484 0.734 0.666 0.451\n", - " table 300 469 0.635 0.714 0.719 0.51\n", - " lamp 199 304 0.435 0.533 0.417 0.25\n", - " tv 51 54 0.605 0.556 0.572 0.459\n", - " wardrobe 85 109 0.444 0.403 0.405 0.255\n", - " window 162 371 0.54 0.367 0.442 0.252\n", - " door 58 85 0.331 0.28 0.284 0.2\n", - " potted plant 318 788 0.64 0.633 0.629 0.326\n", - " photo frame 211 561 0.766 0.75 0.774 0.606\n", - "Speed: 0.1ms preprocess, 0.8ms inference, 0.0ms loss, 1.5ms postprocess per image\n", - "Results saved to \u001b[1mruns/detect/train\u001b[0m\n" - ] - } - ], - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "model = YOLO(\"yolo11n.pt\") # load a pretrained model (recommended for training)\n", - "\n", - "# Train the model\n", - "results = model.train(data=\"HomeObjects-3K.yaml\", epochs=3, imgsz=640)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "_Hapx6WkS--T" - }, - "source": [ - "![HomeObject-3K dataset sample image](https://github.com/ultralytics/docs/releases/download/0/homeobjects-3k-dataset-sample.avif)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "mKAUvDAbTEjQ" - }, - "source": [ - "## Predict\n", - "\n", - "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "nzTbeqK_TB6t", - "outputId": "a787cb74-8c0e-4cd7-85ae-54827dd104cc" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Downloading https://ultralytics.com/assets/home-objects-sample.jpg to 'home-objects-sample.jpg'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 117k/117k [00:00<00:00, 41.1MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "image 1/1 /content/home-objects-sample.jpg: 448x640 1 sofa, 2 tables, 5 lamps, 2 potted plants, 6 photo frames, 69.9ms\n", - "Speed: 3.3ms preprocess, 69.9ms inference, 2.1ms postprocess per image at shape (1, 3, 448, 640)\n", - "Results saved to \u001b[1mruns/detect/predict\u001b[0m\n" - ] - } - ], - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Inference using the model\n", - "prediction_results = modelp.predict(\"https://ultralytics.com/assets/home-objects-sample.jpg\", save=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "lmNKY3rWWsvj" - }, - "source": [ - "        \n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "vWBYYdXhTkN7" - }, - "source": [ - "## Export\n", - "\n", - "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", - "\n", - "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", - "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", - "\n", - "| Format | `format` Argument | Model | Metadata | Arguments |\n", - "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", - "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", - "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", - "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", - "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", - "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", - "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", - "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", - "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", - "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", - "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", - "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", - "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", - "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", - "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "id": "S4nWG40CTlOD", - "colab": { - "base_uri": "https://localhost:8080/", - "height": 383 - }, - "outputId": "17be2557-0e41-4cd5-e348-dd81902a0826" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.140 🚀 Python-3.11.12 torch-2.6.0+cu124 CPU (Intel Xeon 2.20GHz)\n", - "💡 ProTip: Export to OpenVINO format for best performance on Intel CPUs. Learn more at https://docs.ultralytics.com/integrations/openvino/\n", - "YOLO11n summary (fused): 100 layers, 2,584,492 parameters, 0 gradients, 6.3 GFLOPs\n", - "\n", - "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from '/content/runs/detect/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 16, 8400) (5.2 MB)\n", - "\u001b[31m\u001b[1mrequirements:\u001b[0m Ultralytics requirements ['onnx>=1.12.0,<1.18.0', 'onnxslim>=0.1.53', 'onnxruntime-gpu'] not found, attempting AutoUpdate...\n", - "\n", - "\u001b[31m\u001b[1mrequirements:\u001b[0m AutoUpdate success ✅ 4.2s\n", - "WARNING ⚠️ \u001b[31m\u001b[1mrequirements:\u001b[0m \u001b[1mRestart runtime or rerun command for updates to take effect\u001b[0m\n", - "\n", - "\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.17.0 opset 19...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m slimming with onnxslim 0.1.53...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m export success ✅ 5.7s, saved as '/content/runs/detect/train/weights/best.onnx' (10.1 MB)\n", - "\n", - "Export complete (6.2s)\n", - "Results saved to \u001b[1m/content/runs/detect/train/weights\u001b[0m\n", - "Predict: yolo predict task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 \n", - "Validate: yolo val task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 data=/usr/local/lib/python3.11/dist-packages/ultralytics/cfg/datasets/HomeObjects-3K.yaml \n", - "Visualize: https://netron.app\n" - ] - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "'/content/runs/detect/train/weights/best.onnx'" - ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - } - }, - "metadata": {}, - "execution_count": 7 - } - ], - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a custom trained model\n", - "\n", - "# Export the model\n", - "modele.export(format=\"onnx\")" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "vlHp09Nueb3d" - }, - "source": [ - "## 💡Citation\n", - "\n", - "```bibtex\n", - "@dataset{Jocher_Ultralytics_Datasets_2025,\n", - " author = {Jocher, Glenn and Rizwan, Muhammad},\n", - " license = {AGPL-3.0},\n", - " month = {May},\n", - " title = {Ultralytics Datasets: HomeObjects-3K Detection Dataset},\n", - " url = {https://docs.ultralytics.com/datasets/detect/homeobject-3k/},\n", - " version = {1.0.0},\n", - " year = {2025}\n", - "}\n", - "```\n" - ] + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + " \n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the HomeObjects-3K object detection using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7EM2nwU4jshF" + }, + "source": [ + "# HomeObjects-3K Object Detection using Ultralytics YOLO11\n", + "\n", + "This notebook serves as a starting point for training the YOLO11 model on [home objects](https://docs.ultralytics.com/datasets/detect/homeobjects-3k/) detection dataset." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "xypoYW_oYZAf" + }, + "source": [ + "## Dataset Structure\n", + "\n", + "The HomeObjects-3K dataset is organized into the following subsets:\n", + "\n", + "- **Training Set**: Comprises 2,285 annotated images featuring objects such as sofas, chairs, tables, lamps, and more.\n", + "\n", + "- **Validation Set**: Includes 404 annotated images designated for evaluating model performance.\n", + "\n", + "## Applications\n", + "\n", + "HomeObjects-3K unlocks a broad range of use cases in indoor computer vision, supporting both cutting-edge research and real-world applications:\n", + "\n", + "- ✅ **Indoor Object Detection**: Leverage models such as Ultralytics YOLO11 to accurately detect and localize everyday household items—like beds, chairs, lamps, and laptops. This enables real-time scene comprehension for indoor environments.\n", + "\n", + "- ✅ **Scene Layout Parsing**: Essential for robotics and smart home systems, this capability allows intelligent devices to interpret room layouts by identifying the placement of doors, windows, and furniture, enhancing navigation and interaction.\n", + "\n", + "- ✅ **Augmented Reality (AR)**: Power object-aware AR applications by recognizing items such as TVs or wardrobes and overlaying contextual information or visual effects in real time." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "wbvMlHd_QwMG" + }, + "outputs": [], + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "xE6ntKojSfSD" + }, + "source": [ + "## Dataset YAML File\n", + "\n", + "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "h8go3HNgN0WU" + }, + "source": [ + "```yaml\n", + "# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license\n", + "\n", + "# HomeObjects-3K dataset by Ultralytics\n", + "# Documentation: https://docs.ultralytics.com/datasets/detect/homeobjects-3k/\n", + "# Example usage: yolo train data=HomeObjects-3K.yaml\n", + "# parent\n", + "# ├── ultralytics\n", + "# └── datasets\n", + "# └── homeobjects-3K ← downloads here (390 MB)\n", + "\n", + "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", + "path: homeobjects-3K # dataset root dir\n", + "train: images/train # train images (relative to 'path') 2285 images\n", + "val: images/val # val images (relative to 'path') 404 images\n", + "\n", + "# Classes\n", + "names:\n", + " 0: bed\n", + " 1: sofa\n", + " 2: chair\n", + " 3: table\n", + " 4: lamp\n", + " 5: tv\n", + " 6: laptop\n", + " 7: wardrobe\n", + " 8: window\n", + " 9: door\n", + " 10: potted plant\n", + " 11: photo frame\n", + "\n", + "# Download script/URL (optional)\n", + "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/homeobjects-3K.zip\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "fMV-sNfiSt_X" + }, + "source": [ + "## Train\n", + "\n", + "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "id": "QUgMYUvlNLvy", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "018636ae-e858-4acb-f3db-ce777e2a588a" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.35M/5.35M [00:00<00:00, 301MB/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.140 🚀 Python-3.11.12 torch-2.6.0+cu124 CUDA:0 (NVIDIA L4, 22693MiB)\n", + "\u001B[34m\u001B[1mengine/trainer: \u001B[0magnostic_nms=False, amp=True, augment=False, auto_augment=randaugment, batch=16, bgr=0.0, box=7.5, cache=False, cfg=None, classes=None, close_mosaic=10, cls=0.5, conf=None, copy_paste=0.0, copy_paste_mode=flip, cos_lr=False, cutmix=0.0, data=HomeObjects-3K.yaml, degrees=0.0, deterministic=True, device=None, dfl=1.5, dnn=False, dropout=0.0, dynamic=False, embed=None, epochs=3, erasing=0.4, exist_ok=False, fliplr=0.5, flipud=0.0, format=torchscript, fraction=1.0, freeze=None, half=False, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, imgsz=640, int8=False, iou=0.7, keras=False, kobj=1.0, line_width=None, lr0=0.01, lrf=0.01, mask_ratio=4, max_det=300, mixup=0.0, mode=train, model=yolo11n.pt, momentum=0.937, mosaic=1.0, multi_scale=False, name=train, nbs=64, nms=False, opset=None, optimize=False, optimizer=auto, overlap_mask=True, patience=100, perspective=0.0, plots=True, pose=12.0, pretrained=True, profile=False, project=None, rect=False, resume=False, retina_masks=False, save=True, save_conf=False, save_crop=False, save_dir=runs/detect/train, save_frames=False, save_json=False, save_period=-1, save_txt=False, scale=0.5, seed=0, shear=0.0, show=False, show_boxes=True, show_conf=True, show_labels=True, simplify=True, single_cls=False, source=None, split=val, stream_buffer=False, task=detect, time=None, tracker=botsort.yaml, translate=0.1, val=True, verbose=True, vid_stride=1, visualize=False, warmup_bias_lr=0.1, warmup_epochs=3.0, warmup_momentum=0.8, weight_decay=0.0005, workers=8, workspace=None\n", + "\n", + "WARNING ⚠️ Dataset 'HomeObjects-3K.yaml' images not found, missing path '/content/datasets/homeobjects-3K/valid/images'\n", + "Downloading https://ultralytics.com/assets/homeobjects-3K.zip to '/content/datasets/homeobjects-3K.zip'...\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n", + "100%|██████████| 390M/390M [00:33<00:00, 12.4MB/s]\n", + "Unzipping /content/datasets/homeobjects-3K.zip to /content/datasets/homeobjects-3K...: 100%|██████████| 5384/5384 [00:02<00:00, 1875.46file/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset download success ✅ (38.0s), saved to \u001B[1m/content/datasets\u001B[0m\n", + "\n", + "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 755k/755k [00:00<00:00, 126MB/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Overriding model.yaml nc=80 with nc=12\n", + "\n", + " from n params module arguments \n", + " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", + " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", + " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", + " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", + " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", + " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", + " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", + " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", + " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", + " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", + " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", + " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", + " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " 23 [16, 19, 22] 1 433012 ultralytics.nn.modules.head.Detect [12, [64, 128, 256]] \n", + "YOLO11n summary: 181 layers, 2,592,180 parameters, 2,592,164 gradients, 6.5 GFLOPs\n", + "\n", + "Transferred 448/499 items from pretrained weights\n", + "Freezing layer 'model.23.dfl.conv.weight'\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mrunning Automatic Mixed Precision (AMP) checks...\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mchecks passed ✅\n", + "\u001B[34m\u001B[1mtrain: \u001B[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 2696.1±1335.8 MB/s, size: 185.7 KB)\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mScanning /content/datasets/homeobjects-3K/train/labels... 2285 images, 0 backgrounds, 0 corrupt: 100%|██████████| 2285/2285 [00:01<00:00, 1518.21it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0m/content/datasets/homeobjects-3K/train/images/living_room_1303.jpg: 1 duplicate labels removed\n", + "\u001B[34m\u001B[1mtrain: \u001B[0m/content/datasets/homeobjects-3K/train/images/living_room_1675.jpg: 1 duplicate labels removed\n", + "\u001B[34m\u001B[1mtrain: \u001B[0m/content/datasets/homeobjects-3K/train/images/living_room_1795.jpg: 1 duplicate labels removed\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mNew cache created: /content/datasets/homeobjects-3K/train/labels.cache\n", + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method='weighted_average', num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", + "\u001B[34m\u001B[1mval: \u001B[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 1660.2±1293.4 MB/s, size: 154.5 KB)\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mScanning /content/datasets/homeobjects-3K/valid/labels... 404 images, 0 backgrounds, 0 corrupt: 100%|██████████| 404/404 [00:00<00:00, 1245.30it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mNew cache created: /content/datasets/homeobjects-3K/valid/labels.cache\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Plotting labels to runs/detect/train/labels.jpg... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m AdamW(lr=0.000625, momentum=0.9) with parameter groups 81 weight(decay=0.0), 88 weight(decay=0.0005), 87 bias(decay=0.0)\n", + "Image sizes 640 train, 640 val\n", + "Using 8 dataloader workers\n", + "Logging results to \u001B[1mruns/detect/train\u001B[0m\n", + "Starting training for 3 epochs...\n", + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 1/3 2.88G 1.316 3.312 1.258 197 640: 100%|██████████| 143/143 [00:19<00:00, 7.19it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:03<00:00, 3.59it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 404 3466 0.5 0.324 0.314 0.203\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 2/3 2.9G 1.297 2.003 1.274 214 640: 100%|██████████| 143/143 [00:17<00:00, 8.26it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:02<00:00, 6.02it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 404 3466 0.499 0.553 0.506 0.334\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 3/3 2.91G 1.234 1.662 1.247 214 640: 100%|██████████| 143/143 [00:16<00:00, 8.50it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:02<00:00, 6.33it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 404 3466 0.568 0.559 0.57 0.388\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "3 epochs completed in 0.018 hours.\n", + "Optimizer stripped from runs/detect/train/weights/last.pt, 5.5MB\n", + "Optimizer stripped from runs/detect/train/weights/best.pt, 5.5MB\n", + "\n", + "Validating runs/detect/train/weights/best.pt...\n", + "Ultralytics 8.3.140 🚀 Python-3.11.12 torch-2.6.0+cu124 CUDA:0 (NVIDIA L4, 22693MiB)\n", + "YOLO11n summary (fused): 100 layers, 2,584,492 parameters, 0 gradients, 6.3 GFLOPs\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 13/13 [00:03<00:00, 3.55it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 404 3466 0.571 0.556 0.57 0.389\n", + " bed 22 22 0.689 0.364 0.533 0.375\n", + " sofa 286 398 0.709 0.781 0.833 0.593\n", + " chair 154 305 0.484 0.734 0.666 0.451\n", + " table 300 469 0.635 0.714 0.719 0.51\n", + " lamp 199 304 0.435 0.533 0.417 0.25\n", + " tv 51 54 0.605 0.556 0.572 0.459\n", + " wardrobe 85 109 0.444 0.403 0.405 0.255\n", + " window 162 371 0.54 0.367 0.442 0.252\n", + " door 58 85 0.331 0.28 0.284 0.2\n", + " potted plant 318 788 0.64 0.633 0.629 0.326\n", + " photo frame 211 561 0.766 0.75 0.774 0.606\n", + "Speed: 0.1ms preprocess, 0.8ms inference, 0.0ms loss, 1.5ms postprocess per image\n", + "Results saved to \u001B[1mruns/detect/train\u001B[0m\n" + ] } - ], - "metadata": { - "accelerator": "GPU", + ], + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "model = YOLO(\"yolo11n.pt\") # load a pretrained model (recommended for training)\n", + "\n", + "# Train the model\n", + "results = model.train(data=\"HomeObjects-3K.yaml\", epochs=3, imgsz=640)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "_Hapx6WkS--T" + }, + "source": [ + "![HomeObject-3K dataset sample image](https://github.com/ultralytics/docs/releases/download/0/homeobjects-3k-dataset-sample.avif)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "mKAUvDAbTEjQ" + }, + "source": [ + "## Predict\n", + "\n", + "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { "colab": { - "gpuType": "A100", - "machine_shape": "hm", - "provenance": [] + "base_uri": "https://localhost:8080/" + }, + "id": "nzTbeqK_TB6t", + "outputId": "a787cb74-8c0e-4cd7-85ae-54827dd104cc" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Downloading https://ultralytics.com/assets/home-objects-sample.jpg to 'home-objects-sample.jpg'...\n" + ] }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 117k/117k [00:00<00:00, 41.1MB/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "image 1/1 /content/home-objects-sample.jpg: 448x640 1 sofa, 2 tables, 5 lamps, 2 potted plants, 6 photo frames, 69.9ms\n", + "Speed: 3.3ms preprocess, 69.9ms inference, 2.1ms postprocess per image at shape (1, 3, 448, 640)\n", + "Results saved to \u001B[1mruns/detect/predict\u001B[0m\n" + ] } + ], + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Inference using the model\n", + "prediction_results = modelp.predict(\"https://ultralytics.com/assets/home-objects-sample.jpg\", save=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "lmNKY3rWWsvj" + }, + "source": [ + "        \n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "vWBYYdXhTkN7" + }, + "source": [ + "## Export\n", + "\n", + "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", + "\n", + "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", + "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", + "\n", + "| Format | `format` Argument | Model | Metadata | Arguments |\n", + "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", + "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", + "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", + "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", + "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", + "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", + "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", + "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", + "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", + "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", + "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", + "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", + "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", + "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", + "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "id": "S4nWG40CTlOD", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 383 + }, + "outputId": "17be2557-0e41-4cd5-e348-dd81902a0826" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.140 🚀 Python-3.11.12 torch-2.6.0+cu124 CPU (Intel Xeon 2.20GHz)\n", + "💡 ProTip: Export to OpenVINO format for best performance on Intel CPUs. Learn more at https://docs.ultralytics.com/integrations/openvino/\n", + "YOLO11n summary (fused): 100 layers, 2,584,492 parameters, 0 gradients, 6.3 GFLOPs\n", + "\n", + "\u001B[34m\u001B[1mPyTorch:\u001B[0m starting from '/content/runs/detect/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 16, 8400) (5.2 MB)\n", + "\u001B[31m\u001B[1mrequirements:\u001B[0m Ultralytics requirements ['onnx>=1.12.0,<1.18.0', 'onnxslim>=0.1.53', 'onnxruntime-gpu'] not found, attempting AutoUpdate...\n", + "\n", + "\u001B[31m\u001B[1mrequirements:\u001B[0m AutoUpdate success ✅ 4.2s\n", + "WARNING ⚠️ \u001B[31m\u001B[1mrequirements:\u001B[0m \u001B[1mRestart runtime or rerun command for updates to take effect\u001B[0m\n", + "\n", + "\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m starting export with onnx 1.17.0 opset 19...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m slimming with onnxslim 0.1.53...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m export success ✅ 5.7s, saved as '/content/runs/detect/train/weights/best.onnx' (10.1 MB)\n", + "\n", + "Export complete (6.2s)\n", + "Results saved to \u001B[1m/content/runs/detect/train/weights\u001B[0m\n", + "Predict: yolo predict task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 \n", + "Validate: yolo val task=detect model=/content/runs/detect/train/weights/best.onnx imgsz=640 data=/usr/local/lib/python3.11/dist-packages/ultralytics/cfg/datasets/HomeObjects-3K.yaml \n", + "Visualize: https://netron.app\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/runs/detect/train/weights/best.onnx'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 7 + } + ], + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a custom trained model\n", + "\n", + "# Export the model\n", + "modele.export(format=\"onnx\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "vlHp09Nueb3d" + }, + "source": [ + "## 💡Citation\n", + "\n", + "```bibtex\n", + "@dataset{Jocher_Ultralytics_Datasets_2025,\n", + " author = {Jocher, Glenn and Rizwan, Muhammad},\n", + " license = {AGPL-3.0},\n", + " month = {May},\n", + " title = {Ultralytics Datasets: HomeObjects-3K Detection Dataset},\n", + " url = {https://docs.ultralytics.com/datasets/detect/homeobject-3k/},\n", + " version = {1.0.0},\n", + " year = {2025}\n", + "}\n", + "```\n" + ] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "gpuType": "A100", + "machine_shape": "hm", + "provenance": [] }, - "nbformat": 4, - "nbformat_minor": 0 + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 } diff --git a/notebooks/how-to-train-ultralytics-yolo-on-medical-pills-dataset.ipynb b/notebooks/how-to-train-ultralytics-yolo-on-medical-pills-dataset.ipynb index 235d3c3..4cfb1f7 100644 --- a/notebooks/how-to-train-ultralytics-yolo-on-medical-pills-dataset.ipynb +++ b/notebooks/how-to-train-ultralytics-yolo-on-medical-pills-dataset.ipynb @@ -1,1170 +1,1170 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + " \n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Medical pills detection using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Medical Pills Detection using Ultralytics YOLO11\n", + "\n", + "This notebook serves as a starting point for training the YOLO11 model on [medical pills](https://docs.ultralytics.com/datasets/detect/medical-pills/) object detection dataset." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset Structure\n", + "\n", + "The medical-pills dataset is divided into two subsets:\n", + "\n", + "- **Training set**: Consisting of 92 images, each annotated with the class `pill`.\n", + "- **Validation set**: Comprising 23 images with corresponding annotations." + ], + "metadata": { + "id": "xypoYW_oYZAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Applications\n", + "\n", + "Using computer vision for medical-pills detection enables automation in the pharmaceutical industry, supporting tasks like:\n", + "\n", + "- **Pharmaceutical Sorting**: Automating the sorting of pills based on size, shape, or color to enhance production efficiency.\n", + "- **AI Research and Development**: Serving as a benchmark for developing and testing computer vision algorithms in pharmaceutical use cases.\n", + "- **Digital Inventory Systems**: Powering smart inventory solutions by integrating automated pill recognition for real-time stock monitoring and replenishment planning." + ], + "metadata": { + "id": "R4SICbq5Yalg" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG", "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" + "base_uri": "https://localhost:8080/" }, - "accelerator": "GPU" + "outputId": "dc288ecf-d09d-4a22-8b37-7169b5a56e37" + }, + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 32.7/112.6 GB disk)\n" + ] + } + ] }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - " \n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Medical pills detection using Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Medical Pills Detection using Ultralytics YOLO11\n", - "\n", - "This notebook serves as a starting point for training the YOLO11 model on [medical pills](https://docs.ultralytics.com/datasets/detect/medical-pills/) object detection dataset." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } + { + "cell_type": "markdown", + "source": [ + "## Dataset YAML File\n", + "\n", + "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" + ], + "metadata": { + "id": "xE6ntKojSfSD" + } + }, + { + "cell_type": "markdown", + "source": [ + "```yaml\n", + "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", + "# Medical-pills dataset by Ultralytics\n", + "# Documentation: https://docs.ultralytics.com/datasets/detect/medical-pills/\n", + "# Example usage: yolo train data=medical-pills.yaml\n", + "# parent\n", + "# ├── ultralytics\n", + "# └── datasets\n", + "# └── medical-pills ← downloads here (8.19 MB)\n", + "\n", + "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", + "path: medical-pills # dataset root dir\n", + "train: images/train # train images (relative to 'path') 92 images\n", + "val: images/val # val images (relative to 'path') 23 images\n", + "\n", + "# Classes\n", + "names:\n", + " 0: pill\n", + "\n", + "# Download script/URL (optional)\n", + "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/medical-pills.zip\n", + "```" + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Train\n", + "\n", + "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." + ], + "metadata": { + "id": "fMV-sNfiSt_X" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "model = YOLO(\"yolo11n.pt\") # load a pretrained model (recommended for training)\n", + "\n", + "# Train the model\n", + "results = model.train(data=\"medical-pills.yaml\", epochs=20, imgsz=640)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "QUgMYUvlNLvy", + "outputId": "a7b9be48-6502-42fe-f75d-3d8121756ef4" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "## Dataset Structure\n", - "\n", - "The medical-pills dataset is divided into two subsets:\n", - "\n", - "- **Training set**: Consisting of 92 images, each annotated with the class `pill`.\n", - "- **Validation set**: Comprising 23 images with corresponding annotations." - ], - "metadata": { - "id": "xypoYW_oYZAf" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Applications\n", - "\n", - "Using computer vision for medical-pills detection enables automation in the pharmaceutical industry, supporting tasks like:\n", - "\n", - "- **Pharmaceutical Sorting**: Automating the sorting of pills based on size, shape, or color to enhance production efficiency.\n", - "- **AI Research and Development**: Serving as a benchmark for developing and testing computer vision algorithms in pharmaceutical use cases.\n", - "- **Digital Inventory Systems**: Powering smart inventory solutions by integrating automated pill recognition for real-time stock monitoring and replenishment planning." - ], - "metadata": { - "id": "R4SICbq5Yalg" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.35M/5.35M [00:00<00:00, 257MB/s]" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "dc288ecf-d09d-4a22-8b37-7169b5a56e37" - }, - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 32.7/112.6 GB disk)\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Dataset YAML File\n", - "\n", - "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" - ], - "metadata": { - "id": "xE6ntKojSfSD" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n" + ] }, { - "cell_type": "markdown", - "source": [ - "```yaml\n", - "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", - "# Medical-pills dataset by Ultralytics\n", - "# Documentation: https://docs.ultralytics.com/datasets/detect/medical-pills/\n", - "# Example usage: yolo train data=medical-pills.yaml\n", - "# parent\n", - "# ├── ultralytics\n", - "# └── datasets\n", - "# └── medical-pills ← downloads here (8.19 MB)\n", - "\n", - "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", - "path: medical-pills # dataset root dir\n", - "train: images/train # train images (relative to 'path') 92 images\n", - "val: images/val # val images (relative to 'path') 23 images\n", - "\n", - "# Classes\n", - "names:\n", - " 0: pill\n", - "\n", - "# Download script/URL (optional)\n", - "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/medical-pills.zip\n", - "```" - ], - "metadata": { - "id": "h8go3HNgN0WU" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Train\n", - "\n", - "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." - ], - "metadata": { - "id": "fMV-sNfiSt_X" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mengine/trainer: \u001B[0mtask=detect, mode=train, model=yolo11n.pt, data=medical-pills.yaml, epochs=20, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train\n", + "\n", + "Dataset 'medical-pills.yaml' images not found ⚠️, missing path '/content/datasets/medical-pills/valid/images'\n", + "Downloading https://ultralytics.com/assets/medical-pills.zip to '/content/datasets/medical-pills.zip'...\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "model = YOLO(\"yolo11n.pt\") # load a pretrained model (recommended for training)\n", - "\n", - "# Train the model\n", - "results = model.train(data=\"medical-pills.yaml\", epochs=20, imgsz=640)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "QUgMYUvlNLvy", - "outputId": "a7b9be48-6502-42fe-f75d-3d8121756ef4" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.35M/5.35M [00:00<00:00, 257MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mengine/trainer: \u001b[0mtask=detect, mode=train, model=yolo11n.pt, data=medical-pills.yaml, epochs=20, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train\n", - "\n", - "Dataset 'medical-pills.yaml' images not found ⚠️, missing path '/content/datasets/medical-pills/valid/images'\n", - "Downloading https://ultralytics.com/assets/medical-pills.zip to '/content/datasets/medical-pills.zip'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 8.20M/8.20M [00:00<00:00, 336MB/s]\n", - "Unzipping /content/datasets/medical-pills.zip to /content/datasets/medical-pills...: 100%|██████████| 238/238 [00:00<00:00, 2478.16file/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Dataset download success ✅ (1.7s), saved to \u001b[1m/content/datasets\u001b[0m\n", - "\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 755k/755k [00:00<00:00, 127MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Overriding model.yaml nc=80 with nc=1\n", - "\n", - " from n params module arguments \n", - " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", - " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", - " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", - " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", - " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", - " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", - " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", - " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", - " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", - " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", - " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", - " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", - " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", - " 23 [16, 19, 22] 1 430867 ultralytics.nn.modules.head.Detect [1, [64, 128, 256]] \n", - "YOLO11n summary: 319 layers, 2,590,035 parameters, 2,590,019 gradients, 6.4 GFLOPs\n", - "\n", - "Transferred 448/499 items from pretrained weights\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/\n", - "Freezing layer 'model.23.dfl.conv.weight'\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks...\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mScanning /content/datasets/medical-pills/train/labels... 92 images, 0 backgrounds, 0 corrupt: 100%|██████████| 92/92 [00:00<00:00, 1785.46it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /content/datasets/medical-pills/train/labels.cache\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "/usr/local/lib/python3.10/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 1.4.24 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", - " check_for_updates()\n", - "\u001b[34m\u001b[1mval: \u001b[0mScanning /content/datasets/medical-pills/valid/labels... 23 images, 0 backgrounds, 0 corrupt: 100%|██████████| 23/23 [00:00<00:00, 1156.66it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /content/datasets/medical-pills/valid/labels.cache\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Plotting labels to runs/detect/train/labels.jpg... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.002, momentum=0.9) with parameter groups 81 weight(decay=0.0), 88 weight(decay=0.0005), 87 bias(decay=0.0)\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mmodel graph visualization added ✅\n", - "Image sizes 640 train, 640 val\n", - "Using 2 dataloader workers\n", - "Logging results to \u001b[1mruns/detect/train\u001b[0m\n", - "Starting training for 20 epochs...\n", - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 1/20 2.77G 1.759 3.309 1.464 371 640: 100%|██████████| 6/6 [00:05<00:00, 1.14it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:01<00:00, 1.55s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0558 0.965 0.12 0.0712\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 2/20 2.82G 1.141 2.886 1.047 453 640: 100%|██████████| 6/6 [00:02<00:00, 2.43it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.40it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0574 0.992 0.795 0.486\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 3/20 2.69G 1.033 2.155 0.954 335 640: 100%|██████████| 6/6 [00:02<00:00, 2.22it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.83it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0575 0.995 0.887 0.609\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 4/20 2.75G 1.061 1.705 0.9449 477 640: 100%|██████████| 6/6 [00:01<00:00, 4.08it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.75it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0575 0.995 0.911 0.559\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 5/20 2.82G 1.039 1.338 0.945 428 640: 100%|██████████| 6/6 [00:01<00:00, 4.19it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 5.88it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0575 0.995 0.929 0.632\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 6/20 2.65G 0.9859 1.058 0.9356 466 640: 100%|██████████| 6/6 [00:01<00:00, 4.23it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.35it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0575 0.995 0.883 0.606\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 7/20 2.81G 0.962 0.8795 0.9395 384 640: 100%|██████████| 6/6 [00:01<00:00, 4.17it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.62it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.0575 0.995 0.943 0.703\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 8/20 2.77G 0.9213 0.7454 0.9418 414 640: 100%|██████████| 6/6 [00:02<00:00, 2.72it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.18it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.139 0.992 0.961 0.725\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 9/20 2.62G 0.9046 0.6753 0.9343 365 640: 100%|██████████| 6/6 [00:02<00:00, 2.69it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.62it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.996 0.604 0.965 0.704\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 10/20 2.89G 0.9068 0.6428 0.9391 325 640: 100%|██████████| 6/6 [00:01<00:00, 3.69it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 5.51it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.997 0.803 0.973 0.745\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Closing dataloader mosaic\n", - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 11/20 2.45G 0.8971 0.8787 0.9422 196 640: 100%|██████████| 6/6 [00:03<00:00, 1.92it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.30it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.997 0.888 0.981 0.713\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 12/20 2.41G 0.8724 0.7624 0.937 205 640: 100%|██████████| 6/6 [00:01<00:00, 3.42it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.77it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.997 0.908 0.983 0.752\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 13/20 2.41G 0.8797 0.6979 0.9378 202 640: 100%|██████████| 6/6 [00:02<00:00, 2.53it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:01<00:00, 1.14s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.997 0.936 0.984 0.709\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 14/20 2.4G 0.8994 0.6868 0.9344 201 640: 100%|██████████| 6/6 [00:01<00:00, 4.58it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.11it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.995 0.93 0.98 0.756\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 15/20 2.4G 0.8621 0.6637 0.9275 199 640: 100%|██████████| 6/6 [00:01<00:00, 4.09it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.02it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.991 0.95 0.983 0.763\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 16/20 2.42G 0.8534 0.6443 0.9108 200 640: 100%|██████████| 6/6 [00:01<00:00, 4.40it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.32it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.982 0.981 0.992 0.76\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 17/20 2.4G 0.8403 0.6194 0.9058 196 640: 100%|██████████| 6/6 [00:01<00:00, 4.61it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.00it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.985 0.985 0.992 0.77\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 18/20 2.42G 0.8197 0.6072 0.9119 200 640: 100%|██████████| 6/6 [00:01<00:00, 3.02it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.33it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.988 0.987 0.992 0.781\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 19/20 2.41G 0.8049 0.5833 0.9046 214 640: 100%|██████████| 6/6 [00:02<00:00, 2.75it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.39it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.989 0.987 0.992 0.784\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 20/20 2.42G 0.811 0.5805 0.9015 202 640: 100%|██████████| 6/6 [00:01<00:00, 4.41it/s]\n", - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.32it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.987 0.986 0.992 0.788\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "20 epochs completed in 0.021 hours.\n", - "Optimizer stripped from runs/detect/train/weights/last.pt, 5.4MB\n", - "Optimizer stripped from runs/detect/train/weights/best.pt, 5.4MB\n", - "\n", - "Validating runs/detect/train/weights/best.pt...\n", - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.84it/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 23 399 0.987 0.986 0.992 0.788\n", - "Speed: 0.3ms preprocess, 1.2ms inference, 0.0ms loss, 2.1ms postprocess per image\n", - "Results saved to \u001b[1mruns/detect/train\u001b[0m\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "![Medical-pills dataset sample image](https://github.com/ultralytics/docs/releases/download/0/medical-pills-dataset-sample-image.avif)" - ], - "metadata": { - "id": "_Hapx6WkS--T" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 8.20M/8.20M [00:00<00:00, 336MB/s]\n", + "Unzipping /content/datasets/medical-pills.zip to /content/datasets/medical-pills...: 100%|██████████| 238/238 [00:00<00:00, 2478.16file/s]" + ] }, { - "cell_type": "markdown", - "source": [ - "## Predict\n", - "\n", - "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." - ], - "metadata": { - "id": "mKAUvDAbTEjQ" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset download success ✅ (1.7s), saved to \u001B[1m/content/datasets\u001B[0m\n", + "\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Inference using the model\n", - "prediction_results = modelp.predict(\"https://ultralytics.com/assets/medical-pills-sample.jpg\", save=True)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "nzTbeqK_TB6t", - "outputId": "5c6adf6a-d4ef-4542-96b5-65626f0b1b47" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Found https://ultralytics.com/assets/medical-pills-sample.jpg locally at medical-pills-sample.jpg\n", - "image 1/1 /content/medical-pills-sample.jpg: 384x640 18 pills, 14.4ms\n", - "Speed: 3.1ms preprocess, 14.4ms inference, 1.8ms postprocess per image at shape (1, 3, 384, 640)\n", - "Results saved to \u001b[1mruns/detect/predict\u001b[0m\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "        \n", - "" - ], - "metadata": { - "id": "lmNKY3rWWsvj" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Export\n", - "\n", - "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", - "\n", - "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", - "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", - "\n", - "| Format | `format` Argument | Model | Metadata | Arguments |\n", - "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", - "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", - "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", - "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", - "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", - "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", - "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", - "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", - "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", - "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", - "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", - "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", - "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", - "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", - "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" - ], - "metadata": { - "id": "vWBYYdXhTkN7" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Export the model\n", - "modele.export(format=\"onnx\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 291 - }, - "id": "S4nWG40CTlOD", - "outputId": "8460e55c-f64b-4a02-cc21-4d5467ce3927" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", - "YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs\n", - "\n", - "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from '/content/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 5, 8400) (5.2 MB)\n", - "\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.17.0 opset 19...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m slimming with onnxslim 0.1.45...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m export success ✅ 1.9s, saved as '/content/best.onnx' (10.1 MB)\n", - "\n", - "Export complete (2.7s)\n", - "Results saved to \u001b[1m/content\u001b[0m\n", - "Predict: yolo predict task=detect model=/content/best.onnx imgsz=640 \n", - "Validate: yolo val task=detect model=/content/best.onnx imgsz=640 data=/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/datasets/medical-pills.yaml \n", - "Visualize: https://netron.app\n" - ] - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "'/content/best.onnx'" - ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - } - }, - "metadata": {}, - "execution_count": 9 - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Citation\n", - "\n", - "```bibtex\n", - "@dataset{Jocher_Ultralytics_Datasets_2024,\n", - " author = {Jocher, Glenn and Rizwan, Muhammad},\n", - " license = {AGPL-3.0},\n", - " month = {Dec},\n", - " title = {Ultralytics Datasets:Medical-pills Detection Dataset},\n", - " url = {https://docs.ultralytics.com/datasets/detect/medical-pills/},\n", - " version = {1.0.0},\n", - " year = {2024}\n", - "}\n" + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 755k/755k [00:00<00:00, 127MB/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Overriding model.yaml nc=80 with nc=1\n", + "\n", + " from n params module arguments \n", + " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", + " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", + " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", + " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", + " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", + " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", + " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", + " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", + " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", + " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", + " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", + " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", + " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", + " 23 [16, 19, 22] 1 430867 ultralytics.nn.modules.head.Detect [1, [64, 128, 256]] \n", + "YOLO11n summary: 319 layers, 2,590,035 parameters, 2,590,019 gradients, 6.4 GFLOPs\n", + "\n", + "Transferred 448/499 items from pretrained weights\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mStart with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/\n", + "Freezing layer 'model.23.dfl.conv.weight'\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mrunning Automatic Mixed Precision (AMP) checks...\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mchecks passed ✅\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mScanning /content/datasets/medical-pills/train/labels... 92 images, 0 backgrounds, 0 corrupt: 100%|██████████| 92/92 [00:00<00:00, 1785.46it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mNew cache created: /content/datasets/medical-pills/train/labels.cache\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.10/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 1.4.24 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", + " check_for_updates()\n", + "\u001B[34m\u001B[1mval: \u001B[0mScanning /content/datasets/medical-pills/valid/labels... 23 images, 0 backgrounds, 0 corrupt: 100%|██████████| 23/23 [00:00<00:00, 1156.66it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mNew cache created: /content/datasets/medical-pills/valid/labels.cache\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Plotting labels to runs/detect/train/labels.jpg... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m AdamW(lr=0.002, momentum=0.9) with parameter groups 81 weight(decay=0.0), 88 weight(decay=0.0005), 87 bias(decay=0.0)\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mmodel graph visualization added ✅\n", + "Image sizes 640 train, 640 val\n", + "Using 2 dataloader workers\n", + "Logging results to \u001B[1mruns/detect/train\u001B[0m\n", + "Starting training for 20 epochs...\n", + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 1/20 2.77G 1.759 3.309 1.464 371 640: 100%|██████████| 6/6 [00:05<00:00, 1.14it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:01<00:00, 1.55s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0558 0.965 0.12 0.0712\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 2/20 2.82G 1.141 2.886 1.047 453 640: 100%|██████████| 6/6 [00:02<00:00, 2.43it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.40it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0574 0.992 0.795 0.486\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 3/20 2.69G 1.033 2.155 0.954 335 640: 100%|██████████| 6/6 [00:02<00:00, 2.22it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.83it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0575 0.995 0.887 0.609\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 4/20 2.75G 1.061 1.705 0.9449 477 640: 100%|██████████| 6/6 [00:01<00:00, 4.08it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.75it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0575 0.995 0.911 0.559\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 5/20 2.82G 1.039 1.338 0.945 428 640: 100%|██████████| 6/6 [00:01<00:00, 4.19it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 5.88it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0575 0.995 0.929 0.632\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 6/20 2.65G 0.9859 1.058 0.9356 466 640: 100%|██████████| 6/6 [00:01<00:00, 4.23it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.35it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0575 0.995 0.883 0.606\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 7/20 2.81G 0.962 0.8795 0.9395 384 640: 100%|██████████| 6/6 [00:01<00:00, 4.17it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.62it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.0575 0.995 0.943 0.703\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 8/20 2.77G 0.9213 0.7454 0.9418 414 640: 100%|██████████| 6/6 [00:02<00:00, 2.72it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.18it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.139 0.992 0.961 0.725\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 9/20 2.62G 0.9046 0.6753 0.9343 365 640: 100%|██████████| 6/6 [00:02<00:00, 2.69it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.62it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.996 0.604 0.965 0.704\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 10/20 2.89G 0.9068 0.6428 0.9391 325 640: 100%|██████████| 6/6 [00:01<00:00, 3.69it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 5.51it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.997 0.803 0.973 0.745\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Closing dataloader mosaic\n", + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 11/20 2.45G 0.8971 0.8787 0.9422 196 640: 100%|██████████| 6/6 [00:03<00:00, 1.92it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.30it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.997 0.888 0.981 0.713\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 12/20 2.41G 0.8724 0.7624 0.937 205 640: 100%|██████████| 6/6 [00:01<00:00, 3.42it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.77it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.997 0.908 0.983 0.752\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 13/20 2.41G 0.8797 0.6979 0.9378 202 640: 100%|██████████| 6/6 [00:02<00:00, 2.53it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:01<00:00, 1.14s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.997 0.936 0.984 0.709\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 14/20 2.4G 0.8994 0.6868 0.9344 201 640: 100%|██████████| 6/6 [00:01<00:00, 4.58it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.11it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.995 0.93 0.98 0.756\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 15/20 2.4G 0.8621 0.6637 0.9275 199 640: 100%|██████████| 6/6 [00:01<00:00, 4.09it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.02it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.991 0.95 0.983 0.763\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 16/20 2.42G 0.8534 0.6443 0.9108 200 640: 100%|██████████| 6/6 [00:01<00:00, 4.40it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.32it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.982 0.981 0.992 0.76\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 17/20 2.4G 0.8403 0.6194 0.9058 196 640: 100%|██████████| 6/6 [00:01<00:00, 4.61it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.00it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.985 0.985 0.992 0.77\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 18/20 2.42G 0.8197 0.6072 0.9119 200 640: 100%|██████████| 6/6 [00:01<00:00, 3.02it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 2.33it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.988 0.987 0.992 0.781\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 19/20 2.41G 0.8049 0.5833 0.9046 214 640: 100%|██████████| 6/6 [00:02<00:00, 2.75it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.39it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.989 0.987 0.992 0.784\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 20/20 2.42G 0.811 0.5805 0.9015 202 640: 100%|██████████| 6/6 [00:01<00:00, 4.41it/s]\n", + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 4.32it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.987 0.986 0.992 0.788\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "20 epochs completed in 0.021 hours.\n", + "Optimizer stripped from runs/detect/train/weights/last.pt, 5.4MB\n", + "Optimizer stripped from runs/detect/train/weights/best.pt, 5.4MB\n", + "\n", + "Validating runs/detect/train/weights/best.pt...\n", + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 3.84it/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 23 399 0.987 0.986 0.992 0.788\n", + "Speed: 0.3ms preprocess, 1.2ms inference, 0.0ms loss, 2.1ms postprocess per image\n", + "Results saved to \u001B[1mruns/detect/train\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Medical-pills dataset sample image](https://github.com/ultralytics/docs/releases/download/0/medical-pills-dataset-sample-image.avif)" + ], + "metadata": { + "id": "_Hapx6WkS--T" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Predict\n", + "\n", + "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." + ], + "metadata": { + "id": "mKAUvDAbTEjQ" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Inference using the model\n", + "prediction_results = modelp.predict(\"https://ultralytics.com/assets/medical-pills-sample.jpg\", save=True)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "nzTbeqK_TB6t", + "outputId": "5c6adf6a-d4ef-4542-96b5-65626f0b1b47" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Found https://ultralytics.com/assets/medical-pills-sample.jpg locally at medical-pills-sample.jpg\n", + "image 1/1 /content/medical-pills-sample.jpg: 384x640 18 pills, 14.4ms\n", + "Speed: 3.1ms preprocess, 14.4ms inference, 1.8ms postprocess per image at shape (1, 3, 384, 640)\n", + "Results saved to \u001B[1mruns/detect/predict\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "        \n", + "" + ], + "metadata": { + "id": "lmNKY3rWWsvj" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Export\n", + "\n", + "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", + "\n", + "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", + "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", + "\n", + "| Format | `format` Argument | Model | Metadata | Arguments |\n", + "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", + "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", + "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", + "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", + "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", + "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", + "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", + "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", + "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", + "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", + "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", + "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", + "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", + "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", + "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" + ], + "metadata": { + "id": "vWBYYdXhTkN7" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Export the model\n", + "modele.export(format=\"onnx\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 291 + }, + "id": "S4nWG40CTlOD", + "outputId": "8460e55c-f64b-4a02-cc21-4d5467ce3927" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.57 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", + "YOLO11n summary (fused): 238 layers, 2,582,347 parameters, 0 gradients, 6.3 GFLOPs\n", + "\n", + "\u001B[34m\u001B[1mPyTorch:\u001B[0m starting from '/content/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 5, 8400) (5.2 MB)\n", + "\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m starting export with onnx 1.17.0 opset 19...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m slimming with onnxslim 0.1.45...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m export success ✅ 1.9s, saved as '/content/best.onnx' (10.1 MB)\n", + "\n", + "Export complete (2.7s)\n", + "Results saved to \u001B[1m/content\u001B[0m\n", + "Predict: yolo predict task=detect model=/content/best.onnx imgsz=640 \n", + "Validate: yolo val task=detect model=/content/best.onnx imgsz=640 data=/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/datasets/medical-pills.yaml \n", + "Visualize: https://netron.app\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/best.onnx'" ], - "metadata": { - "id": "vlHp09Nueb3d" + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" } + }, + "metadata": {}, + "execution_count": 9 } - ] + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Citation\n", + "\n", + "```bibtex\n", + "@dataset{Jocher_Ultralytics_Datasets_2024,\n", + " author = {Jocher, Glenn and Rizwan, Muhammad},\n", + " license = {AGPL-3.0},\n", + " month = {Dec},\n", + " title = {Ultralytics Datasets:Medical-pills Detection Dataset},\n", + " url = {https://docs.ultralytics.com/datasets/detect/medical-pills/},\n", + " version = {1.0.0},\n", + " year = {2024}\n", + "}\n" + ], + "metadata": { + "id": "vlHp09Nueb3d" + } + } + ] } diff --git a/notebooks/how-to-train-ultralytics-yolo-on-package-segmentation-dataset.ipynb b/notebooks/how-to-train-ultralytics-yolo-on-package-segmentation-dataset.ipynb index e43d5a2..0228d71 100644 --- a/notebooks/how-to-train-ultralytics-yolo-on-package-segmentation-dataset.ipynb +++ b/notebooks/how-to-train-ultralytics-yolo-on-package-segmentation-dataset.ipynb @@ -1,862 +1,862 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "gpuType": "T4" + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + "\n", + "\n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Package segmentation with Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Package Segmentation using Ultralytics YOLO11\n", + "\n", + "This notebook serves as an entry point for training the YOLO11 model on the [package segmentation dataset](https://docs.ultralytics.com/datasets/segment/package-seg/)." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset Structure\n", + "\n", + "The distribution of data in the Package Segmentation Dataset is structured as follows:\n", + "\n", + "- **Training set**: Encompasses 1920 images accompanied by their corresponding annotations.\n", + "- **Testing set**: Consists of 89 images, each paired with its respective annotations.\n", + "- **Validation set**: Comprises 188 images, each with corresponding annotations." + ], + "metadata": { + "id": "xypoYW_oYZAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Applications\n", + "\n", + "Package segmentation is crucial for optimizing logistics, enhancing last-mile delivery, improving manufacturing quality control, and contributing to smart city solutions. From e-commerce to security applications, this dataset is a key resource, fostering innovation in computer vision for diverse and efficient package analysis applications." + ], + "metadata": { + "id": "R4SICbq5Yalg" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG" + }, + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Dataset YAML File\n", + "\n", + "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" + ], + "metadata": { + "id": "xE6ntKojSfSD" + } + }, + { + "cell_type": "markdown", + "source": [ + "```yaml\n", + "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", + "# Package-seg dataset by Ultralytics\n", + "# Documentation: https://docs.ultralytics.com/datasets/segment/package-seg/\n", + "# Example usage: yolo train data=package-seg.yaml\n", + "# parent\n", + "# ├── ultralytics\n", + "# └── datasets\n", + "# └── package-seg ← downloads here (103 MB)\n", + "\n", + "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", + "path: package-seg # dataset root dir\n", + "train: images/train # train images (relative to 'path') 1920 images\n", + "val: images/val # val images (relative to 'path') 89 images\n", + "test: images/test # test images (relative to 'path') 188 images\n", + "\n", + "# Classes\n", + "names:\n", + " 0: package\n", + "\n", + "# Download script/URL (optional)\n", + "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/package-seg.zip\n", + "```" + ], + "metadata": { + "id": "h8go3HNgN0WU" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Train\n", + "\n", + "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." + ], + "metadata": { + "id": "fMV-sNfiSt_X" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "model = YOLO(\"yolo11n-seg.pt\") # load a pretrained model (recommended for training)\n", + "\n", + "# Train the model\n", + "results = model.train(data=\"package-seg.yaml\", epochs=10, imgsz=640, batch=64, workers=64)" + ], + "metadata": { "colab": { - "provenance": [], - "gpuType": "T4" + "base_uri": "https://localhost:8080/" }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" + "id": "QUgMYUvlNLvy", + "outputId": "b9532dcb-b63e-4d6e-fb80-20f853256433" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Creating new Ultralytics Settings v0.0.6 file ✅ \n", + "View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'\n", + "Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.\n", + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n-seg.pt to 'yolo11n-seg.pt'...\n" + ] }, - "accelerator": "GPU" - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - "\n", - "\n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Package segmentation with Ultralytics YOLO11 🚀 notebook! YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Package Segmentation using Ultralytics YOLO11\n", - "\n", - "This notebook serves as an entry point for training the YOLO11 model on the [package segmentation dataset](https://docs.ultralytics.com/datasets/segment/package-seg/)." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.90M/5.90M [00:00<00:00, 90.2MB/s]\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Dataset Structure\n", - "\n", - "The distribution of data in the Package Segmentation Dataset is structured as follows:\n", - "\n", - "- **Training set**: Encompasses 1920 images accompanied by their corresponding annotations.\n", - "- **Testing set**: Consists of 89 images, each paired with its respective annotations.\n", - "- **Validation set**: Comprises 188 images, each with corresponding annotations." - ], - "metadata": { - "id": "xypoYW_oYZAf" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "\u001B[34m\u001B[1mengine/trainer: \u001B[0mtask=segment, mode=train, model=yolo11n-seg.pt, data=package-seg.yaml, epochs=10, time=None, patience=100, batch=64, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=64, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=/content/ultralytics/runs/segment/train\n", + "\n", + "Dataset 'package-seg.yaml' images not found ⚠️, missing path '/content/datasets/package-seg/valid/images'\n", + "Downloading https://ultralytics.com/assets/package-seg.zip to '/content/datasets/package-seg.zip'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Applications\n", - "\n", - "Package segmentation is crucial for optimizing logistics, enhancing last-mile delivery, improving manufacturing quality control, and contributing to smart city solutions. From e-commerce to security applications, this dataset is a key resource, fostering innovation in computer vision for diverse and efficient package analysis applications." - ], - "metadata": { - "id": "R4SICbq5Yalg" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 103M/103M [00:00<00:00, 340MB/s] \n", + "Unzipping /content/datasets/package-seg.zip to /content/datasets/package-seg...: 100%|██████████| 4397/4397 [00:01<00:00, 3527.17file/s]" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG" - }, - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [] + "output_type": "stream", + "name": "stdout", + "text": [ + "Dataset download success ✅ (2.3s), saved to \u001B[1m/content/datasets\u001B[0m\n", + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Dataset YAML File\n", - "\n", - "A YAML (Yet Another Markup Language) file defines the dataset configuration, including paths, classes, and other pertinent details. 😀" - ], - "metadata": { - "id": "xE6ntKojSfSD" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] }, { - "cell_type": "markdown", - "source": [ - "```yaml\n", - "# Ultralytics YOLO 🚀, AGPL-3.0 license\n", - "# Package-seg dataset by Ultralytics\n", - "# Documentation: https://docs.ultralytics.com/datasets/segment/package-seg/\n", - "# Example usage: yolo train data=package-seg.yaml\n", - "# parent\n", - "# ├── ultralytics\n", - "# └── datasets\n", - "# └── package-seg ← downloads here (103 MB)\n", - "\n", - "# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]\n", - "path: package-seg # dataset root dir\n", - "train: images/train # train images (relative to 'path') 1920 images\n", - "val: images/val # val images (relative to 'path') 89 images\n", - "test: images/test # test images (relative to 'path') 188 images\n", - "\n", - "# Classes\n", - "names:\n", - " 0: package\n", - "\n", - "# Download script/URL (optional)\n", - "download: https://github.com/ultralytics/assets/releases/download/v0.0.0/package-seg.zip\n", - "```" - ], - "metadata": { - "id": "h8go3HNgN0WU" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Train\n", - "\n", - "Train YOLO11 on [Detect](https://docs.ultralytics.com/tasks/detect/), [Segment](https://docs.ultralytics.com/tasks/segment/), [Classify](https://docs.ultralytics.com/tasks/classify/) and [Pose](https://docs.ultralytics.com/tasks/pose/) datasets. See [YOLO11 Train Docs](https://docs.ultralytics.com/modes/train/) for more information." - ], - "metadata": { - "id": "fMV-sNfiSt_X" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 755k/755k [00:00<00:00, 18.8MB/s]\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "model = YOLO(\"yolo11n-seg.pt\") # load a pretrained model (recommended for training)\n", - "\n", - "# Train the model\n", - "results = model.train(data=\"package-seg.yaml\", epochs=10, imgsz=640, batch=64, workers=64)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "QUgMYUvlNLvy", - "outputId": "b9532dcb-b63e-4d6e-fb80-20f853256433" - }, - "execution_count": 2, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Creating new Ultralytics Settings v0.0.6 file ✅ \n", - "View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'\n", - "Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.\n", - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n-seg.pt to 'yolo11n-seg.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.90M/5.90M [00:00<00:00, 90.2MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "\u001b[34m\u001b[1mengine/trainer: \u001b[0mtask=segment, mode=train, model=yolo11n-seg.pt, data=package-seg.yaml, epochs=10, time=None, patience=100, batch=64, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=64, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=None, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=/content/ultralytics/runs/segment/train\n", - "\n", - "Dataset 'package-seg.yaml' images not found ⚠️, missing path '/content/datasets/package-seg/valid/images'\n", - "Downloading https://ultralytics.com/assets/package-seg.zip to '/content/datasets/package-seg.zip'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 103M/103M [00:00<00:00, 340MB/s] \n", - "Unzipping /content/datasets/package-seg.zip to /content/datasets/package-seg...: 100%|██████████| 4397/4397 [00:01<00:00, 3527.17file/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Dataset download success ✅ (2.3s), saved to \u001b[1m/content/datasets\u001b[0m\n", - "\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 755k/755k [00:00<00:00, 18.8MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Overriding model.yaml nc=80 with nc=1\n", - "\n", - " from n params module arguments \n", - " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", - " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", - " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", - " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", - " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", - " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", - " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", - " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", - " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", - " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", - " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", - " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", - " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", - " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", - " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", - " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", - " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", - " 23 [16, 19, 22] 1 683635 ultralytics.nn.modules.head.Segment [1, 32, 64, [64, 128, 256]] \n", - "YOLO11n-seg summary: 355 layers, 2,842,803 parameters, 2,842,787 gradients, 10.4 GFLOPs\n", - "\n", - "Transferred 510/561 items from pretrained weights\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir /content/ultralytics/runs/segment/train', view at http://localhost:6006/\n", - "Freezing layer 'model.23.dfl.conv.weight'\n", - "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks...\n", - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 5.35M/5.35M [00:00<00:00, 79.2MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mScanning /content/datasets/package-seg/train/labels... 1920 images, 117 backgrounds, 0 corrupt: 100%|██████████| 1920/1920 [00:01<00:00, 1720.09it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mWARNING ⚠️ /content/datasets/package-seg/train/images/frame_11663_jpg.rf.07ae1f188368237d20d5a145a0ff2501.jpg: 1 duplicate labels removed\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /content/datasets/package-seg/train/labels.cache\n", - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "/usr/local/lib/python3.10/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 2.0.0 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", - " check_for_updates()\n", - "\u001b[34m\u001b[1mval: \u001b[0mScanning /content/datasets/package-seg/valid/labels... 188 images, 12 backgrounds, 0 corrupt: 100%|██████████| 188/188 [00:00<00:00, 899.83it/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /content/datasets/package-seg/valid/labels.cache\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Plotting labels to /content/ultralytics/runs/segment/train/labels.jpg... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", - "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.002, momentum=0.9) with parameter groups 90 weight(decay=0.0), 101 weight(decay=0.0005), 100 bias(decay=0.0)\n", - "\u001b[34m\u001b[1mTensorBoard: \u001b[0mmodel graph visualization added ✅\n", - "Image sizes 640 train, 640 val\n", - "Using 2 dataloader workers\n", - "Logging results to \u001b[1m/content/ultralytics/runs/segment/train\u001b[0m\n", - "Starting training for 10 epochs...\n", - "Closing dataloader mosaic\n", - "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 1/10 11.7G 1.472 2.976 2.463 1.335 212 640: 100%|██████████| 30/30 [00:47<00:00, 1.59s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.92s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.0121 0.983 0.602 0.443 0.012 0.973 0.609 0.465\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 2/10 11.6G 1.426 2.568 1.487 1.241 230 640: 100%|██████████| 30/30 [00:41<00:00, 1.38s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.45s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.749 0.431 0.574 0.419 0.702 0.404 0.505 0.291\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 3/10 11.6G 1.386 2.517 1.304 1.238 210 640: 100%|██████████| 30/30 [00:38<00:00, 1.28s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.25s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.607 0.701 0.656 0.43 0.498 0.569 0.47 0.228\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 4/10 11.7G 1.4 2.529 1.209 1.242 198 640: 100%|██████████| 30/30 [00:39<00:00, 1.30s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.86s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.663 0.737 0.712 0.507 0.66 0.734 0.696 0.471\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 5/10 11.6G 1.34 2.427 1.088 1.21 229 640: 100%|██████████| 30/30 [00:38<00:00, 1.29s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:06<00:00, 3.03s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.667 0.74 0.78 0.617 0.66 0.742 0.77 0.556\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 6/10 11.6G 1.265 2.298 0.9679 1.177 185 640: 100%|██████████| 30/30 [00:38<00:00, 1.29s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.87s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.788 0.804 0.863 0.664 0.789 0.806 0.851 0.633\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 7/10 11.6G 1.201 2.182 0.8788 1.144 212 640: 100%|██████████| 30/30 [00:38<00:00, 1.29s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:05<00:00, 2.62s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.845 0.864 0.896 0.743 0.844 0.861 0.89 0.731\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 8/10 11.6G 1.134 2.079 0.808 1.117 228 640: 100%|██████████| 30/30 [00:39<00:00, 1.32s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:05<00:00, 2.75s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.833 0.89 0.906 0.784 0.838 0.896 0.903 0.784\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 9/10 11.7G 1.052 1.929 0.7365 1.076 202 640: 100%|██████████| 30/30 [00:39<00:00, 1.30s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.80s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.842 0.938 0.928 0.81 0.844 0.929 0.93 0.81\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " 10/10 11.7G 1.008 1.845 0.6967 1.05 236 640: 100%|██████████| 30/30 [00:39<00:00, 1.30s/it]\n", - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:05<00:00, 2.80s/it]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.845 0.946 0.927 0.831 0.857 0.926 0.924 0.816\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "10 epochs completed in 0.129 hours.\n", - "Optimizer stripped from /content/ultralytics/runs/segment/train/weights/last.pt, 6.0MB\n", - "Optimizer stripped from /content/ultralytics/runs/segment/train/weights/best.pt, 6.0MB\n", - "\n", - "Validating /content/ultralytics/runs/segment/train/weights/best.pt...\n", - "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", - "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.66s/it]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - " all 188 693 0.845 0.946 0.927 0.832 0.857 0.926 0.925 0.816\n", - "Speed: 0.2ms preprocess, 3.1ms inference, 0.0ms loss, 1.3ms postprocess per image\n", - "Results saved to \u001b[1m/content/ultralytics/runs/segment/train\u001b[0m\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "![Dataset sample image](https://github.com/ultralytics/docs/releases/download/0/dataset-sample-image-1.avif)" - ], - "metadata": { - "id": "_Hapx6WkS--T" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Overriding model.yaml nc=80 with nc=1\n", + "\n", + " from n params module arguments \n", + " 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] \n", + " 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] \n", + " 2 -1 1 6640 ultralytics.nn.modules.block.C3k2 [32, 64, 1, False, 0.25] \n", + " 3 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 4 -1 1 26080 ultralytics.nn.modules.block.C3k2 [64, 128, 1, False, 0.25] \n", + " 5 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 6 -1 1 87040 ultralytics.nn.modules.block.C3k2 [128, 128, 1, True] \n", + " 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] \n", + " 8 -1 1 346112 ultralytics.nn.modules.block.C3k2 [256, 256, 1, True] \n", + " 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] \n", + " 10 -1 1 249728 ultralytics.nn.modules.block.C2PSA [256, 256, 1] \n", + " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 13 -1 1 111296 ultralytics.nn.modules.block.C3k2 [384, 128, 1, False] \n", + " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", + " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 16 -1 1 32096 ultralytics.nn.modules.block.C3k2 [256, 64, 1, False] \n", + " 17 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] \n", + " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 19 -1 1 86720 ultralytics.nn.modules.block.C3k2 [192, 128, 1, False] \n", + " 20 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] \n", + " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", + " 22 -1 1 378880 ultralytics.nn.modules.block.C3k2 [384, 256, 1, True] \n", + " 23 [16, 19, 22] 1 683635 ultralytics.nn.modules.head.Segment [1, 32, 64, [64, 128, 256]] \n", + "YOLO11n-seg summary: 355 layers, 2,842,803 parameters, 2,842,787 gradients, 10.4 GFLOPs\n", + "\n", + "Transferred 510/561 items from pretrained weights\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mStart with 'tensorboard --logdir /content/ultralytics/runs/segment/train', view at http://localhost:6006/\n", + "Freezing layer 'model.23.dfl.conv.weight'\n", + "\u001B[34m\u001B[1mAMP: \u001B[0mrunning Automatic Mixed Precision (AMP) checks...\n", + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Predict\n", - "\n", - "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." - ], - "metadata": { - "id": "mKAUvDAbTEjQ" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 5.35M/5.35M [00:00<00:00, 79.2MB/s]\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Inference using the model (img/video/stream)\n", - "prediction_results = modelp.predict(\"https://github.com/ultralytics/assets/releases/download/v0.0.0/industrial-package.jpg\", save=True)" - ], - "metadata": { - "id": "nzTbeqK_TB6t", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "8c0a5764-2679-4aef-fe70-7b046687ad3d" - }, - "execution_count": 3, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Downloading https://ultralytics.com/assets/industrial-package.jpg to 'industrial-package.jpg'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 46.5k/46.5k [00:00<00:00, 11.9MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "image 1/1 /content/ultralytics/industrial-package.jpg: 640x640 1 package, 19.3ms\n", - "Speed: 2.1ms preprocess, 19.3ms inference, 7.1ms postprocess per image at shape (1, 3, 640, 640)\n", - "Results saved to \u001b[1m/content/ultralytics/runs/segment/predict\u001b[0m\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "        \n", - "" - ], - "metadata": { - "id": "lmNKY3rWWsvj" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mAMP: \u001B[0mchecks passed ✅\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Export\n", - "\n", - "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", - "\n", - "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", - "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", - "\n", - "| Format | `format` Argument | Model | Metadata | Arguments |\n", - "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", - "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", - "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", - "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", - "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", - "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", - "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", - "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", - "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", - "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", - "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", - "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", - "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", - "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", - "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", - "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" - ], - "metadata": { - "id": "vWBYYdXhTkN7" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mScanning /content/datasets/package-seg/train/labels... 1920 images, 117 backgrounds, 0 corrupt: 100%|██████████| 1920/1920 [00:01<00:00, 1720.09it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mWARNING ⚠️ /content/datasets/package-seg/train/images/frame_11663_jpg.rf.07ae1f188368237d20d5a145a0ff2501.jpg: 1 duplicate labels removed\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mtrain: \u001B[0mNew cache created: /content/datasets/package-seg/train/labels.cache\n", + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "/usr/local/lib/python3.10/dist-packages/albumentations/__init__.py:24: UserWarning: A new version of Albumentations is available: 2.0.0 (you have 1.4.20). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.\n", + " check_for_updates()\n", + "\u001B[34m\u001B[1mval: \u001B[0mScanning /content/datasets/package-seg/valid/labels... 188 images, 12 backgrounds, 0 corrupt: 100%|██████████| 188/188 [00:00<00:00, 899.83it/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001B[34m\u001B[1mval: \u001B[0mNew cache created: /content/datasets/package-seg/valid/labels.cache\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Plotting labels to /content/ultralytics/runs/segment/train/labels.jpg... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", + "\u001B[34m\u001B[1moptimizer:\u001B[0m AdamW(lr=0.002, momentum=0.9) with parameter groups 90 weight(decay=0.0), 101 weight(decay=0.0005), 100 bias(decay=0.0)\n", + "\u001B[34m\u001B[1mTensorBoard: \u001B[0mmodel graph visualization added ✅\n", + "Image sizes 640 train, 640 val\n", + "Using 2 dataloader workers\n", + "Logging results to \u001B[1m/content/ultralytics/runs/segment/train\u001B[0m\n", + "Starting training for 10 epochs...\n", + "Closing dataloader mosaic\n", + "\u001B[34m\u001B[1malbumentations: \u001B[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, num_output_channels=3, method='weighted_average'), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 1/10 11.7G 1.472 2.976 2.463 1.335 212 640: 100%|██████████| 30/30 [00:47<00:00, 1.59s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.92s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.0121 0.983 0.602 0.443 0.012 0.973 0.609 0.465\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 2/10 11.6G 1.426 2.568 1.487 1.241 230 640: 100%|██████████| 30/30 [00:41<00:00, 1.38s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.45s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.749 0.431 0.574 0.419 0.702 0.404 0.505 0.291\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 3/10 11.6G 1.386 2.517 1.304 1.238 210 640: 100%|██████████| 30/30 [00:38<00:00, 1.28s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:04<00:00, 2.25s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.607 0.701 0.656 0.43 0.498 0.569 0.47 0.228\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 4/10 11.7G 1.4 2.529 1.209 1.242 198 640: 100%|██████████| 30/30 [00:39<00:00, 1.30s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.86s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.663 0.737 0.712 0.507 0.66 0.734 0.696 0.471\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 5/10 11.6G 1.34 2.427 1.088 1.21 229 640: 100%|██████████| 30/30 [00:38<00:00, 1.29s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:06<00:00, 3.03s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.667 0.74 0.78 0.617 0.66 0.742 0.77 0.556\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 6/10 11.6G 1.265 2.298 0.9679 1.177 185 640: 100%|██████████| 30/30 [00:38<00:00, 1.29s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.87s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.788 0.804 0.863 0.664 0.789 0.806 0.851 0.633\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 7/10 11.6G 1.201 2.182 0.8788 1.144 212 640: 100%|██████████| 30/30 [00:38<00:00, 1.29s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:05<00:00, 2.62s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.845 0.864 0.896 0.743 0.844 0.861 0.89 0.731\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 8/10 11.6G 1.134 2.079 0.808 1.117 228 640: 100%|██████████| 30/30 [00:39<00:00, 1.32s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:05<00:00, 2.75s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.833 0.89 0.906 0.784 0.838 0.896 0.903 0.784\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 9/10 11.7G 1.052 1.929 0.7365 1.076 202 640: 100%|██████████| 30/30 [00:39<00:00, 1.30s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.80s/it]" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import YOLO\n", - "\n", - "# Load a model\n", - "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", - "\n", - "# Export the model\n", - "modele.export(format=\"onnx\")" + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.842 0.938 0.928 0.81 0.844 0.929 0.93 0.81\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + " Epoch GPU_mem box_loss seg_loss cls_loss dfl_loss Instances Size\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " 10/10 11.7G 1.008 1.845 0.6967 1.05 236 640: 100%|██████████| 30/30 [00:39<00:00, 1.30s/it]\n", + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:05<00:00, 2.80s/it]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.845 0.946 0.927 0.831 0.857 0.926 0.924 0.816\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "10 epochs completed in 0.129 hours.\n", + "Optimizer stripped from /content/ultralytics/runs/segment/train/weights/last.pt, 6.0MB\n", + "Optimizer stripped from /content/ultralytics/runs/segment/train/weights/best.pt, 6.0MB\n", + "\n", + "Validating /content/ultralytics/runs/segment/train/weights/best.pt...\n", + "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CUDA:0 (Tesla T4, 15102MiB)\n", + "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + " Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95): 100%|██████████| 2/2 [00:03<00:00, 1.66s/it]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + " all 188 693 0.845 0.946 0.927 0.832 0.857 0.926 0.925 0.816\n", + "Speed: 0.2ms preprocess, 3.1ms inference, 0.0ms loss, 1.3ms postprocess per image\n", + "Results saved to \u001B[1m/content/ultralytics/runs/segment/train\u001B[0m\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Dataset sample image](https://github.com/ultralytics/docs/releases/download/0/dataset-sample-image-1.avif)" + ], + "metadata": { + "id": "_Hapx6WkS--T" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Predict\n", + "\n", + "YOLO11 may be used directly in the Command Line Interface (CLI) with a yolo command for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See a full list of available [yolo arguments](https://docs.ultralytics.com/usage/cfg/) and other details in the [YOLO11 Predict Docs](https://docs.ultralytics.com/modes/train/)." + ], + "metadata": { + "id": "mKAUvDAbTEjQ" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modelp = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Inference using the model (img/video/stream)\n", + "prediction_results = modelp.predict(\"https://github.com/ultralytics/assets/releases/download/v0.0.0/industrial-package.jpg\", save=True)" + ], + "metadata": { + "id": "nzTbeqK_TB6t", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "8c0a5764-2679-4aef-fe70-7b046687ad3d" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Downloading https://ultralytics.com/assets/industrial-package.jpg to 'industrial-package.jpg'...\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 46.5k/46.5k [00:00<00:00, 11.9MB/s]" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "image 1/1 /content/ultralytics/industrial-package.jpg: 640x640 1 package, 19.3ms\n", + "Speed: 2.1ms preprocess, 19.3ms inference, 7.1ms postprocess per image at shape (1, 3, 640, 640)\n", + "Results saved to \u001B[1m/content/ultralytics/runs/segment/predict\u001B[0m\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "        \n", + "" + ], + "metadata": { + "id": "lmNKY3rWWsvj" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Export\n", + "\n", + "Export a YOLO11 model to any supported format below with the `format` argument, i.e. `format=onnx`. See [YOLO11 Export Docs](https://docs.ultralytics.com/modes/export/) for more information.\n", + "\n", + "- 💡 ProTip: Export to [ONNX](https://docs.ultralytics.com/integrations/onnx/) or [OpenVINO](https://docs.ultralytics.com/integrations/openvino/) for up to 3x CPU speedup. \n", + "- 💡 ProTip: Export to [TensorRT](https://docs.ultralytics.com/integrations/tensorrt/) for up to 5x GPU speedup.\n", + "\n", + "| Format | `format` Argument | Model | Metadata | Arguments |\n", + "|--------------------------------------------------------------------------|-------------------|---------------------------|----------|----------------------------------------------------------------------|\n", + "| [PyTorch](https://pytorch.org/) | - | `yolo11n.pt` | ✅ | - |\n", + "| [TorchScript](https://docs.ultralytics.com/integrations/torchscript) | `torchscript` | `yolo11n.torchscript` | ✅ | `imgsz`, `optimize`, `batch` |\n", + "| [ONNX](https://docs.ultralytics.com/integrations/onnx) | `onnx` | `yolo11n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` |\n", + "| [OpenVINO](https://docs.ultralytics.com/integrations/openvino) | `openvino` | `yolo11n_openvino_model/` | ✅ | `imgsz`, `half`, `dynamic`, `int8`, `batch` |\n", + "| [TensorRT](https://docs.ultralytics.com/integrations/tensorrt) | `engine` | `yolo11n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` |\n", + "| [CoreML](https://docs.ultralytics.com/integrations/coreml) | `coreml` | `yolo11n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` |\n", + "| [TF SavedModel](https://docs.ultralytics.com/integrations/tf-savedmodel) | `saved_model` | `yolo11n_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` |\n", + "| [TF GraphDef](https://docs.ultralytics.com/integrations/tf-graphdef) | `pb` | `yolo11n.pb` | ❌ | `imgsz`, `batch` |\n", + "| [TF Lite](https://docs.ultralytics.com/integrations/tflite) | `tflite` | `yolo11n.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [TF Edge TPU](https://docs.ultralytics.com/integrations/edge-tpu) | `edgetpu` | `yolo11n_edgetpu.tflite` | ✅ | `imgsz` |\n", + "| [TF.js](https://docs.ultralytics.com/integrations/tfjs) | `tfjs` | `yolo11n_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` |\n", + "| [PaddlePaddle](https://docs.ultralytics.com/integrations/paddlepaddle) | `paddle` | `yolo11n_paddle_model/` | ✅ | `imgsz`, `batch` |\n", + "| [MNN](https://docs.ultralytics.com/integrations/mnn) | `mnn` | `yolo11n.mnn` | ✅ | `imgsz`, `batch`, `int8`, `half` |\n", + "| [NCNN](https://docs.ultralytics.com/integrations/ncnn) | `ncnn` | `yolo11n_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` |\n", + "| [IMX500](https://docs.ultralytics.com/integrations/sony-imx500) | `imx` | `yolov8n_imx_model/` | ✅ | `imgsz`, `int8` |\n", + "| [RKNN](https://docs.ultralytics.com/integrations/rockchip-rknn) | `rknn` | `yolo11n_rknn_model/` | ✅ | `imgsz`, `batch`, `name` |" + ], + "metadata": { + "id": "vWBYYdXhTkN7" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import YOLO\n", + "\n", + "# Load a model\n", + "modele = YOLO(f\"{model.trainer.save_dir}/weights/best.pt\") # load a fine-tuned model\n", + "\n", + "# Export the model\n", + "modele.export(format=\"onnx\")" + ], + "metadata": { + "id": "S4nWG40CTlOD", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 278 + }, + "outputId": "d9273b1e-77c1-4dcc-e6c0-7252fc097c88" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", + "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n", + "\n", + "\u001B[34m\u001B[1mPyTorch:\u001B[0m starting from '/content/ultralytics/runs/segment/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 37, 8400), (1, 32, 160, 160)) (5.7 MB)\n", + "\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m starting export with onnx 1.17.0 opset 19...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m slimming with onnxslim 0.1.47...\n", + "\u001B[34m\u001B[1mONNX:\u001B[0m export success ✅ 1.5s, saved as '/content/ultralytics/runs/segment/train/weights/best.onnx' (11.1 MB)\n", + "\n", + "Export complete (2.2s)\n", + "Results saved to \u001B[1m/content/ultralytics/runs/segment/train/weights\u001B[0m\n", + "Predict: yolo predict task=segment model=/content/ultralytics/runs/segment/train/weights/best.onnx imgsz=640 \n", + "Validate: yolo val task=segment model=/content/ultralytics/runs/segment/train/weights/best.onnx imgsz=640 data=/content/ultralytics/ultralytics/cfg/datasets/package-seg.yaml \n", + "Visualize: https://netron.app\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'/content/ultralytics/runs/segment/train/weights/best.onnx'" ], - "metadata": { - "id": "S4nWG40CTlOD", - "colab": { - "base_uri": "https://localhost:8080/", - "height": 278 - }, - "outputId": "d9273b1e-77c1-4dcc-e6c0-7252fc097c88" - }, - "execution_count": 5, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.58 🚀 Python-3.10.12 torch-2.5.1+cu121 CPU (Intel Xeon 2.20GHz)\n", - "YOLO11n-seg summary (fused): 265 layers, 2,834,763 parameters, 0 gradients, 10.2 GFLOPs\n", - "\n", - "\u001b[34m\u001b[1mPyTorch:\u001b[0m starting from '/content/ultralytics/runs/segment/train/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 37, 8400), (1, 32, 160, 160)) (5.7 MB)\n", - "\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.17.0 opset 19...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m slimming with onnxslim 0.1.47...\n", - "\u001b[34m\u001b[1mONNX:\u001b[0m export success ✅ 1.5s, saved as '/content/ultralytics/runs/segment/train/weights/best.onnx' (11.1 MB)\n", - "\n", - "Export complete (2.2s)\n", - "Results saved to \u001b[1m/content/ultralytics/runs/segment/train/weights\u001b[0m\n", - "Predict: yolo predict task=segment model=/content/ultralytics/runs/segment/train/weights/best.onnx imgsz=640 \n", - "Validate: yolo val task=segment model=/content/ultralytics/runs/segment/train/weights/best.onnx imgsz=640 data=/content/ultralytics/ultralytics/cfg/datasets/package-seg.yaml \n", - "Visualize: https://netron.app\n" - ] - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "'/content/ultralytics/runs/segment/train/weights/best.onnx'" - ], - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - } - }, - "metadata": {}, - "execution_count": 5 - } - ] + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 5 } - ] + ] + } + ] } diff --git a/notebooks/how-to-use-florence-2-for-object-detection-image-captioning-ocr-and-segmentation.ipynb b/notebooks/how-to-use-florence-2-for-object-detection-image-captioning-ocr-and-segmentation.ipynb index cf656ce..56ca368 100644 --- a/notebooks/how-to-use-florence-2-for-object-detection-image-captioning-ocr-and-segmentation.ipynb +++ b/notebooks/how-to-use-florence-2-for-object-detection-image-captioning-ocr-and-segmentation.ipynb @@ -78,7 +78,7 @@ } ], "source": [ - "!pip install transformers==4.49.0 ultralytics\n", + "!uv pip install transformers==4.49.0 ultralytics\n", "\n", "import cv2\n", "import numpy as np\n", diff --git a/notebooks/how-to-use-google-gemini-models-for-object-detection-image-captioning-and-ocr.ipynb b/notebooks/how-to-use-google-gemini-models-for-object-detection-image-captioning-and-ocr.ipynb index 1b93fc5..4317e9e 100644 --- a/notebooks/how-to-use-google-gemini-models-for-object-detection-image-captioning-and-ocr.ipynb +++ b/notebooks/how-to-use-google-gemini-models-for-object-detection-image-captioning-and-ocr.ipynb @@ -74,25 +74,25 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m949.8/949.8 kB\u001b[0m \u001b[31m12.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m363.4/363.4 MB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.8/13.8 MB\u001b[0m \u001b[31m29.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m24.6/24.6 MB\u001b[0m \u001b[31m28.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m883.7/883.7 kB\u001b[0m \u001b[31m18.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m664.8/664.8 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m211.5/211.5 MB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.3/56.3 MB\u001b[0m \u001b[31m11.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m127.9/127.9 MB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m207.5/207.5 MB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m21.1/21.1 MB\u001b[0m \u001b[31m80.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCreating new Ultralytics Settings v0.0.6 file ✅ \n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m949.8/949.8 kB\u001B[0m \u001B[31m12.4 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m363.4/363.4 MB\u001B[0m \u001B[31m2.8 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m13.8/13.8 MB\u001B[0m \u001B[31m29.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m24.6/24.6 MB\u001B[0m \u001B[31m28.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m883.7/883.7 kB\u001B[0m \u001B[31m18.6 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m664.8/664.8 MB\u001B[0m \u001B[31m1.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m211.5/211.5 MB\u001B[0m \u001B[31m5.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m56.3/56.3 MB\u001B[0m \u001B[31m11.2 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m127.9/127.9 MB\u001B[0m \u001B[31m8.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m207.5/207.5 MB\u001B[0m \u001B[31m6.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m21.1/21.1 MB\u001B[0m \u001B[31m80.4 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", + "\u001B[?25hCreating new Ultralytics Settings v0.0.6 file ✅ \n", "View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'\n", "Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.\n" ] } ], "source": [ - "!pip install -U -q google-genai ultralytics\n", + "!uv pip install -U -q google-genai ultralytics\n", "\n", "import json\n", "\n", diff --git a/notebooks/how-to-use-ultralytics-yolo-with-openai-for-number-plate-recognition.ipynb b/notebooks/how-to-use-ultralytics-yolo-with-openai-for-number-plate-recognition.ipynb index afd450c..924b22b 100644 --- a/notebooks/how-to-use-ultralytics-yolo-with-openai-for-number-plate-recognition.ipynb +++ b/notebooks/how-to-use-ultralytics-yolo-with-openai-for-number-plate-recognition.ipynb @@ -79,7 +79,7 @@ } ], "source": [ - "!pip install ultralytics\n", + "!uv pip install ultralytics\n", "\n", "import base64\n", "\n", diff --git a/notebooks/how-to-use-ultralytics-yolo-with-sahi.ipynb b/notebooks/how-to-use-ultralytics-yolo-with-sahi.ipynb index 2880632..3829b6d 100644 --- a/notebooks/how-to-use-ultralytics-yolo-with-sahi.ipynb +++ b/notebooks/how-to-use-ultralytics-yolo-with-sahi.ipynb @@ -1,261 +1,261 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "accelerator": "GPU" + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - "\n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Ultralytics YOLO11 with SAHI notebook 🚀. YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11 usage with SAHI. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Ultralytics YOLO11 with SAHI\n", - "\n", - "This notebook serves as the starting point for using the YOLO11 model with [SAHI (Slicing Aided Hyper Inference)](https://docs.ultralytics.com/guides/sahi-tiled-inference/).\n", - "\n", - "### What is Sliced Inference?\n", - "\n", - "Sliced Inference refers to the practice of subdividing a large or high-resolution image into smaller segments (slices), conducting object detection on these slices, and then recompiling the slices to reconstruct the object locations on the original image. This technique is invaluable in scenarios where computational resources are limited or when working with extremely high-resolution images that could otherwise lead to memory issues.\n", - "\n", - "### Benefits of Sliced Inference\n", - "\n", - "- **Reduced Computational Burden**: Smaller image slices are faster to process, and they consume less memory, enabling smoother operation on lower-end hardware.\n", - "\n", - "- **Preserved Detection Quality**: Since each slice is treated independently, there is no reduction in the quality of object detection, provided the slices are large enough to capture the objects of interest.\n", - "\n", - "- **Enhanced Scalability**: The technique allows for object detection to be more easily scaled across different sizes and resolutions of images, making it ideal for a wide range of applications from satellite imagery to medical diagnostics." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "### Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] - }, - { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG", - "outputId": "50a3d03c-2c78-407d-d1e4-55550e5f7fc1", - "colab": { - "base_uri": "https://localhost:8080/" - } - }, - "source": [ - "!pip install ultralytics sahi\n", - "import ultralytics\n", - "from ultralytics.utils.downloads import safe_download\n", - "ultralytics.checks()" - ], - "execution_count": 1, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.76 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", - "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 33.4/112.6 GB disk)\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "### Clone Repository\n", - "\n", - "- Clone the `ultralytics` repository.\n", - "- `%cd` to the examples section.\n", - "- Move to `YOLOv8-SAHI-Inference-Video` folder." - ], - "metadata": { - "id": "I7XY-vtnkPYf" - } - }, - { - "cell_type": "code", - "source": [ - "# Clone ultralytics repo\n", - "!git clone https://github.com/ultralytics/ultralytics\n", - "\n", - "# cd to local directory\n", - "%cd ultralytics/examples/YOLOv8-SAHI-Inference-Video" - ], - "metadata": { - "id": "fNX-Ymha0HY6", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "a4e52059-afe2-44f1-c77e-aaa48463ceb4" - }, - "execution_count": 2, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Cloning into 'ultralytics'...\n", - "remote: Enumerating objects: 51467, done.\u001b[K\n", - "remote: Counting objects: 100% (123/123), done.\u001b[K\n", - "remote: Compressing objects: 100% (63/63), done.\u001b[K\n", - "remote: Total 51467 (delta 92), reused 67 (delta 60), pack-reused 51344 (from 3)\u001b[K\n", - "Receiving objects: 100% (51467/51467), 29.28 MiB | 10.04 MiB/s, done.\n", - "Resolving deltas: 100% (38066/38066), done.\n", - "/content/ultralytics/examples/YOLOv8-SAHI-Inference-Video\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "### Download the Sample Video\n", - "\n", - "- If you want to use your own video, you can skip this step." - ], - "metadata": { - "id": "mWszyoifxOtR" - } - }, - { - "cell_type": "code", - "source": [ - "safe_download(f\"https://github.com/ultralytics/assets/releases/download/v0.0.0/sahi.demo.video.mp4\", dir=\"/content\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Kkef3pklxVKP", - "outputId": "58aec662-7870-4172-c1d1-4924e19254fc" - }, - "execution_count": 5, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/sahi.demo.video.mp4 to '/content/sahi.demo.video.mp4'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 15.3M/15.3M [00:00<00:00, 272MB/s]\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "### Inference using SAHI\n", - "\n", - "The output results will be stored in `ultralytics/ultralytics/examples/YOLOv8-SAHI-Inference-Video/`" - ], - "metadata": { - "id": "yoP5eiVX1X37" - } - }, - { - "cell_type": "code", - "source": [ - "#inference (default latest model will be selected i.e yolo11n.pt)\n", - "!python yolov8_sahi.py --source \"path/to/video.mp4\"" - ], - "metadata": { - "id": "B1YbLnvG1WAS" - }, - "execution_count": null, - "outputs": [] - }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + "\n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Ultralytics YOLO11 with SAHI notebook 🚀. YOLO11 is the latest version of the YOLO (You Only Look Once) AI models developed by Ultralytics. We hope that the resources in this notebook will help you get the most out of YOLO11 usage with SAHI. Please browse the YOLO11 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Ultralytics YOLO11 with SAHI\n", + "\n", + "This notebook serves as the starting point for using the YOLO11 model with [SAHI (Slicing Aided Hyper Inference)](https://docs.ultralytics.com/guides/sahi-tiled-inference/).\n", + "\n", + "### What is Sliced Inference?\n", + "\n", + "Sliced Inference refers to the practice of subdividing a large or high-resolution image into smaller segments (slices), conducting object detection on these slices, and then recompiling the slices to reconstruct the object locations on the original image. This technique is invaluable in scenarios where computational resources are limited or when working with extremely high-resolution images that could otherwise lead to memory issues.\n", + "\n", + "### Benefits of Sliced Inference\n", + "\n", + "- **Reduced Computational Burden**: Smaller image slices are faster to process, and they consume less memory, enabling smoother operation on lower-end hardware.\n", + "\n", + "- **Preserved Detection Quality**: Since each slice is treated independently, there is no reduction in the quality of object detection, provided the slices are large enough to capture the objects of interest.\n", + "\n", + "- **Enhanced Scalability**: The technique allows for object detection to be more easily scaled across different sizes and resolutions of images, making it ideal for a wide range of applications from satellite imagery to medical diagnostics." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "### Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG", + "outputId": "50a3d03c-2c78-407d-d1e4-55550e5f7fc1", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "source": [ + "!uv pip install ultralytics sahi\n", + "import ultralytics\n", + "from ultralytics.utils.downloads import safe_download\n", + "ultralytics.checks()" + ], + "execution_count": 1, + "outputs": [ { - "cell_type": "code", - "source": [ - "# save the results\n", - "!python yolov8_sahi.py --source \"path/to/video.mp4\" --save-img" - ], - "metadata": { - "id": "P9R8a6W_uEgP" - }, - "execution_count": null, - "outputs": [] + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.76 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", + "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 33.4/112.6 GB disk)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Clone Repository\n", + "\n", + "- Clone the `ultralytics` repository.\n", + "- `%cd` to the examples section.\n", + "- Move to `YOLOv8-SAHI-Inference-Video` folder." + ], + "metadata": { + "id": "I7XY-vtnkPYf" + } + }, + { + "cell_type": "code", + "source": [ + "# Clone ultralytics repo\n", + "!git clone https://github.com/ultralytics/ultralytics\n", + "\n", + "# cd to local directory\n", + "%cd ultralytics/examples/YOLOv8-SAHI-Inference-Video" + ], + "metadata": { + "id": "fNX-Ymha0HY6", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "a4e52059-afe2-44f1-c77e-aaa48463ceb4" + }, + "execution_count": 2, + "outputs": [ { - "cell_type": "code", - "source": [ - "#if you want to change model file\n", - "!python yolov8_sahi.py --source \"path/to/video.mp4\" --weights \"yolo11n.pt\"" - ], - "metadata": { - "id": "FBOo71vhuG5G" - }, - "execution_count": null, - "outputs": [] + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'ultralytics'...\n", + "remote: Enumerating objects: 51467, done.\u001B[K\n", + "remote: Counting objects: 100% (123/123), done.\u001B[K\n", + "remote: Compressing objects: 100% (63/63), done.\u001B[K\n", + "remote: Total 51467 (delta 92), reused 67 (delta 60), pack-reused 51344 (from 3)\u001B[K\n", + "Receiving objects: 100% (51467/51467), 29.28 MiB | 10.04 MiB/s, done.\n", + "Resolving deltas: 100% (38066/38066), done.\n", + "/content/ultralytics/examples/YOLOv8-SAHI-Inference-Video\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Download the Sample Video\n", + "\n", + "- If you want to use your own video, you can skip this step." + ], + "metadata": { + "id": "mWszyoifxOtR" + } + }, + { + "cell_type": "code", + "source": [ + "safe_download(f\"https://github.com/ultralytics/assets/releases/download/v0.0.0/sahi.demo.video.mp4\", dir=\"/content\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "Kkef3pklxVKP", + "outputId": "58aec662-7870-4172-c1d1-4924e19254fc" + }, + "execution_count": 5, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "

\n", - " \"SAHI\n", - "

" - ], - "metadata": { - "id": "bWskbLSKH2S5" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/sahi.demo.video.mp4 to '/content/sahi.demo.video.mp4'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "### Additional Arguments\n", - "\n", - "- `--source`: Defines the file path of the video on which inference will be performed. \n", - "- `--save-img`: Enables saving the detection results as a video file. \n", - "- `--weights`: Allows specifying a different YOLO11 model file (e.g., yolo11n.pt, yolov8s.pt, yolo11m.pt, yolo11l.pt, yolo11x.pt)." - ], - "metadata": { - "id": "UTcl_tpK18XM" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 15.3M/15.3M [00:00<00:00, 272MB/s]\n" + ] } - ] + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Inference using SAHI\n", + "\n", + "The output results will be stored in `ultralytics/ultralytics/examples/YOLOv8-SAHI-Inference-Video/`" + ], + "metadata": { + "id": "yoP5eiVX1X37" + } + }, + { + "cell_type": "code", + "source": [ + "#inference (default latest model will be selected i.e yolo11n.pt)\n", + "!python yolov8_sahi.py --source \"path/to/video.mp4\"" + ], + "metadata": { + "id": "B1YbLnvG1WAS" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# save the results\n", + "!python yolov8_sahi.py --source \"path/to/video.mp4\" --save-img" + ], + "metadata": { + "id": "P9R8a6W_uEgP" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#if you want to change model file\n", + "!python yolov8_sahi.py --source \"path/to/video.mp4\" --weights \"yolo11n.pt\"" + ], + "metadata": { + "id": "FBOo71vhuG5G" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "

\n", + " \"SAHI\n", + "

" + ], + "metadata": { + "id": "bWskbLSKH2S5" + } + }, + { + "cell_type": "markdown", + "source": [ + "### Additional Arguments\n", + "\n", + "- `--source`: Defines the file path of the video on which inference will be performed. \n", + "- `--save-img`: Enables saving the detection results as a video file. \n", + "- `--weights`: Allows specifying a different YOLO11 model file (e.g., yolo11n.pt, yolov8s.pt, yolo11m.pt, yolo11l.pt, yolo11x.pt)." + ], + "metadata": { + "id": "UTcl_tpK18XM" + } + } + ] } diff --git a/notebooks/inference-with-meta-sam-and-sam2-using-ultralytics-python-package.ipynb b/notebooks/inference-with-meta-sam-and-sam2-using-ultralytics-python-package.ipynb index 03da737..ccda9a9 100644 --- a/notebooks/inference-with-meta-sam-and-sam2-using-ultralytics-python-package.ipynb +++ b/notebooks/inference-with-meta-sam-and-sam2-using-ultralytics-python-package.ipynb @@ -1,501 +1,501 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "accelerator": "GPU" + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "t6MPjfT5NrKQ" - }, - "source": [ - "
\n", - "\n", - " \n", - " \n", - "\n", - " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", - "\n", - " \"Ultralytics\n", - " \"Open\n", - "\n", - "\n", - " \"Discord\"\n", - " \"Ultralytics\n", - " \"Ultralytics\n", - " \n", - " Welcome to the Inference with Meta [Segment Anything (SAM)](https://docs.ultralytics.com/models/sam/) using [Ultralytics](https://github.com/ultralytics/ultralytics) [Python Package](https://pypi.org/project/ultralytics/) 🚀 notebook! The Segment Anything Model, or SAM, is a cutting-edge image segmentation model that allows for promptable segmentation, providing unparalleled versatility in image analysis tasks. We hope that the resources in this notebook will help you get the most out of SAM and SAM2. Please browse the Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Segment Anything Model (SAM)\n", - "\n", - "This notebook serves as a starting point for using the Segment Anything (SAM) or [Segment Anything 2 (SAM2)](https://docs.ultralytics.com/models/sam-2/) model with the [Ultralytics Python Package](https://pypi.org/project/ultralytics/)." - ], - "metadata": { - "id": "7EM2nwU4jshF" - } - }, - { - "cell_type": "markdown", - "source": [ - "## Introduction to SAM and Segment Anything 2\n", - "\n", - "SAM is a groundbreaking project that introduces a novel model, task, and dataset for image segmentation. Its advanced design allows it to adapt to new image distributions and tasks without prior knowledge, a feature known as zero-shot transfer.\n", - "\n", - "- Trained on the expansive SA-1B dataset, which contains more than 1 billion masks spread over 11 million carefully curated images, SAM has displayed impressive zero-shot performance, surpassing previous fully supervised results in many cases.\n", - "\n", - "**[SAM 2](https://docs.ultralytics.com/models/sam-2/#key-features)**, the successor to Meta's Segment Anything Model (SAM), is a cutting-edge tool designed for comprehensive object segmentation in both images and videos. It excels in handling complex visual data through a unified, promptable model architecture that supports real-time processing and zero-shot generalization." - ], - "metadata": { - "id": "xypoYW_oYZAf" - } - }, - { - "cell_type": "markdown", - "source": [ - "![SAM2 Inference Results](https://github.com/user-attachments/assets/193d69bc-ae6a-43c4-98d6-9d7a4e86aa99)" - ], - "metadata": { - "id": "R4SICbq5Yalg" - } + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "accelerator": "GPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "t6MPjfT5NrKQ" + }, + "source": [ + "
\n", + "\n", + " \n", + " \n", + "\n", + " [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/)\n", + "\n", + " \"Ultralytics\n", + " \"Open\n", + "\n", + "\n", + " \"Discord\"\n", + " \"Ultralytics\n", + " \"Ultralytics\n", + " \n", + " Welcome to the Inference with Meta [Segment Anything (SAM)](https://docs.ultralytics.com/models/sam/) using [Ultralytics](https://github.com/ultralytics/ultralytics) [Python Package](https://pypi.org/project/ultralytics/) 🚀 notebook! The Segment Anything Model, or SAM, is a cutting-edge image segmentation model that allows for promptable segmentation, providing unparalleled versatility in image analysis tasks. We hope that the resources in this notebook will help you get the most out of SAM and SAM2. Please browse the Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!
" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Segment Anything Model (SAM)\n", + "\n", + "This notebook serves as a starting point for using the Segment Anything (SAM) or [Segment Anything 2 (SAM2)](https://docs.ultralytics.com/models/sam-2/) model with the [Ultralytics Python Package](https://pypi.org/project/ultralytics/)." + ], + "metadata": { + "id": "7EM2nwU4jshF" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Introduction to SAM and Segment Anything 2\n", + "\n", + "SAM is a groundbreaking project that introduces a novel model, task, and dataset for image segmentation. Its advanced design allows it to adapt to new image distributions and tasks without prior knowledge, a feature known as zero-shot transfer.\n", + "\n", + "- Trained on the expansive SA-1B dataset, which contains more than 1 billion masks spread over 11 million carefully curated images, SAM has displayed impressive zero-shot performance, surpassing previous fully supervised results in many cases.\n", + "\n", + "**[SAM 2](https://docs.ultralytics.com/models/sam-2/#key-features)**, the successor to Meta's Segment Anything Model (SAM), is a cutting-edge tool designed for comprehensive object segmentation in both images and videos. It excels in handling complex visual data through a unified, promptable model architecture that supports real-time processing and zero-shot generalization." + ], + "metadata": { + "id": "xypoYW_oYZAf" + } + }, + { + "cell_type": "markdown", + "source": [ + "![SAM2 Inference Results](https://github.com/user-attachments/assets/193d69bc-ae6a-43c4-98d6-9d7a4e86aa99)" + ], + "metadata": { + "id": "R4SICbq5Yalg" + } + }, + { + "cell_type": "markdown", + "metadata": { + "id": "7mGmQbAO5pQb" + }, + "source": [ + "## Setup\n", + "\n", + "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", + "\n", + "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "wbvMlHd_QwMG", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "45361f29-2899-4751-aed8-aca158d314ba" + }, + "source": [ + "!uv pip install ultralytics\n", + "import ultralytics\n", + "ultralytics.checks()" + ], + "execution_count": null, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "7mGmQbAO5pQb" - }, - "source": [ - "## Setup\n", - "\n", - "pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) and check software and hardware.\n", - "\n", - "[![PyPI - Version](https://img.shields.io/pypi/v/ultralytics?logo=pypi&logoColor=white)](https://pypi.org/project/ultralytics/) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://www.pepy.tech/projects/ultralytics) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ultralytics?logo=python&logoColor=gold)](https://pypi.org/project/ultralytics/)" - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Ultralytics 8.3.79 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", + "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 33.2/112.6 GB disk)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Segment Everything\n", + "\n", + "Using SAM and SAM2 models, you can [segment](https://docs.ultralytics.com/tasks/segment/) the entire image or video content without specific prompts." + ], + "metadata": { + "id": "xE6ntKojSfSD" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import SAM\n", + "\n", + "# Load a model\n", + "# For SAM=sam_b.pt, SAM2=sam2_b.pt, SAM2.1=sam2.1_b.pt\n", + "model = SAM(\"sam2.1_b.pt\")\n", + "\n", + "model.info() # Display model information (optional)\n", + "\n", + "# Run inference (image or video)\n", + "results = model(\"https://ultralytics.com/images/bus.jpg\") # image\n", + "# results = model(\"https://youtu.be/LNwODJXcvt4\") # video file\n", + "\n", + "results[0].show() # Display results" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "UtLkkQmX14Wz", + "outputId": "9bcac3c1-ea10-4c42-c770-ab2944d0d8e6" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "code", - "metadata": { - "id": "wbvMlHd_QwMG", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "45361f29-2899-4751-aed8-aca158d314ba" - }, - "source": [ - "!pip install ultralytics\n", - "import ultralytics\n", - "ultralytics.checks()" - ], - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Ultralytics 8.3.79 🚀 Python-3.11.11 torch-2.5.1+cu124 CUDA:0 (Tesla T4, 15095MiB)\n", - "Setup complete ✅ (2 CPUs, 12.7 GB RAM, 33.2/112.6 GB disk)\n" - ] - } - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/sam2.1_b.pt to 'sam2.1_b.pt'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Segment Everything\n", - "\n", - "Using SAM and SAM2 models, you can [segment](https://docs.ultralytics.com/tasks/segment/) the entire image or video content without specific prompts." - ], - "metadata": { - "id": "xE6ntKojSfSD" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 154M/154M [00:00<00:00, 325MB/s]\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import SAM\n", - "\n", - "# Load a model\n", - "# For SAM=sam_b.pt, SAM2=sam2_b.pt, SAM2.1=sam2.1_b.pt\n", - "model = SAM(\"sam2.1_b.pt\")\n", - "\n", - "model.info() # Display model information (optional)\n", - "\n", - "# Run inference (image or video)\n", - "results = model(\"https://ultralytics.com/images/bus.jpg\") # image\n", - "# results = model(\"https://youtu.be/LNwODJXcvt4\") # video file\n", - "\n", - "results[0].show() # Display results" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "UtLkkQmX14Wz", - "outputId": "9bcac3c1-ea10-4c42-c770-ab2944d0d8e6" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/sam2.1_b.pt to 'sam2.1_b.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 154M/154M [00:00<00:00, 325MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Model summary: 403 layers, 80,850,178 parameters, 80,850,178 gradients\n", - "\n", - "Downloading https://ultralytics.com/images/bus.jpg to 'bus.jpg'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 134k/134k [00:00<00:00, 8.17MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "image 1/1 /content/bus.jpg: 1024x1024 1 0, 1 1, 1 2, 1 3, 1 4, 1 5, 1 6, 1 7, 1 8, 1 9, 1 10, 1 11, 1 12, 1 13, 1 14, 1 15, 1 16, 1 17, 1 18, 1 19, 1 20, 1 21, 8291.7ms\n", - "Speed: 9.2ms preprocess, 8291.7ms inference, 1.8ms postprocess per image at shape (1, 3, 1024, 1024)\n" - ] - } - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Model summary: 403 layers, 80,850,178 parameters, 80,850,178 gradients\n", + "\n", + "Downloading https://ultralytics.com/images/bus.jpg to 'bus.jpg'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "![Segment everything results](https://github.com/user-attachments/assets/5d00c0e6-42c3-4f23-9975-1340d9b866f5)" - ], - "metadata": { - "id": "-RfG6TlvwEgd" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 134k/134k [00:00<00:00, 8.17MB/s]\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Segment Anything\n", - "\n", - "You can [segment](https://docs.ultralytics.com/tasks/segment/) specific objects in an image or video using different prompts, such as bounding box and point prompts." - ], - "metadata": { - "id": "fBZnd9l43_zc" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "image 1/1 /content/bus.jpg: 1024x1024 1 0, 1 1, 1 2, 1 3, 1 4, 1 5, 1 6, 1 7, 1 8, 1 9, 1 10, 1 11, 1 12, 1 13, 1 14, 1 15, 1 16, 1 17, 1 18, 1 19, 1 20, 1 21, 8291.7ms\n", + "Speed: 9.2ms preprocess, 8291.7ms inference, 1.8ms postprocess per image at shape (1, 3, 1024, 1024)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Segment everything results](https://github.com/user-attachments/assets/5d00c0e6-42c3-4f23-9975-1340d9b866f5)" + ], + "metadata": { + "id": "-RfG6TlvwEgd" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Segment Anything\n", + "\n", + "You can [segment](https://docs.ultralytics.com/tasks/segment/) specific objects in an image or video using different prompts, such as bounding box and point prompts." + ], + "metadata": { + "id": "fBZnd9l43_zc" + } + }, + { + "cell_type": "markdown", + "source": [ + "### Bounding box prompt\n", + "\n", + "The `bbox_prompt` refers to a bounding box input that guides the model in segmenting a specific object within an image. In the example below, you will segment only the bus by providing the bounding box coordinates." + ], + "metadata": { + "id": "y1XKu_Y48s8M" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import SAM\n", + "\n", + "# Load a model\n", + "model = SAM(\"sam2.1_b.pt\")\n", + "\n", + "# Run inference with bboxes prompt (Provide the bounding box coordinates\n", + "# for the bus area, ensuring that only bus is segmented in the entire image)\n", + "results = model(\"https://ultralytics.com/images/bus.jpg\",\n", + " bboxes=[3.8328723907470703, 229.35601806640625,\n", + " 796.2098999023438, 728.4313354492188])\n", + "\n", + "results[0].show() # Display results" + ], + "metadata": { + "id": "AM7CLQlA8vXT", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "956e0d88-5ec9-4e57-cf95-93a4008d66b9" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "### Bounding box prompt\n", - "\n", - "The `bbox_prompt` refers to a bounding box input that guides the model in segmenting a specific object within an image. In the example below, you will segment only the bus by providing the bounding box coordinates." - ], - "metadata": { - "id": "y1XKu_Y48s8M" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Found https://ultralytics.com/images/bus.jpg locally at bus.jpg\n", + "image 1/1 /content/bus.jpg: 1024x1024 1 0, 334.1ms\n", + "Speed: 7.8ms preprocess, 334.1ms inference, 0.7ms postprocess per image at shape (1, 3, 1024, 1024)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Segment anything with bounding box prompt results](https://github.com/user-attachments/assets/4833d1fe-7990-4829-83d9-dc6e43b9d08c)" + ], + "metadata": { + "id": "GUSR-0eowfaU" + } + }, + { + "cell_type": "markdown", + "source": [ + "### Point prompt\n", + "\n", + "The `point_prompt` refers to a specific point input (x, y) that guides the Segment Anything Model (SAM) in segmenting an object within an image. Instead of providing a bounding box, you can indicate an object by selecting a point on it, and SAM will generate a segmentation mask around that point." + ], + "metadata": { + "id": "5YnEUSxf8v2L" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import SAM\n", + "\n", + "# Load a model\n", + "model = SAM(\"sam2.1_b.pt\")\n", + "\n", + "# Run inference with point prompt (Provide the point coordinates for the\n", + "# person area, ensuring that only the person is segmented in the entire image)\n", + "results = model(\"https://ultralytics.com/images/bus.jpg\",\n", + " points=[34, 714])\n", + "\n", + "results[0].show() # Display results" + ], + "metadata": { + "id": "KysZKUja5vvM", + "colab": { + "base_uri": "https://localhost:8080/" }, + "outputId": "1f9edc75-6fe5-40ae-dfb5-d2a611652f92" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "code", - "source": [ - "from ultralytics import SAM\n", - "\n", - "# Load a model\n", - "model = SAM(\"sam2.1_b.pt\")\n", - "\n", - "# Run inference with bboxes prompt (Provide the bounding box coordinates\n", - "# for the bus area, ensuring that only bus is segmented in the entire image)\n", - "results = model(\"https://ultralytics.com/images/bus.jpg\",\n", - " bboxes=[3.8328723907470703, 229.35601806640625,\n", - " 796.2098999023438, 728.4313354492188])\n", - "\n", - "results[0].show() # Display results" - ], - "metadata": { - "id": "AM7CLQlA8vXT", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "956e0d88-5ec9-4e57-cf95-93a4008d66b9" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Found https://ultralytics.com/images/bus.jpg locally at bus.jpg\n", - "image 1/1 /content/bus.jpg: 1024x1024 1 0, 334.1ms\n", - "Speed: 7.8ms preprocess, 334.1ms inference, 0.7ms postprocess per image at shape (1, 3, 1024, 1024)\n" - ] - } - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Found https://ultralytics.com/images/bus.jpg locally at bus.jpg\n", + "image 1/1 /content/bus.jpg: 1024x1024 1 0, 312.3ms\n", + "Speed: 6.4ms preprocess, 312.3ms inference, 0.7ms postprocess per image at shape (1, 3, 1024, 1024)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Segment anything with point prompt results](https://github.com/user-attachments/assets/fc218266-1e1a-4e31-a0e3-de4de55cb13c)" + ], + "metadata": { + "id": "SHZWtqBWwkXS" + } + }, + { + "cell_type": "markdown", + "source": [ + "### Multiple points prompt\n", + "\n", + "Multiple `point_prompt` inputs refer to specific points (x, y) that serve as prompts to guide the Segment Anything Model (SAM) in segmenting multiple objects within an image." + ], + "metadata": { + "id": "wZBthWVlncoI" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics import SAM\n", + "\n", + "# Load a model\n", + "model = SAM(\"sam2.1_b.pt\")\n", + "\n", + "# Run inference with multiple point prompts (Provide the points coordinates for\n", + "# person area, ensuring that only the person is segmented in the entire image)\n", + "results = model(\"https://ultralytics.com/images/bus.jpg\",\n", + " points=[[34, 714], [283, 634]])\n", + "\n", + "results[0].show() # Display results" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "AJF6ZgjpnqYK", + "outputId": "6b64d5b9-e010-45f9-e88a-91842246c092" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "![Segment anything with bounding box prompt results](https://github.com/user-attachments/assets/4833d1fe-7990-4829-83d9-dc6e43b9d08c)" - ], - "metadata": { - "id": "GUSR-0eowfaU" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "Found https://ultralytics.com/images/bus.jpg locally at bus.jpg\n", + "image 1/1 /content/bus.jpg: 1024x1024 1 0, 1 1, 315.8ms\n", + "Speed: 7.4ms preprocess, 315.8ms inference, 0.7ms postprocess per image at shape (1, 3, 1024, 1024)\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "![Segment anything with multiple points prompt results](https://github.com/user-attachments/assets/fd7f7d78-f79b-401f-ad03-e129e8dc89dd)" + ], + "metadata": { + "id": "JCYM1yruwnL7" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Auto Annotation using Segment Anything Model\n", + "\n", + "[Auto-annotation](https://docs.ultralytics.com/reference/data/annotator/#ultralytics.data.annotator.auto_annotate) is a core feature of SAM, enabling users to create a segmentation dataset with a pre-trained detection model. It streamlines the annotation process by quickly and accurately labeling large image sets, eliminating the need for labor-intensive manual annotation.\n", + "\n", + "- The example below uses two images from Ultralytics assets for auto-annotation, but you can use your own. Just create a folder, add the images you want to auto-annotate, and pass the folder path to the `auto_annotate` function via the `data` argument." + ], + "metadata": { + "id": "3NoG8H9bpuiA" + } + }, + { + "cell_type": "code", + "source": [ + "from ultralytics.data.annotator import auto_annotate\n", + "\n", + "# Use the Ultralytics sample dataset (You can use your own images)\n", + "from ultralytics.utils.downloads import safe_download\n", + "images = [\"bus.jpg\", \"zidane.jpg\"]\n", + "for img in images:\n", + " path = safe_download(f\"https://ultralytics.com/assets/{img}\", dir=\"assets\")\n", + "\n", + "# return the annotation in the Ultralytics YOLO segmentation format.\n", + "# output directory i.e assets_auto_annotate_labels\n", + "auto_annotate(data=\"assets\",\n", + " det_model=\"yolo11x.pt\",\n", + " sam_model=\"sam_b.pt\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "r-rVDIE_pnnx", + "outputId": "9e98f5a6-ffa9-448a-92c0-ade2c50c5144" + }, + "execution_count": null, + "outputs": [ { - "cell_type": "markdown", - "source": [ - "### Point prompt\n", - "\n", - "The `point_prompt` refers to a specific point input (x, y) that guides the Segment Anything Model (SAM) in segmenting an object within an image. Instead of providing a bounding box, you can indicate an object by selecting a point on it, and SAM will generate a segmentation mask around that point." - ], - "metadata": { - "id": "5YnEUSxf8v2L" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/bus.jpg to 'assets/bus.jpg'...\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import SAM\n", - "\n", - "# Load a model\n", - "model = SAM(\"sam2.1_b.pt\")\n", - "\n", - "# Run inference with point prompt (Provide the point coordinates for the\n", - "# person area, ensuring that only the person is segmented in the entire image)\n", - "results = model(\"https://ultralytics.com/images/bus.jpg\",\n", - " points=[34, 714])\n", - "\n", - "results[0].show() # Display results" - ], - "metadata": { - "id": "KysZKUja5vvM", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "1f9edc75-6fe5-40ae-dfb5-d2a611652f92" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Found https://ultralytics.com/images/bus.jpg locally at bus.jpg\n", - "image 1/1 /content/bus.jpg: 1024x1024 1 0, 312.3ms\n", - "Speed: 6.4ms preprocess, 312.3ms inference, 0.7ms postprocess per image at shape (1, 3, 1024, 1024)\n" - ] - } - ] + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 134k/134k [00:00<00:00, 6.56MB/s]" + ] }, { - "cell_type": "markdown", - "source": [ - "![Segment anything with point prompt results](https://github.com/user-attachments/assets/fc218266-1e1a-4e31-a0e3-de4de55cb13c)" - ], - "metadata": { - "id": "SHZWtqBWwkXS" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://ultralytics.com/assets/zidane.jpg to 'assets/zidane.jpg'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "### Multiple points prompt\n", - "\n", - "Multiple `point_prompt` inputs refer to specific points (x, y) that serve as prompts to guide the Segment Anything Model (SAM) in segmenting multiple objects within an image." - ], - "metadata": { - "id": "wZBthWVlncoI" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n", + "100%|██████████| 49.2k/49.2k [00:00<00:00, 8.62MB/s]" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics import SAM\n", - "\n", - "# Load a model\n", - "model = SAM(\"sam2.1_b.pt\")\n", - "\n", - "# Run inference with multiple point prompts (Provide the points coordinates for\n", - "# person area, ensuring that only the person is segmented in the entire image)\n", - "results = model(\"https://ultralytics.com/images/bus.jpg\",\n", - " points=[[34, 714], [283, 634]])\n", - "\n", - "results[0].show() # Display results" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "AJF6ZgjpnqYK", - "outputId": "6b64d5b9-e010-45f9-e88a-91842246c092" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Found https://ultralytics.com/images/bus.jpg locally at bus.jpg\n", - "image 1/1 /content/bus.jpg: 1024x1024 1 0, 1 1, 315.8ms\n", - "Speed: 7.4ms preprocess, 315.8ms inference, 0.7ms postprocess per image at shape (1, 3, 1024, 1024)\n" - ] - } - ] + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11x.pt to 'yolo11x.pt'...\n" + ] }, { - "cell_type": "markdown", - "source": [ - "![Segment anything with multiple points prompt results](https://github.com/user-attachments/assets/fd7f7d78-f79b-401f-ad03-e129e8dc89dd)" - ], - "metadata": { - "id": "JCYM1yruwnL7" - } + "output_type": "stream", + "name": "stderr", + "text": [ + "\n", + "100%|██████████| 109M/109M [00:00<00:00, 342MB/s]\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Auto Annotation using Segment Anything Model\n", - "\n", - "[Auto-annotation](https://docs.ultralytics.com/reference/data/annotator/#ultralytics.data.annotator.auto_annotate) is a core feature of SAM, enabling users to create a segmentation dataset with a pre-trained detection model. It streamlines the annotation process by quickly and accurately labeling large image sets, eliminating the need for labor-intensive manual annotation.\n", - "\n", - "- The example below uses two images from Ultralytics assets for auto-annotation, but you can use your own. Just create a folder, add the images you want to auto-annotate, and pass the folder path to the `auto_annotate` function via the `data` argument." - ], - "metadata": { - "id": "3NoG8H9bpuiA" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/sam_b.pt to 'sam_b.pt'...\n" + ] }, { - "cell_type": "code", - "source": [ - "from ultralytics.data.annotator import auto_annotate\n", - "\n", - "# Use the Ultralytics sample dataset (You can use your own images)\n", - "from ultralytics.utils.downloads import safe_download\n", - "images = [\"bus.jpg\", \"zidane.jpg\"]\n", - "for img in images:\n", - " path = safe_download(f\"https://ultralytics.com/assets/{img}\", dir=\"assets\")\n", - "\n", - "# return the annotation in the Ultralytics YOLO segmentation format.\n", - "# output directory i.e assets_auto_annotate_labels\n", - "auto_annotate(data=\"assets\",\n", - " det_model=\"yolo11x.pt\",\n", - " sam_model=\"sam_b.pt\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "r-rVDIE_pnnx", - "outputId": "9e98f5a6-ffa9-448a-92c0-ade2c50c5144" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/bus.jpg to 'assets/bus.jpg'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 134k/134k [00:00<00:00, 6.56MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://ultralytics.com/assets/zidane.jpg to 'assets/zidane.jpg'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n", - "100%|██████████| 49.2k/49.2k [00:00<00:00, 8.62MB/s]" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11x.pt to 'yolo11x.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\n", - "100%|██████████| 109M/109M [00:00<00:00, 342MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/sam_b.pt to 'sam_b.pt'...\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "100%|██████████| 358M/358M [00:01<00:00, 200MB/s]\n" - ] - }, - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "image 1/2 /content/assets/bus.jpg: 640x480 4 persons, 1 bus, 71.2ms\n", - "image 2/2 /content/assets/zidane.jpg: 384x640 2 persons, 3 ties, 33.6ms\n", - "Speed: 2.8ms preprocess, 52.4ms inference, 1.3ms postprocess per image at shape (1, 3, 384, 640)\n" - ] - } - ] + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 358M/358M [00:01<00:00, 200MB/s]\n" + ] }, { - "cell_type": "markdown", - "source": [ - "## Additional Resources \n", - "\n", - "🔹 Segment Anything 2 Documentation: [📖 Read here](https://docs.ultralytics.com/models/sam-2/) \n", - "🔹 SAM2 Blog: [📝 Explore applications](https://www.ultralytics.com/blog/applications-of-meta-ai-segment-anything-model-2-sam-2)" - ], - "metadata": { - "id": "yOqQpo4zt1Rb" - } + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "image 1/2 /content/assets/bus.jpg: 640x480 4 persons, 1 bus, 71.2ms\n", + "image 2/2 /content/assets/zidane.jpg: 384x640 2 persons, 3 ties, 33.6ms\n", + "Speed: 2.8ms preprocess, 52.4ms inference, 1.3ms postprocess per image at shape (1, 3, 384, 640)\n" + ] } - ] + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Additional Resources \n", + "\n", + "🔹 Segment Anything 2 Documentation: [📖 Read here](https://docs.ultralytics.com/models/sam-2/) \n", + "🔹 SAM2 Blog: [📝 Explore applications](https://www.ultralytics.com/blog/applications-of-meta-ai-segment-anything-model-2-sam-2)" + ], + "metadata": { + "id": "yOqQpo4zt1Rb" + } + } + ] }