From d7624969896bb80ba99894446a8ca92fea7e703c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 14 Jan 2024 20:10:32 +0100 Subject: [PATCH] Update YOLOv3 and YOLOv5 YAMLs (#7574) Signed-off-by: Glenn Jocher --- docs/README.md | 4 +- docs/ar/datasets/index.md | 2 +- docs/de/datasets/index.md | 2 +- docs/en/datasets/detect/argoverse.md | 2 +- docs/en/datasets/detect/index.md | 2 +- docs/en/datasets/detect/voc.md | 3 +- docs/en/datasets/index.md | 2 +- .../guides/isolating-segmentation-objects.md | 30 +++---- docs/en/guides/model-deployment-options.md | 2 +- docs/en/guides/object-blurring.md | 2 +- docs/en/hub/index.md | 4 +- docs/en/integrations/comet.md | 2 +- docs/en/models/fast-sam.md | 38 +++++---- docs/en/models/rtdetr.md | 2 +- docs/en/models/sam.md | 2 +- docs/en/models/yolo-nas.md | 2 +- docs/en/modes/predict.md | 2 - docs/en/modes/track.md | 2 - docs/en/reference/nn/modules/utils.md | 2 +- docs/en/tasks/obb.md | 1 - docs/en/usage/cli.md | 2 +- .../tutorials/architecture_description.md | 18 ++-- docs/en/yolov5/tutorials/train_custom_data.md | 4 +- .../transfer_learning_with_frozen_layers.md | 67 ++++++++------- docs/es/datasets/index.md | 2 +- docs/fr/datasets/index.md | 2 +- docs/hi/datasets/index.md | 2 +- docs/hi/models/yolov3.md | 2 +- docs/ja/datasets/index.md | 2 +- docs/ko/datasets/index.md | 2 +- docs/mkdocs.yml | 12 +-- docs/mkdocs_ar.yml | 7 +- docs/mkdocs_de.yml | 7 +- docs/mkdocs_es.yml | 7 +- docs/mkdocs_fr.yml | 7 +- docs/mkdocs_hi.yml | 7 +- docs/mkdocs_ja.yml | 7 +- docs/mkdocs_ko.yml | 7 +- docs/mkdocs_pt.yml | 7 +- docs/mkdocs_ru.yml | 7 +- docs/mkdocs_zh.yml | 7 +- docs/pt/datasets/index.md | 2 +- docs/ru/datasets/index.md | 2 +- docs/zh/datasets/index.md | 2 +- ultralytics/cfg/models/v3/yolov3-spp.yaml | 60 +++++++------- ultralytics/cfg/models/v3/yolov3-tiny.yaml | 44 +++++----- ultralytics/cfg/models/v3/yolov3.yaml | 60 +++++++------- ultralytics/cfg/models/v5/yolov5-p6.yaml | 82 +++++++++---------- ultralytics/cfg/models/v5/yolov5.yaml | 61 +++++++------- ultralytics/nn/modules/head.py | 10 +-- ultralytics/nn/modules/utils.py | 2 +- 51 files changed, 299 insertions(+), 319 deletions(-) diff --git a/docs/README.md b/docs/README.md index a5da59e1..db4fef2d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,14 +56,14 @@ To stop the serve command and terminate the local server, you can use the `CTRL+ For multi-language MkDocs sites use the following additional steps: -1. Add all new language *.md files to git commit: `git add docs/**/*.md -f` +1. Add all new language `*.md` files to git commit: `git add docs/**/*.md -f` 2. Build all languages to the `/site` directory. Verify that the top-level `/site` directory contains `CNAME`, `robots.txt` and `sitemap.xml` files, if applicable. ```bash # Remove existing /site directory rm -rf site - # Loop through all *.yml files in the docs directory + # Loop through all YAML files in the docs directory mkdocs build -f docs/mkdocs.yml for file in docs/mkdocs_*.yml; do echo "Building MkDocs site with configuration file: $file" diff --git a/docs/ar/datasets/index.md b/docs/ar/datasets/index.md index dd4dab20..4ee98954 100644 --- a/docs/ar/datasets/index.md +++ b/docs/ar/datasets/index.md @@ -80,7 +80,7 @@ keywords: الرؤية الحاسوبية ، مجموعات البيانات ، 2. **وضع تعليقات على الصور**: قم بإضافة تعليقات على هذه الصور مع صناديق الحدود أو الشرائح أو النقاط التي تعتمد على المهمة. -3. **تصدير التعليقات**: قم بتحويل هذه التعليقات إلى تنسيق الملف *.txt *.txt المدعوم من Ultralytics. +3. **تصدير التعليقات**: قم بتحويل هذه التعليقات إلى تنسيق الملف `*.txt` `*.txt` المدعوم من Ultralytics. 4. **تنظيم مجموعة البيانات**: قم بترتيب مجموعة البيانات الخاصة بك في البنية المجلدات الصحيحة. يجب أن تحتوي على مجلدات أعلى المستوى `train/` و `val/` ، وداخل كل منهما ، مجلدات فرعية للـ `images/` و `labels/`. diff --git a/docs/de/datasets/index.md b/docs/de/datasets/index.md index 1944d711..53a96e51 100644 --- a/docs/de/datasets/index.md +++ b/docs/de/datasets/index.md @@ -80,7 +80,7 @@ Das Bereitstellen eines neuen Datensatzes umfasst mehrere Schritte, um sicherzus 2. **Bilder annotieren**: Annotieren Sie diese Bilder mit Bounding Boxen, Segmenten oder Schlüsselpunkten, je nach Aufgabe. -3. **Annotationen exportieren**: Konvertieren Sie diese Annotationen in das von Ultralytics unterstützte YOLO *.txt-Dateiformat. +3. **Annotationen exportieren**: Konvertieren Sie diese Annotationen in das von Ultralytics unterstützte YOLO `*.txt`-Dateiformat. 4. **Datensatz organisieren**: Ordnen Sie Ihren Datensatz in die richtige Ordnerstruktur an. Sie sollten übergeordnete Verzeichnisse `train/` und `val/` haben, und innerhalb dieser je ein Unterverzeichnis `images/` und `labels/`. diff --git a/docs/en/datasets/detect/argoverse.md b/docs/en/datasets/detect/argoverse.md index 4ec59d88..cf9e4894 100644 --- a/docs/en/datasets/detect/argoverse.md +++ b/docs/en/datasets/detect/argoverse.md @@ -10,7 +10,7 @@ The [Argoverse](https://www.argoverse.org/) dataset is a collection of data desi !!! Note - The Argoverse dataset *.zip file required for training was removed from Amazon S3 after the shutdown of Argo AI by Ford, but we have made it available for manual download on [Google Drive](https://drive.google.com/file/d/1st9qW3BeIwQsnR0t8mRpvbsSWIo16ACi/view?usp=drive_link). + The Argoverse dataset `*.zip` file required for training was removed from Amazon S3 after the shutdown of Argo AI by Ford, but we have made it available for manual download on [Google Drive](https://drive.google.com/file/d/1st9qW3BeIwQsnR0t8mRpvbsSWIo16ACi/view?usp=drive_link). ## Key Features diff --git a/docs/en/datasets/detect/index.md b/docs/en/datasets/detect/index.md index 7bc80637..501790d4 100644 --- a/docs/en/datasets/detect/index.md +++ b/docs/en/datasets/detect/index.md @@ -12,7 +12,7 @@ Training a robust and accurate object detection model requires a comprehensive d ### Ultralytics YOLO format -The Ultralytics YOLO format is a dataset configuration format that allows you to define the dataset root directory, the relative paths to training/validation/testing image directories or *.txt files containing image paths, and a dictionary of class names. Here is an example: +The Ultralytics YOLO format is a dataset configuration format that allows you to define the dataset root directory, the relative paths to training/validation/testing image directories or `*.txt` files containing image paths, and a dictionary of class names. Here is an example: ```yaml # 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, ..] diff --git a/docs/en/datasets/detect/voc.md b/docs/en/datasets/detect/voc.md index c47819ae..eb298f9a 100644 --- a/docs/en/datasets/detect/voc.md +++ b/docs/en/datasets/detect/voc.md @@ -58,8 +58,7 @@ To train a YOLOv8n model on the VOC dataset for 100 epochs with an image size of === "CLI" ```bash - # Start training from - a pretrained *.pt model + # Start training from a pretrained *.pt model yolo detect train data=VOC.yaml model=yolov8n.pt epochs=100 imgsz=640 ``` diff --git a/docs/en/datasets/index.md b/docs/en/datasets/index.md index 0554782e..c11e3a46 100644 --- a/docs/en/datasets/index.md +++ b/docs/en/datasets/index.md @@ -87,7 +87,7 @@ Contributing a new dataset involves several steps to ensure that it aligns well 2. **Annotate Images**: Annotate these images with bounding boxes, segments, or keypoints, depending on the task. -3. **Export Annotations**: Convert these annotations into the YOLO *.txt file format which Ultralytics supports. +3. **Export Annotations**: Convert these annotations into the YOLO `*.txt` file format which Ultralytics supports. 4. **Organize Dataset**: Arrange your dataset into the correct folder structure. You should have `train/` and `val/` top-level directories, and within each, an `images/` and `labels/` subdirectory. diff --git a/docs/en/guides/isolating-segmentation-objects.md b/docs/en/guides/isolating-segmentation-objects.md index a0436f43..79d47692 100644 --- a/docs/en/guides/isolating-segmentation-objects.md +++ b/docs/en/guides/isolating-segmentation-objects.md @@ -14,7 +14,7 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab ## Recipe Walk Through -1. Begin with the necessary imports +1. Begin with the necessary imports ```py from pathlib import Path @@ -28,9 +28,9 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab See the Ultralytics [Quickstart](../quickstart.md/#install-ultralytics) Installation section for a quick walkthrough on installing the required libraries. - --- + *** -2. Load a model and run `predict()` method on a source. +2. Load a model and run `predict()` method on a source. ```py from ultralytics import YOLO @@ -55,11 +55,11 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab For additional information about Segmentation Models, visit the [Segment Task](../tasks/segment.md#models) page. To learn more about `predict()` method, see [Predict Mode](../modes/predict.md) section of the Documentation. - --- + *** -3. Now iterate over the results and the contours. For workflows that want to save an image to file, the source image `base-name` and the detection `class-label` are retrieved for later use (optional). +3. Now iterate over the results and the contours. For workflows that want to save an image to file, the source image `base-name` and the detection `class-label` are retrieved for later use (optional). - ``` { .py .annotate } + ```{ .py .annotate } # (2) Iterate detection results (helpful for multiple images) for r in res: img = np.copy(r.orig_img) @@ -79,13 +79,13 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab A single image will only iterate the first loop once. A single image with only a single detection will iterate each loop _only_ once. - --- + *** -4. Start with generating a binary mask from the source image and then draw a filled contour onto the mask. This will allow the object to be isolated from the other parts of the image. An example from `bus.jpg` for one of the detected `person` class objects is shown on the right. +4. Start with generating a binary mask from the source image and then draw a filled contour onto the mask. This will allow the object to be isolated from the other parts of the image. An example from `bus.jpg` for one of the detected `person` class objects is shown on the right. ![Binary Mask Image](https://github.com/ultralytics/ultralytics/assets/62214284/59bce684-fdda-4b17-8104-0b4b51149aca){ width="240", align="right" } - ``` { .py .annotate } + ```{ .py .annotate } # Create binary mask b_mask = np.zeros(img.shape[:2], np.uint8) @@ -116,7 +116,7 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab Expand to understand what is happening when defining the contour variable.

- - `c.masks.xy` :: Provides the coordinates of the mask contour points in the format `(x, y)`. For more details, refer to the [Masks Section from Predict Mode](../modes/predict.md#masks). + - `c.masks.xy` :: Provides the coordinates of the mask contour points in the format `(x, y)`. For more details, refer to the [Masks Section from Predict Mode](../modes/predict.md#masks). - `.pop()` :: As `masks.xy` is a list containing a single element, this element is extracted using the `pop()` method. @@ -143,9 +143,9 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab

- --- + *** -5. Next the there are 2 options for how to move forward with the image from this point and a subsequent option for each. +5. Next the there are 2 options for how to move forward with the image from this point and a subsequent option for each. ### Object Isolation Options @@ -256,9 +256,9 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab This is a built in feature for the Ultralytics library. See the `save_crop` argument for [Predict Mode Inference Arguments](../modes/predict.md/#inference-arguments) for details. - --- + *** -6. What to do next is entirely left to you as the developer. A basic example of one possible next step (saving the image to file for future use) is shown. +6. What to do next is entirely left to you as the developer. A basic example of one possible next step (saving the image to file for future use) is shown. - **NOTE:** this step is optional and can be skipped if not required for your specific use case. @@ -275,7 +275,7 @@ After performing the [Segment Task](../tasks/segment.md), it's sometimes desirab Here, all steps from the previous section are combined into a single block of code. For repeated use, it would be optimal to define a function to do some or all commands contained in the `for`-loops, but that is an exercise left to the reader. -``` { .py .annotate } +```{ .py .annotate } from pathlib import Path import cv2 as cv diff --git a/docs/en/guides/model-deployment-options.md b/docs/en/guides/model-deployment-options.md index 6a4adbaa..d0d7b325 100644 --- a/docs/en/guides/model-deployment-options.md +++ b/docs/en/guides/model-deployment-options.md @@ -8,7 +8,7 @@ keywords: YOLOv8, Deployment, PyTorch, TorchScript, ONNX, OpenVINO, TensorRT, Co ## Introduction -*Setting the Scene:* You've come a long way on your journey with YOLOv8. You've diligently collected data, meticulously annotated it, and put in the hours to train and rigorously evaluate your custom YOLOv8 model. Now, it’s time to put your model to work for your specific application, use case, or project. But there's a critical decision that stands before you: how to export and deploy your model effectively. +You've come a long way on your journey with YOLOv8. You've diligently collected data, meticulously annotated it, and put in the hours to train and rigorously evaluate your custom YOLOv8 model. Now, it’s time to put your model to work for your specific application, use case, or project. But there's a critical decision that stands before you: how to export and deploy your model effectively. This guide walks you through YOLOv8’s deployment options and the essential factors to consider to choose the right option for your project. diff --git a/docs/en/guides/object-blurring.md b/docs/en/guides/object-blurring.md index aab92832..bb2f7443 100644 --- a/docs/en/guides/object-blurring.md +++ b/docs/en/guides/object-blurring.md @@ -8,7 +8,7 @@ keywords: Ultralytics, YOLOv8, Object Detection, Object Blurring, Privacy Protec ## What is Object Blurring? -Object blurring with [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics/) involves applying a blurring effect to specific detected objects in an image or video. This can be achieved using the YOLOv8 model capabilities to identify and manipulate objects within a given scene. +Object blurring with [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics/) involves applying a blurring effect to specific detected objects in an image or video. This can be achieved using the YOLOv8 model capabilities to identify and manipulate objects within a given scene. ## Advantages of Object Blurring? diff --git a/docs/en/hub/index.md b/docs/en/hub/index.md index 69209539..9d18aa47 100644 --- a/docs/en/hub/index.md +++ b/docs/en/hub/index.md @@ -56,6 +56,6 @@ We hope that the resources here will help you get the most out of HUB. Please br - [**Models: Training and Exporting**](models.md). Train YOLOv5 and YOLOv8 models on your custom datasets and export them to various formats for deployment. - [**Integrations: Options**](integrations.md). Explore different integration options for your trained models, such as TensorFlow, ONNX, OpenVINO, CoreML, and PaddlePaddle. - [**Ultralytics HUB App**](app/index.md). Learn about the Ultralytics App for iOS and Android, which allows you to run models directly on your mobile device. - * [**iOS**](app/ios.md). Learn about YOLO CoreML models accelerated on Apple's Neural Engine on iPhones and iPads. - * [**Android**](app/android.md). Explore TFLite acceleration on mobile devices. + - [**iOS**](app/ios.md). Learn about YOLO CoreML models accelerated on Apple's Neural Engine on iPhones and iPads. + - [**Android**](app/android.md). Explore TFLite acceleration on mobile devices. - [**Inference API**](inference_api.md). Understand how to use the Inference API for running your trained models in the cloud to generate predictions. diff --git a/docs/en/integrations/comet.md b/docs/en/integrations/comet.md index eea84aee..95ada28d 100644 --- a/docs/en/integrations/comet.md +++ b/docs/en/integrations/comet.md @@ -56,7 +56,7 @@ import comet_ml comet_ml.init(project_name="comet-example-yolov8-coco128") ``` -*Note:* If you are using a Google Colab notebook, the code above will prompt you to enter your API key for initialization. +If you are using a Google Colab notebook, the code above will prompt you to enter your API key for initialization. ## Usage diff --git a/docs/en/models/fast-sam.md b/docs/en/models/fast-sam.md index d528d474..16d8453b 100644 --- a/docs/en/models/fast-sam.md +++ b/docs/en/models/fast-sam.md @@ -122,17 +122,20 @@ FastSAM is also available directly from the [https://github.com/CASIA-IVA-Lab/Fa ### Installation 1. Clone the FastSAM repository: + ```shell git clone https://github.com/CASIA-IVA-Lab/FastSAM.git ``` 2. Create and activate a Conda environment with Python 3.9: + ```shell conda create -n FastSAM python=3.9 conda activate FastSAM ``` 3. Navigate to the cloned repository and install the required packages: + ```shell cd FastSAM pip install -r requirements.txt @@ -149,25 +152,28 @@ FastSAM is also available directly from the [https://github.com/CASIA-IVA-Lab/Fa 2. Use FastSAM for inference. Example commands: - - Segment everything in an image: - ```shell - python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg - ``` + - Segment everything in an image: - - Segment specific objects using text prompt: - ```shell - python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --text_prompt "the yellow dog" - ``` + ```shell + python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg + ``` - - Segment objects within a bounding box (provide box coordinates in xywh format): - ```shell - python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --box_prompt "[570,200,230,400]" - ``` + - Segment specific objects using text prompt: - - Segment objects near specific points: - ```shell - python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --point_prompt "[[520,360],[620,300]]" --point_label "[1,0]" - ``` + ```shell + python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --text_prompt "the yellow dog" + ``` + + - Segment objects within a bounding box (provide box coordinates in xywh format): + + ```shell + python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --box_prompt "[570,200,230,400]" + ``` + + - Segment objects near specific points: + ```shell + python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --point_prompt "[[520,360],[620,300]]" --point_label "[1,0]" + ``` Additionally, you can try FastSAM through a [Colab demo](https://colab.research.google.com/drive/1oX14f6IneGGw612WgVlAiy91UHwFAvr9?usp=sharing) or on the [HuggingFace web demo](https://huggingface.co/spaces/An-619/FastSAM) for a visual experience. diff --git a/docs/en/models/rtdetr.md b/docs/en/models/rtdetr.md index d88030e7..782af2eb 100644 --- a/docs/en/models/rtdetr.md +++ b/docs/en/models/rtdetr.md @@ -89,4 +89,4 @@ If you use Baidu's RT-DETR in your research or development work, please cite the We would like to acknowledge Baidu and the [PaddlePaddle](https://github.com/PaddlePaddle/PaddleDetection) team for creating and maintaining this valuable resource for the computer vision community. Their contribution to the field with the development of the Vision Transformers-based real-time object detector, RT-DETR, is greatly appreciated. -*Keywords: RT-DETR, Transformer, ViT, Vision Transformers, Baidu RT-DETR, PaddlePaddle, Paddle Paddle RT-DETR, real-time object detection, Vision Transformers-based object detection, pre-trained PaddlePaddle RT-DETR models, Baidu's RT-DETR usage, Ultralytics Python API* +_Keywords: RT-DETR, Transformer, ViT, Vision Transformers, Baidu RT-DETR, PaddlePaddle, Paddle Paddle RT-DETR, real-time object detection, Vision Transformers-based object detection, pre-trained PaddlePaddle RT-DETR models, Baidu's RT-DETR usage, Ultralytics Python API_ diff --git a/docs/en/models/sam.md b/docs/en/models/sam.md index 5f5ebf72..7b9135b3 100644 --- a/docs/en/models/sam.md +++ b/docs/en/models/sam.md @@ -222,4 +222,4 @@ If you find SAM useful in your research or development work, please consider cit We would like to express our gratitude to Meta AI for creating and maintaining this valuable resource for the computer vision community. -*keywords: Segment Anything, Segment Anything Model, SAM, Meta SAM, image segmentation, promptable segmentation, zero-shot performance, SA-1B dataset, advanced architecture, auto-annotation, Ultralytics, pre-trained models, SAM base, SAM large, instance segmentation, computer vision, AI, artificial intelligence, machine learning, data annotation, segmentation masks, detection model, YOLO detection model, bibtex, Meta AI.* +_keywords: Segment Anything, Segment Anything Model, SAM, Meta SAM, image segmentation, promptable segmentation, zero-shot performance, SA-1B dataset, advanced architecture, auto-annotation, Ultralytics, pre-trained models, SAM base, SAM large, instance segmentation, computer vision, AI, artificial intelligence, machine learning, data annotation, segmentation masks, detection model, YOLO detection model, bibtex, Meta AI._ diff --git a/docs/en/models/yolo-nas.md b/docs/en/models/yolo-nas.md index d25a0f7f..cc041e71 100644 --- a/docs/en/models/yolo-nas.md +++ b/docs/en/models/yolo-nas.md @@ -117,4 +117,4 @@ If you employ YOLO-NAS in your research or development work, please cite SuperGr We express our gratitude to Deci AI's [SuperGradients](https://github.com/Deci-AI/super-gradients/) team for their efforts in creating and maintaining this valuable resource for the computer vision community. We believe YOLO-NAS, with its innovative architecture and superior object detection capabilities, will become a critical tool for developers and researchers alike. -*Keywords: YOLO-NAS, Deci AI, object detection, deep learning, neural architecture search, Ultralytics Python API, YOLO model, SuperGradients, pre-trained models, quantization-friendly basic block, advanced training schemes, post-training quantization, AutoNAC optimization, COCO, Objects365, Roboflow 100* +_Keywords: YOLO-NAS, Deci AI, object detection, deep learning, neural architecture search, Ultralytics Python API, YOLO model, SuperGradients, pre-trained models, quantization-friendly basic block, advanced training schemes, post-training quantization, AutoNAC optimization, COCO, Objects365, Roboflow 100_ diff --git a/docs/en/modes/predict.md b/docs/en/modes/predict.md index 6d5bf992..a2bb6158 100644 --- a/docs/en/modes/predict.md +++ b/docs/en/modes/predict.md @@ -761,7 +761,5 @@ Here's a Python script using OpenCV (`cv2`) and YOLOv8 to run inference on video This script will run predictions on each frame of the video, visualize the results, and display them in a window. The loop can be exited by pressing 'q'. [car spare parts]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/a0f802a8-0776-44cf-8f17-93974a4a28a1 - [football player detect]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/7d320e1f-fc57-4d7f-a691-78ee579c3442 - [human fall detect]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/86437c4a-3227-4eee-90ef-9efb697bdb43 diff --git a/docs/en/modes/track.md b/docs/en/modes/track.md index 23ccf961..f1f6dbdb 100644 --- a/docs/en/modes/track.md +++ b/docs/en/modes/track.md @@ -354,7 +354,5 @@ To initiate your contribution, please refer to our [Contributing Guide](https:// Together, let's enhance the tracking capabilities of the Ultralytics YOLO ecosystem 🙏! [fish track]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/a5146d0f-bfa8-4e0a-b7df-3c1446cd8142 - [people track]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/93bb4ee2-77a0-4e4e-8eb6-eb8f527f0527 - [vehicle track]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/ee6e6038-383b-4f21-ac29-b2a1c7d386ab diff --git a/docs/en/reference/nn/modules/utils.md b/docs/en/reference/nn/modules/utils.md index 25b0b1c2..22b813e4 100644 --- a/docs/en/reference/nn/modules/utils.md +++ b/docs/en/reference/nn/modules/utils.md @@ -19,7 +19,7 @@ keywords: Ultralytics, neural network, nn.modules.utils, bias_init_with_prob, in

-## ::: ultralytics.nn.modules.utils.linear_init_ +## ::: ultralytics.nn.modules.utils.linear_init

diff --git a/docs/en/tasks/obb.md b/docs/en/tasks/obb.md index 6d56a255..a06dc625 100644 --- a/docs/en/tasks/obb.md +++ b/docs/en/tasks/obb.md @@ -18,7 +18,6 @@ The output of an oriented object detector is a set of rotated bounding boxes tha YOLOv8 OBB models use the `-obb` suffix, i.e. `yolov8n-obb.pt` and are pretrained on [DOTAv1](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/DOTAv1.yaml). - | Ships Detection using OBB | Vehicle Detection using OBB | |:-------------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------:| | ![Ships Detection using OBB](https://github.com/RizwanMunawar/ultralytics/assets/62513924/5051d324-416f-4b58-ab62-f1bf9d7134b0) | ![Vehicle Detection using OBB](https://github.com/RizwanMunawar/ultralytics/assets/62513924/9a366262-910a-403b-a5e2-9c68b75700d3) | diff --git a/docs/en/usage/cli.md b/docs/en/usage/cli.md index 36c54cf6..98b2dbbd 100644 --- a/docs/en/usage/cli.md +++ b/docs/en/usage/cli.md @@ -1,6 +1,6 @@ --- comments: true -description: 'Learn how to use Ultralytics YOLO through Command Line: train models, run predictions and exports models to different formats easily using terminal commands.' +description: Learn how to use Ultralytics YOLO through Command Line: train models, run predictions and exports models to different formats easily using terminal commands. keywords: Ultralytics, YOLO, CLI, train, validation, prediction, command line interface, YOLO CLI, YOLO terminal, model training, prediction, exporting --- diff --git a/docs/en/yolov5/tutorials/architecture_description.md b/docs/en/yolov5/tutorials/architecture_description.md index 7dcd9a75..59a6e401 100644 --- a/docs/en/yolov5/tutorials/architecture_description.md +++ b/docs/en/yolov5/tutorials/architecture_description.md @@ -161,8 +161,8 @@ The objectness losses of the three prediction layers (`P3`, `P4`, `P5`) are weig The YOLOv5 architecture makes some important changes to the box prediction strategy compared to earlier versions of YOLO. In YOLOv2 and YOLOv3, the box coordinates were directly predicted using the activation of the last layer. -![b_x](https://latex.codecogs.com/svg.image?b_x=\sigma(t_x)+c_x) -![b_y](https://latex.codecogs.com/svg.image?b_y=\sigma(t_y)+c_y) +![b_x]() +![b_y]() ![b_w](https://latex.codecogs.com/svg.image?b_w=p_w\cdot&space;e^{t_w}) ![b_h](https://latex.codecogs.com/svg.image?b_h=p_h\cdot&space;e^{t_h}) @@ -172,10 +172,10 @@ However, in YOLOv5, the formula for predicting the box coordinates has been upda The revised formulas for calculating the predicted bounding box are as follows: -![bx](https://latex.codecogs.com/svg.image?b_x=(2\cdot\sigma(t_x)-0.5)+c_x) -![by](https://latex.codecogs.com/svg.image?b_y=(2\cdot\sigma(t_y)-0.5)+c_y) -![bw](https://latex.codecogs.com/svg.image?b_w=p_w\cdot(2\cdot\sigma(t_w))^2) -![bh](https://latex.codecogs.com/svg.image?b_h=p_h\cdot(2\cdot\sigma(t_h))^2) +![bx]() +![by]() +![bw]() +![bh]() Compare the center point offset before and after scaling. The center point offset range is adjusted from (0, 1) to (-0.5, 1.5). Therefore, offset can easily get 0 or 1. @@ -197,11 +197,11 @@ This process follows these steps: ![rh](https://latex.codecogs.com/svg.image?r_h=h_{gt}/h_{at}) -![rwmax](https://latex.codecogs.com/svg.image?r_w^{max}=max(r_w,1/r_w)) +![rwmax]() -![rhmax](https://latex.codecogs.com/svg.image?r_h^{max}=max(r_h,1/r_h)) +![rhmax]() -![rmax](https://latex.codecogs.com/svg.image?r^{max}=max(r_w^{max},r_h^{max})) +![rmax]() ![match](https://latex.codecogs.com/svg.image?r^{max}<{\rm&space;anchor_t}) diff --git a/docs/en/yolov5/tutorials/train_custom_data.md b/docs/en/yolov5/tutorials/train_custom_data.md index 6784b543..0ac35ad4 100644 --- a/docs/en/yolov5/tutorials/train_custom_data.md +++ b/docs/en/yolov5/tutorials/train_custom_data.md @@ -77,7 +77,7 @@ Export in `YOLOv5 Pytorch` format, then copy the snippet into your training scri ### 2.1 Create `dataset.yaml` -[COCO128](https://www.kaggle.com/ultralytics/coco128) is an example small tutorial dataset composed of the first 128 images in [COCO](https://cocodataset.org/) train2017. These same 128 images are used for both training and validation to verify our training pipeline is capable of overfitting. [data/coco128.yaml](https://github.com/ultralytics/yolov5/blob/master/data/coco128.yaml), shown below, is the dataset config file that defines 1) the dataset root directory `path` and relative paths to `train` / `val` / `test` image directories (or *.txt files with image paths) and 2) a class `names` dictionary: +[COCO128](https://www.kaggle.com/ultralytics/coco128) is an example small tutorial dataset composed of the first 128 images in [COCO](https://cocodataset.org/) train2017. These same 128 images are used for both training and validation to verify our training pipeline is capable of overfitting. [data/coco128.yaml](https://github.com/ultralytics/yolov5/blob/master/data/coco128.yaml), shown below, is the dataset config file that defines 1) the dataset root directory `path` and relative paths to `train` / `val` / `test` image directories (or `*.txt` files with image paths) and 2) a class `names` dictionary: ```yaml # 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, ..] @@ -114,7 +114,7 @@ The label file corresponding to the above image contains 2 persons (class `0`) a ### 2.3 Organize Directories -Organize your train and val images and labels according to the example below. YOLOv5 assumes `/coco128` is inside a `/datasets` directory **next to** the `/yolov5` directory. **YOLOv5 locates labels automatically for each image** by replacing the last instance of `/images/` in each image path with `/labels/`. For example: +Organize your train and val images and labels according to the example below. YOLOv5 assumes `/coco128` is inside a `/datasets` directory **next to** the `/yolov5` directory. **YOLOv5 locates labels automatically for each image** by replacing the last instance of `/images/` in each image path with `/labels/`. For example: ```bash ../datasets/coco128/images/im0.jpg # image diff --git a/docs/en/yolov5/tutorials/transfer_learning_with_frozen_layers.md b/docs/en/yolov5/tutorials/transfer_learning_with_frozen_layers.md index 3d919a60..8fb0da81 100644 --- a/docs/en/yolov5/tutorials/transfer_learning_with_frozen_layers.md +++ b/docs/en/yolov5/tutorials/transfer_learning_with_frozen_layers.md @@ -60,43 +60,42 @@ model.24.m.2.bias Looking at the model architecture we can see that the model backbone is layers 0-9: ```yaml -# YOLOv5 backbone +# YOLOv5 v6.0 backbone backbone: # [from, number, module, args] - [[-1, 1, Focus, [64, 3]], # 0-P1/2 - [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 - [-1, 3, BottleneckCSP, [128]], - [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 - [-1, 9, BottleneckCSP, [256]], - [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 - [-1, 9, BottleneckCSP, [512]], - [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 - [-1, 1, SPP, [1024, [5, 9, 13]]], - [-1, 3, BottleneckCSP, [1024, False]], # 9 - ] - -# YOLOv5 head + - [-1, 1, Conv, [64, 6, 2, 2]] # 0-P1/2 + - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4 + - [-1, 3, C3, [128]] + - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8 + - [-1, 6, C3, [256]] + - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16 + - [-1, 9, C3, [512]] + - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32 + - [-1, 3, C3, [1024]] + - [-1, 1, SPPF, [1024, 5]] # 9 + + +# YOLOv5 v6.0 head head: - [[-1, 1, Conv, [512, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 6], 1, Concat, [1]], # cat backbone P4 - [-1, 3, BottleneckCSP, [512, False]], # 13 - - [-1, 1, Conv, [256, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 4], 1, Concat, [1]], # cat backbone P3 - [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small) - - [-1, 1, Conv, [256, 3, 2]], - [[-1, 14], 1, Concat, [1]], # cat head P4 - [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium) - - [-1, 1, Conv, [512, 3, 2]], - [[-1, 10], 1, Concat, [1]], # cat head P5 - [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large) - - [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) - ] + - [-1, 1, Conv, [512, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 6], 1, Concat, [1]] # cat backbone P4 + - [-1, 3, C3, [512, False]] # 13 + + - [-1, 1, Conv, [256, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 4], 1, Concat, [1]] # cat backbone P3 + - [-1, 3, C3, [256, False]] # 17 (P3/8-small) + + - [-1, 1, Conv, [256, 3, 2]] + - [[-1, 14], 1, Concat, [1]] # cat head P4 + - [-1, 3, C3, [512, False]] # 20 (P4/16-medium) + + - [-1, 1, Conv, [512, 3, 2]] + - [[-1, 10], 1, Concat, [1]] # cat head P5 + - [-1, 3, C3, [1024, False]] # 23 (P5/32-large) + + - [[17, 20, 23], 1, Detect, [nc]] # Detect(P3, P4, P5) ``` so we can define the freeze list to contain all modules with 'model.0.' - 'model.9.' in their names: diff --git a/docs/es/datasets/index.md b/docs/es/datasets/index.md index 7f5ae453..06393fa2 100644 --- a/docs/es/datasets/index.md +++ b/docs/es/datasets/index.md @@ -80,7 +80,7 @@ Contribuir con un nuevo conjunto de datos implica varios pasos para garantizar q 2. **Annotar Imágenes**: Anota estas imágenes con cuadros delimitadores, segmentos o puntos clave, dependiendo de la tarea. -3. **Exportar Anotaciones**: Convierte estas anotaciones en el formato de archivo *.txt de YOLO que Ultralytics soporta. +3. **Exportar Anotaciones**: Convierte estas anotaciones en el formato de archivo `*.txt` de YOLO que Ultralytics soporta. 4. **Organizar Conjunto de Datos**: Organiza tu conjunto de datos en la estructura de carpetas correcta. Deberías tener directorios de nivel superior `train/` y `val/`, y dentro de cada uno, un subdirectorio `images/` y `labels/`. diff --git a/docs/fr/datasets/index.md b/docs/fr/datasets/index.md index fd2e87f5..21889ea0 100644 --- a/docs/fr/datasets/index.md +++ b/docs/fr/datasets/index.md @@ -80,7 +80,7 @@ Contribuer un nouvel ensemble de données implique plusieurs étapes pour s'assu 2. **Annoter des Images** : Annotez ces images avec des boîtes englobantes, des segments ou des points clés, en fonction de la tâche. -3. **Exporter des Annotations** : Convertissez ces annotations au format de fichier YOLO *.txt pris en charge par Ultralytics. +3. **Exporter des Annotations** : Convertissez ces annotations au format de fichier YOLO `*.txt` pris en charge par Ultralytics. 4. **Organiser l'Ensemble de Données** : Rangez votre ensemble de données dans la bonne structure de dossiers. Vous devriez avoir des répertoires de niveau supérieur `train/` et `val/`, et à l'intérieur de chacun, un sous-répertoire `images/` et `labels/`. diff --git a/docs/hi/datasets/index.md b/docs/hi/datasets/index.md index d1111347..95fb255c 100644 --- a/docs/hi/datasets/index.md +++ b/docs/hi/datasets/index.md @@ -83,7 +83,7 @@ Ultralytics कंप्यूटर विज्ञान कार्यों इन छवियों को बाउंडिंग बॉक्स, संरेखण या कीपॉइंट्स के साथ थस्क करें, टास्क के आधार पर। 3. **एनोटेशन निर्यात करें**: - इन एनोटेशन को योलो *.txt फ़ाइल प्रारूप में निर्यात करें, जिसे Ultralytics समर्थित करता है। + इन एनोटेशन को योलो `*.txt` फ़ाइल प्रारूप में निर्यात करें, जिसे Ultralytics समर्थित करता है। 4. **डेटासेट व्यवस्थित करें**: अपने डेटासेट को सही फ़ोल्डर संरचना में व्यवस्थित करें। आपके पास `train/` और `val/` शीर्ष-स्तर निर्देशिकाएँ होनी चाहिए, और हर एक में `images/` और `labels/` उप-निर्देशिका होनी चाहिए। diff --git a/docs/hi/models/yolov3.md b/docs/hi/models/yolov3.md index 4fc14a8c..bc9ca875 100644 --- a/docs/hi/models/yolov3.md +++ b/docs/hi/models/yolov3.md @@ -48,7 +48,7 @@ YOLOv3 श्रृंखला, इनमें YOLOv3, YOLOv3-Ultralytics औ === "Python" - `*.pt` प्रीट्रेन किए गए PyTorch मॉडल और कॉन्फ़िगरेशन *.yaml फ़ाइल Python में YOLO() क्लास कों यूज़ करके एक मॉडल इंस्टेंस तैयार करने के लिए पास कर सकते हैं: + `*.pt` प्रीट्रेन किए गए PyTorch मॉडल और कॉन्फ़िगरेशन `*.yaml` फ़ाइल Python में YOLO() क्लास कों यूज़ करके एक मॉडल इंस्टेंस तैयार करने के लिए पास कर सकते हैं: ```python from ultralytics import YOLO diff --git a/docs/ja/datasets/index.md b/docs/ja/datasets/index.md index 18a13217..786a8b95 100644 --- a/docs/ja/datasets/index.md +++ b/docs/ja/datasets/index.md @@ -80,7 +80,7 @@ Ultralyticsは、検出、インスタンスセグメンテーション、ポー 2. **画像をアノテート**します:これらの画像を、タスクに応じてバウンディングボックス、セグメント、またはキーポイントでアノテートします。 -3. **アノテーションをエクスポート**します:これらのアノテーションを、UltralyticsがサポートしているYOLO *.txtファイルフォーマットに変換します。 +3. **アノテーションをエクスポート**します:これらのアノテーションを、UltralyticsがサポートしているYOLO `*.txt`ファイルフォーマットに変換します。 4. **データセットを編成**します:データセットを正しいフォルダ構造に配置します。`train/` および `val/` のトップレベルディレクトリーを持ち、各ディレクトリー内に `images/` および `labels/` のサブディレクトリーがあるべきです。 diff --git a/docs/ko/datasets/index.md b/docs/ko/datasets/index.md index 720bdfae..d60a0605 100644 --- a/docs/ko/datasets/index.md +++ b/docs/ko/datasets/index.md @@ -80,7 +80,7 @@ Ultralytics는 탐지, 인스턴스 세분화, 자세 추정, 분류 및 다중 2. **이미지 주석 달기**: 이러한 이미지에 작업에 따라 바운딩 박스, 세그먼트 또는 키포인트로 주석을 답니다. -3. **주석 내보내기**: 이 주석들을 Ultralytics가 지원하는 YOLO *.txt 파일 형식으로 변환합니다. +3. **주석 내보내기**: 이 주석들을 Ultralytics가 지원하는 YOLO `*.txt` 파일 형식으로 변환합니다. 4. **데이터셋 구성**: 데이터셋을 올바른 폴더 구조로 배열합니다. 'train/'과 'val/' 상위 디렉토리를 갖고 있어야 하며, 각각 'images/' 및 'labels/' 하위 디렉토리가 있어야 합니다. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 08100b34..83407910 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/en/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'en/' # where to find the markdown files -site_dir: '../site/' # where to publish to +docs_dir: "en/" # where to find the markdown files +site_dir: "../site/" # where to publish to theme: name: material @@ -42,7 +42,7 @@ theme: icon: material/brightness-7 name: Switch to dark mode features: -# - announce.dismiss + # - announce.dismiss - content.action.edit - content.code.annotate - content.code.copy @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -351,8 +351,8 @@ nav: - Integrations: hub/integrations.md - Ultralytics HUB App: - hub/app/index.md - - 'iOS': hub/app/ios.md - - 'Android': hub/app/android.md + - iOS: hub/app/ios.md + - Android: hub/app/android.md - Inference API: hub/inference_api.md - Reference: diff --git a/docs/mkdocs_ar.yml b/docs/mkdocs_ar.yml index 1184b87a..5fb96d34 100644 --- a/docs/mkdocs_ar.yml +++ b/docs/mkdocs_ar.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/ar/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'ar/' # where to find the markdown files -site_dir: '../site/ar' # where to publish to +docs_dir: "ar/" # where to find the markdown files +site_dir: "../site/ar" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - الصفحة الرئيسية: diff --git a/docs/mkdocs_de.yml b/docs/mkdocs_de.yml index 1b8070d0..331292e4 100644 --- a/docs/mkdocs_de.yml +++ b/docs/mkdocs_de.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/de/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'de/' # where to find the markdown files -site_dir: '../site/de' # where to publish to +docs_dir: "de/" # where to find the markdown files +site_dir: "../site/de" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - Startseite: diff --git a/docs/mkdocs_es.yml b/docs/mkdocs_es.yml index 9578246e..9c12b98a 100644 --- a/docs/mkdocs_es.yml +++ b/docs/mkdocs_es.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/es/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'es/' # where to find the markdown files -site_dir: '../site/es' # where to publish to +docs_dir: "es/" # where to find the markdown files +site_dir: "../site/es" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - Inicio: diff --git a/docs/mkdocs_fr.yml b/docs/mkdocs_fr.yml index 35f31ac8..1aedce2e 100644 --- a/docs/mkdocs_fr.yml +++ b/docs/mkdocs_fr.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/fr/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'fr/' # where to find the markdown files -site_dir: '../site/fr' # where to publish to +docs_dir: "fr/" # where to find the markdown files +site_dir: "../site/fr" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - Accueil: diff --git a/docs/mkdocs_hi.yml b/docs/mkdocs_hi.yml index 7744a87a..7429847e 100644 --- a/docs/mkdocs_hi.yml +++ b/docs/mkdocs_hi.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/hi/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'hi/' # where to find the markdown files -site_dir: '../site/hi' # where to publish to +docs_dir: "hi/" # where to find the markdown files +site_dir: "../site/hi" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - होमपेज: diff --git a/docs/mkdocs_ja.yml b/docs/mkdocs_ja.yml index 3ebda30a..8bc75ce9 100644 --- a/docs/mkdocs_ja.yml +++ b/docs/mkdocs_ja.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/ja/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'ja/' # where to find the markdown files -site_dir: '../site/ja' # where to publish to +docs_dir: "ja/" # where to find the markdown files +site_dir: "../site/ja" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - ホーム: diff --git a/docs/mkdocs_ko.yml b/docs/mkdocs_ko.yml index a0521600..54a50a1b 100644 --- a/docs/mkdocs_ko.yml +++ b/docs/mkdocs_ko.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/ko/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'ko/' # where to find the markdown files -site_dir: '../site/ko' # where to publish to +docs_dir: "ko/" # where to find the markdown files +site_dir: "../site/ko" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - 홈: diff --git a/docs/mkdocs_pt.yml b/docs/mkdocs_pt.yml index f11cc79a..b20f3203 100644 --- a/docs/mkdocs_pt.yml +++ b/docs/mkdocs_pt.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/pt/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'pt/' # where to find the markdown files -site_dir: '../site/pt' # where to publish to +docs_dir: "pt/" # where to find the markdown files +site_dir: "../site/pt" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - Página Inicial: diff --git a/docs/mkdocs_ru.yml b/docs/mkdocs_ru.yml index f8b215dc..b771b9c2 100644 --- a/docs/mkdocs_ru.yml +++ b/docs/mkdocs_ru.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/ru/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'ru/' # where to find the markdown files -site_dir: '../site/ru' # where to publish to +docs_dir: "ru/" # where to find the markdown files +site_dir: "../site/ru" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - Главная: diff --git a/docs/mkdocs_zh.yml b/docs/mkdocs_zh.yml index 4904eed6..84b6c20c 100644 --- a/docs/mkdocs_zh.yml +++ b/docs/mkdocs_zh.yml @@ -8,8 +8,8 @@ repo_url: https://github.com/ultralytics/ultralytics edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs/zh/ repo_name: ultralytics/ultralytics remote_name: https://github.com/ultralytics/docs -docs_dir: 'zh/' # where to find the markdown files -site_dir: '../site/zh' # where to publish to +docs_dir: "zh/" # where to find the markdown files +site_dir: "../site/zh" # where to publish to theme: name: material @@ -61,7 +61,7 @@ theme: - navigation.instant.progress - navigation.indexes - navigation.sections - - content.tabs.link # all code tabs change simultaneously + - content.tabs.link # all code tabs change simultaneously # Customization copyright: © 2024 Ultralytics Inc. All rights reserved. @@ -151,7 +151,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: true - # Primary navigation --------------------------------------------------------------------------------------------------- nav: - 主页: diff --git a/docs/pt/datasets/index.md b/docs/pt/datasets/index.md index 8ff36d53..11d1884a 100644 --- a/docs/pt/datasets/index.md +++ b/docs/pt/datasets/index.md @@ -80,7 +80,7 @@ Contribuir com um novo conjunto de dados envolve várias etapas para garantir qu 2. **Anotar Imagens**: Anote essas imagens com caixas delimitadoras, segmentos ou pontos-chave, dependendo da tarefa. -3. **Exportar Anotações**: Converta essas anotações no formato de arquivo *.txt YOLO que a Ultralytics suporta. +3. **Exportar Anotações**: Converta essas anotações no formato de arquivo `*.txt` YOLO que a Ultralytics suporta. 4. **Organizar Conjunto de Dados**: Organize seu conjunto de dados na estrutura de pastas correta. Você deve ter diretórios de topo `train/` e `val/`, e dentro de cada um, um subdiretório `images/` e `labels/`. diff --git a/docs/ru/datasets/index.md b/docs/ru/datasets/index.md index 1ed255a8..0fdea455 100644 --- a/docs/ru/datasets/index.md +++ b/docs/ru/datasets/index.md @@ -80,7 +80,7 @@ Ultralytics предоставляет поддержку различных н 2. **Аннотация изображений**: Пометьте эти изображения ограничивающими рамками, сегментами или ключевыми точками в зависимости от задачи. -3. **Экспорт аннотаций**: Конвертируйте эти аннотации в формат файлов YOLO *.txt, который поддерживается Ultralytics. +3. **Экспорт аннотаций**: Конвертируйте эти аннотации в формат файлов YOLO `*.txt`, который поддерживается Ultralytics. 4. **Организация набора данных**: Распределите ваш набор данных в правильную структуру папок. У вас должны быть каталоги верхнего уровня `train/` и `val/`, и в каждом из них подкаталоги `images/` и `labels/`. diff --git a/docs/zh/datasets/index.md b/docs/zh/datasets/index.md index a3847008..f6b8cbe0 100644 --- a/docs/zh/datasets/index.md +++ b/docs/zh/datasets/index.md @@ -80,7 +80,7 @@ Ultralytics 支持多种数据集,方便开展计算机视觉任务,诸如 2. **注释图像**:根据任务对这些图像进行边界框、分段或关键点的标记。 -3. **导出注释**:将这些注释转换为 Ultralytics 支持的 YOLO *.txt 文件格式。 +3. **导出注释**:将这些注释转换为 Ultralytics 支持的 YOLO `*.txt` 文件格式。 4. **组织数据集**:按正确的文件夹结构排列您的数据集。您应该有 `train/ ` 和 `val/` 顶级目录,在每个目录内,有 `images/` 和 `labels/` 子目录。 diff --git a/ultralytics/cfg/models/v3/yolov3-spp.yaml b/ultralytics/cfg/models/v3/yolov3-spp.yaml index 406e019b..aec1bb20 100644 --- a/ultralytics/cfg/models/v3/yolov3-spp.yaml +++ b/ultralytics/cfg/models/v3/yolov3-spp.yaml @@ -9,40 +9,38 @@ width_multiple: 1.0 # layer channel multiple # darknet53 backbone backbone: # [from, number, module, args] - [[-1, 1, Conv, [32, 3, 1]], # 0 - [-1, 1, Conv, [64, 3, 2]], # 1-P1/2 - [-1, 1, Bottleneck, [64]], - [-1, 1, Conv, [128, 3, 2]], # 3-P2/4 - [-1, 2, Bottleneck, [128]], - [-1, 1, Conv, [256, 3, 2]], # 5-P3/8 - [-1, 8, Bottleneck, [256]], - [-1, 1, Conv, [512, 3, 2]], # 7-P4/16 - [-1, 8, Bottleneck, [512]], - [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32 - [-1, 4, Bottleneck, [1024]], # 10 - ] + - [-1, 1, Conv, [32, 3, 1]] # 0 + - [-1, 1, Conv, [64, 3, 2]] # 1-P1/2 + - [-1, 1, Bottleneck, [64]] + - [-1, 1, Conv, [128, 3, 2]] # 3-P2/4 + - [-1, 2, Bottleneck, [128]] + - [-1, 1, Conv, [256, 3, 2]] # 5-P3/8 + - [-1, 8, Bottleneck, [256]] + - [-1, 1, Conv, [512, 3, 2]] # 7-P4/16 + - [-1, 8, Bottleneck, [512]] + - [-1, 1, Conv, [1024, 3, 2]] # 9-P5/32 + - [-1, 4, Bottleneck, [1024]] # 10 # YOLOv3-SPP head head: - [[-1, 1, Bottleneck, [1024, False]], - [-1, 1, SPP, [512, [5, 9, 13]]], - [-1, 1, Conv, [1024, 3, 1]], - [-1, 1, Conv, [512, 1, 1]], - [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large) + - [-1, 1, Bottleneck, [1024, False]] + - [-1, 1, SPP, [512, [5, 9, 13]]] + - [-1, 1, Conv, [1024, 3, 1]] + - [-1, 1, Conv, [512, 1, 1]] + - [-1, 1, Conv, [1024, 3, 1]] # 15 (P5/32-large) - [-2, 1, Conv, [256, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 8], 1, Concat, [1]], # cat backbone P4 - [-1, 1, Bottleneck, [512, False]], - [-1, 1, Bottleneck, [512, False]], - [-1, 1, Conv, [256, 1, 1]], - [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium) + - [-2, 1, Conv, [256, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 8], 1, Concat, [1]] # cat backbone P4 + - [-1, 1, Bottleneck, [512, False]] + - [-1, 1, Bottleneck, [512, False]] + - [-1, 1, Conv, [256, 1, 1]] + - [-1, 1, Conv, [512, 3, 1]] # 22 (P4/16-medium) - [-2, 1, Conv, [128, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 6], 1, Concat, [1]], # cat backbone P3 - [-1, 1, Bottleneck, [256, False]], - [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small) + - [-2, 1, Conv, [128, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 6], 1, Concat, [1]] # cat backbone P3 + - [-1, 1, Bottleneck, [256, False]] + - [-1, 2, Bottleneck, [256, False]] # 27 (P3/8-small) - [[27, 22, 15], 1, Detect, [nc]], # Detect(P3, P4, P5) - ] + - [[27, 22, 15], 1, Detect, [nc]] # Detect(P3, P4, P5) diff --git a/ultralytics/cfg/models/v3/yolov3-tiny.yaml b/ultralytics/cfg/models/v3/yolov3-tiny.yaml index 69d8e42c..8330e492 100644 --- a/ultralytics/cfg/models/v3/yolov3-tiny.yaml +++ b/ultralytics/cfg/models/v3/yolov3-tiny.yaml @@ -9,31 +9,29 @@ width_multiple: 1.0 # layer channel multiple # YOLOv3-tiny backbone backbone: # [from, number, module, args] - [[-1, 1, Conv, [16, 3, 1]], # 0 - [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 1-P1/2 - [-1, 1, Conv, [32, 3, 1]], - [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 3-P2/4 - [-1, 1, Conv, [64, 3, 1]], - [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 5-P3/8 - [-1, 1, Conv, [128, 3, 1]], - [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 7-P4/16 - [-1, 1, Conv, [256, 3, 1]], - [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 9-P5/32 - [-1, 1, Conv, [512, 3, 1]], - [-1, 1, nn.ZeroPad2d, [[0, 1, 0, 1]]], # 11 - [-1, 1, nn.MaxPool2d, [2, 1, 0]], # 12 - ] + - [-1, 1, Conv, [16, 3, 1]] # 0 + - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 1-P1/2 + - [-1, 1, Conv, [32, 3, 1]] + - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 3-P2/4 + - [-1, 1, Conv, [64, 3, 1]] + - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 5-P3/8 + - [-1, 1, Conv, [128, 3, 1]] + - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 7-P4/16 + - [-1, 1, Conv, [256, 3, 1]] + - [-1, 1, nn.MaxPool2d, [2, 2, 0]] # 9-P5/32 + - [-1, 1, Conv, [512, 3, 1]] + - [-1, 1, nn.ZeroPad2d, [[0, 1, 0, 1]]] # 11 + - [-1, 1, nn.MaxPool2d, [2, 1, 0]] # 12 # YOLOv3-tiny head head: - [[-1, 1, Conv, [1024, 3, 1]], - [-1, 1, Conv, [256, 1, 1]], - [-1, 1, Conv, [512, 3, 1]], # 15 (P5/32-large) + - [-1, 1, Conv, [1024, 3, 1]] + - [-1, 1, Conv, [256, 1, 1]] + - [-1, 1, Conv, [512, 3, 1]] # 15 (P5/32-large) - [-2, 1, Conv, [128, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 8], 1, Concat, [1]], # cat backbone P4 - [-1, 1, Conv, [256, 3, 1]], # 19 (P4/16-medium) + - [-2, 1, Conv, [128, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 8], 1, Concat, [1]] # cat backbone P4 + - [-1, 1, Conv, [256, 3, 1]] # 19 (P4/16-medium) - [[19, 15], 1, Detect, [nc]], # Detect(P4, P5) - ] + - [[19, 15], 1, Detect, [nc]] # Detect(P4, P5) diff --git a/ultralytics/cfg/models/v3/yolov3.yaml b/ultralytics/cfg/models/v3/yolov3.yaml index 7cc0afa1..f03706fc 100644 --- a/ultralytics/cfg/models/v3/yolov3.yaml +++ b/ultralytics/cfg/models/v3/yolov3.yaml @@ -9,40 +9,38 @@ width_multiple: 1.0 # layer channel multiple # darknet53 backbone backbone: # [from, number, module, args] - [[-1, 1, Conv, [32, 3, 1]], # 0 - [-1, 1, Conv, [64, 3, 2]], # 1-P1/2 - [-1, 1, Bottleneck, [64]], - [-1, 1, Conv, [128, 3, 2]], # 3-P2/4 - [-1, 2, Bottleneck, [128]], - [-1, 1, Conv, [256, 3, 2]], # 5-P3/8 - [-1, 8, Bottleneck, [256]], - [-1, 1, Conv, [512, 3, 2]], # 7-P4/16 - [-1, 8, Bottleneck, [512]], - [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32 - [-1, 4, Bottleneck, [1024]], # 10 - ] + - [-1, 1, Conv, [32, 3, 1]] # 0 + - [-1, 1, Conv, [64, 3, 2]] # 1-P1/2 + - [-1, 1, Bottleneck, [64]] + - [-1, 1, Conv, [128, 3, 2]] # 3-P2/4 + - [-1, 2, Bottleneck, [128]] + - [-1, 1, Conv, [256, 3, 2]] # 5-P3/8 + - [-1, 8, Bottleneck, [256]] + - [-1, 1, Conv, [512, 3, 2]] # 7-P4/16 + - [-1, 8, Bottleneck, [512]] + - [-1, 1, Conv, [1024, 3, 2]] # 9-P5/32 + - [-1, 4, Bottleneck, [1024]] # 10 # YOLOv3 head head: - [[-1, 1, Bottleneck, [1024, False]], - [-1, 1, Conv, [512, 1, 1]], - [-1, 1, Conv, [1024, 3, 1]], - [-1, 1, Conv, [512, 1, 1]], - [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large) + - [-1, 1, Bottleneck, [1024, False]] + - [-1, 1, Conv, [512, 1, 1]] + - [-1, 1, Conv, [1024, 3, 1]] + - [-1, 1, Conv, [512, 1, 1]] + - [-1, 1, Conv, [1024, 3, 1]] # 15 (P5/32-large) - [-2, 1, Conv, [256, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 8], 1, Concat, [1]], # cat backbone P4 - [-1, 1, Bottleneck, [512, False]], - [-1, 1, Bottleneck, [512, False]], - [-1, 1, Conv, [256, 1, 1]], - [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium) + - [-2, 1, Conv, [256, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 8], 1, Concat, [1]] # cat backbone P4 + - [-1, 1, Bottleneck, [512, False]] + - [-1, 1, Bottleneck, [512, False]] + - [-1, 1, Conv, [256, 1, 1]] + - [-1, 1, Conv, [512, 3, 1]] # 22 (P4/16-medium) - [-2, 1, Conv, [128, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 6], 1, Concat, [1]], # cat backbone P3 - [-1, 1, Bottleneck, [256, False]], - [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small) + - [-2, 1, Conv, [128, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 6], 1, Concat, [1]] # cat backbone P3 + - [-1, 1, Bottleneck, [256, False]] + - [-1, 2, Bottleneck, [256, False]] # 27 (P3/8-small) - [[27, 22, 15], 1, Detect, [nc]], # Detect(P3, P4, P5) - ] + - [[27, 22, 15], 1, Detect, [nc]] # Detect(P3, P4, P5) diff --git a/ultralytics/cfg/models/v5/yolov5-p6.yaml b/ultralytics/cfg/models/v5/yolov5-p6.yaml index d4683771..13df4586 100644 --- a/ultralytics/cfg/models/v5/yolov5-p6.yaml +++ b/ultralytics/cfg/models/v5/yolov5-p6.yaml @@ -14,48 +14,46 @@ scales: # model compound scaling constants, i.e. 'model=yolov5n-p6.yaml' will ca # YOLOv5 v6.0 backbone backbone: # [from, number, module, args] - [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 - [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 - [-1, 3, C3, [128]], - [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 - [-1, 6, C3, [256]], - [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 - [-1, 9, C3, [512]], - [-1, 1, Conv, [768, 3, 2]], # 7-P5/32 - [-1, 3, C3, [768]], - [-1, 1, Conv, [1024, 3, 2]], # 9-P6/64 - [-1, 3, C3, [1024]], - [-1, 1, SPPF, [1024, 5]], # 11 - ] + - [-1, 1, Conv, [64, 6, 2, 2]] # 0-P1/2 + - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4 + - [-1, 3, C3, [128]] + - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8 + - [-1, 6, C3, [256]] + - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16 + - [-1, 9, C3, [512]] + - [-1, 1, Conv, [768, 3, 2]] # 7-P5/32 + - [-1, 3, C3, [768]] + - [-1, 1, Conv, [1024, 3, 2]] # 9-P6/64 + - [-1, 3, C3, [1024]] + - [-1, 1, SPPF, [1024, 5]] # 11 # YOLOv5 v6.0 head head: - [[-1, 1, Conv, [768, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 8], 1, Concat, [1]], # cat backbone P5 - [-1, 3, C3, [768, False]], # 15 - - [-1, 1, Conv, [512, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 6], 1, Concat, [1]], # cat backbone P4 - [-1, 3, C3, [512, False]], # 19 - - [-1, 1, Conv, [256, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 4], 1, Concat, [1]], # cat backbone P3 - [-1, 3, C3, [256, False]], # 23 (P3/8-small) - - [-1, 1, Conv, [256, 3, 2]], - [[-1, 20], 1, Concat, [1]], # cat head P4 - [-1, 3, C3, [512, False]], # 26 (P4/16-medium) - - [-1, 1, Conv, [512, 3, 2]], - [[-1, 16], 1, Concat, [1]], # cat head P5 - [-1, 3, C3, [768, False]], # 29 (P5/32-large) - - [-1, 1, Conv, [768, 3, 2]], - [[-1, 12], 1, Concat, [1]], # cat head P6 - [-1, 3, C3, [1024, False]], # 32 (P6/64-xlarge) - - [[23, 26, 29, 32], 1, Detect, [nc]], # Detect(P3, P4, P5, P6) - ] + - [-1, 1, Conv, [768, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 8], 1, Concat, [1]] # cat backbone P5 + - [-1, 3, C3, [768, False]] # 15 + + - [-1, 1, Conv, [512, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 6], 1, Concat, [1]] # cat backbone P4 + - [-1, 3, C3, [512, False]] # 19 + + - [-1, 1, Conv, [256, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 4], 1, Concat, [1]] # cat backbone P3 + - [-1, 3, C3, [256, False]] # 23 (P3/8-small) + + - [-1, 1, Conv, [256, 3, 2]] + - [[-1, 20], 1, Concat, [1]] # cat head P4 + - [-1, 3, C3, [512, False]] # 26 (P4/16-medium) + + - [-1, 1, Conv, [512, 3, 2]] + - [[-1, 16], 1, Concat, [1]] # cat head P5 + - [-1, 3, C3, [768, False]] # 29 (P5/32-large) + + - [-1, 1, Conv, [768, 3, 2]] + - [[-1, 12], 1, Concat, [1]] # cat head P6 + - [-1, 3, C3, [1024, False]] # 32 (P6/64-xlarge) + + - [[23, 26, 29, 32], 1, Detect, [nc]] # Detect(P3, P4, P5, P6) diff --git a/ultralytics/cfg/models/v5/yolov5.yaml b/ultralytics/cfg/models/v5/yolov5.yaml index 4a3fcedf..f024065e 100644 --- a/ultralytics/cfg/models/v5/yolov5.yaml +++ b/ultralytics/cfg/models/v5/yolov5.yaml @@ -14,37 +14,36 @@ scales: # model compound scaling constants, i.e. 'model=yolov5n.yaml' will call # YOLOv5 v6.0 backbone backbone: # [from, number, module, args] - [[-1, 1, Conv, [64, 6, 2, 2]], # 0-P1/2 - [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 - [-1, 3, C3, [128]], - [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 - [-1, 6, C3, [256]], - [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 - [-1, 9, C3, [512]], - [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 - [-1, 3, C3, [1024]], - [-1, 1, SPPF, [1024, 5]], # 9 - ] + - [-1, 1, Conv, [64, 6, 2, 2]] # 0-P1/2 + - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4 + - [-1, 3, C3, [128]] + - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8 + - [-1, 6, C3, [256]] + - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16 + - [-1, 9, C3, [512]] + - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32 + - [-1, 3, C3, [1024]] + - [-1, 1, SPPF, [1024, 5]] # 9 + # YOLOv5 v6.0 head head: - [[-1, 1, Conv, [512, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 6], 1, Concat, [1]], # cat backbone P4 - [-1, 3, C3, [512, False]], # 13 - - [-1, 1, Conv, [256, 1, 1]], - [-1, 1, nn.Upsample, [None, 2, 'nearest']], - [[-1, 4], 1, Concat, [1]], # cat backbone P3 - [-1, 3, C3, [256, False]], # 17 (P3/8-small) - - [-1, 1, Conv, [256, 3, 2]], - [[-1, 14], 1, Concat, [1]], # cat head P4 - [-1, 3, C3, [512, False]], # 20 (P4/16-medium) - - [-1, 1, Conv, [512, 3, 2]], - [[-1, 10], 1, Concat, [1]], # cat head P5 - [-1, 3, C3, [1024, False]], # 23 (P5/32-large) - - [[17, 20, 23], 1, Detect, [nc]], # Detect(P3, P4, P5) - ] + - [-1, 1, Conv, [512, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 6], 1, Concat, [1]] # cat backbone P4 + - [-1, 3, C3, [512, False]] # 13 + + - [-1, 1, Conv, [256, 1, 1]] + - [-1, 1, nn.Upsample, [None, 2, 'nearest']] + - [[-1, 4], 1, Concat, [1]] # cat backbone P3 + - [-1, 3, C3, [256, False]] # 17 (P3/8-small) + + - [-1, 1, Conv, [256, 3, 2]] + - [[-1, 14], 1, Concat, [1]] # cat head P4 + - [-1, 3, C3, [512, False]] # 20 (P4/16-medium) + + - [-1, 1, Conv, [512, 3, 2]] + - [[-1, 10], 1, Concat, [1]] # cat head P5 + - [-1, 3, C3, [1024, False]] # 23 (P5/32-large) + + - [[17, 20, 23], 1, Detect, [nc]] # Detect(P3, P4, P5) diff --git a/ultralytics/nn/modules/head.py b/ultralytics/nn/modules/head.py index 131c840e..f35f19df 100644 --- a/ultralytics/nn/modules/head.py +++ b/ultralytics/nn/modules/head.py @@ -11,7 +11,7 @@ from ultralytics.utils.tal import TORCH_1_10, dist2bbox, dist2rbox, make_anchors from .block import DFL, Proto from .conv import Conv from .transformer import MLP, DeformableTransformerDecoder, DeformableTransformerDecoderLayer -from .utils import bias_init_with_prob, linear_init_ +from .utils import bias_init_with_prob, linear_init __all__ = "Detect", "Segment", "Pose", "Classify", "OBB", "RTDETRDecoder" @@ -417,18 +417,18 @@ class RTDETRDecoder(nn.Module): """Initializes or resets the parameters of the model's various components with predefined weights and biases.""" # Class and bbox head init bias_cls = bias_init_with_prob(0.01) / 80 * self.nc - # NOTE: the weight initialization in `linear_init_` would cause NaN when training with custom datasets. - # linear_init_(self.enc_score_head) + # NOTE: the weight initialization in `linear_init` would cause NaN when training with custom datasets. + # linear_init(self.enc_score_head) constant_(self.enc_score_head.bias, bias_cls) constant_(self.enc_bbox_head.layers[-1].weight, 0.0) constant_(self.enc_bbox_head.layers[-1].bias, 0.0) for cls_, reg_ in zip(self.dec_score_head, self.dec_bbox_head): - # linear_init_(cls_) + # linear_init(cls_) constant_(cls_.bias, bias_cls) constant_(reg_.layers[-1].weight, 0.0) constant_(reg_.layers[-1].bias, 0.0) - linear_init_(self.enc_output[0]) + linear_init(self.enc_output[0]) xavier_uniform_(self.enc_output[0].weight) if self.learnt_init_query: xavier_uniform_(self.tgt_embed.weight) diff --git a/ultralytics/nn/modules/utils.py b/ultralytics/nn/modules/utils.py index 2cb615a6..75a050df 100644 --- a/ultralytics/nn/modules/utils.py +++ b/ultralytics/nn/modules/utils.py @@ -23,7 +23,7 @@ def bias_init_with_prob(prior_prob=0.01): return float(-np.log((1 - prior_prob) / prior_prob)) # return bias_init -def linear_init_(module): +def linear_init(module): """Initialize the weights and biases of a linear module.""" bound = 1 / math.sqrt(module.weight.shape[0]) uniform_(module.weight, -bound, bound)