Update YOLOv3 and YOLOv5 YAMLs (#7574)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/7576/head
Glenn Jocher 11 months ago committed by GitHub
parent 596c068b18
commit d762496989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/README.md
  2. 2
      docs/ar/datasets/index.md
  3. 2
      docs/de/datasets/index.md
  4. 2
      docs/en/datasets/detect/argoverse.md
  5. 2
      docs/en/datasets/detect/index.md
  6. 3
      docs/en/datasets/detect/voc.md
  7. 2
      docs/en/datasets/index.md
  8. 30
      docs/en/guides/isolating-segmentation-objects.md
  9. 2
      docs/en/guides/model-deployment-options.md
  10. 2
      docs/en/guides/object-blurring.md
  11. 4
      docs/en/hub/index.md
  12. 2
      docs/en/integrations/comet.md
  13. 38
      docs/en/models/fast-sam.md
  14. 2
      docs/en/models/rtdetr.md
  15. 2
      docs/en/models/sam.md
  16. 2
      docs/en/models/yolo-nas.md
  17. 2
      docs/en/modes/predict.md
  18. 2
      docs/en/modes/track.md
  19. 2
      docs/en/reference/nn/modules/utils.md
  20. 1
      docs/en/tasks/obb.md
  21. 2
      docs/en/usage/cli.md
  22. 18
      docs/en/yolov5/tutorials/architecture_description.md
  23. 4
      docs/en/yolov5/tutorials/train_custom_data.md
  24. 67
      docs/en/yolov5/tutorials/transfer_learning_with_frozen_layers.md
  25. 2
      docs/es/datasets/index.md
  26. 2
      docs/fr/datasets/index.md
  27. 2
      docs/hi/datasets/index.md
  28. 2
      docs/hi/models/yolov3.md
  29. 2
      docs/ja/datasets/index.md
  30. 2
      docs/ko/datasets/index.md
  31. 12
      docs/mkdocs.yml
  32. 7
      docs/mkdocs_ar.yml
  33. 7
      docs/mkdocs_de.yml
  34. 7
      docs/mkdocs_es.yml
  35. 7
      docs/mkdocs_fr.yml
  36. 7
      docs/mkdocs_hi.yml
  37. 7
      docs/mkdocs_ja.yml
  38. 7
      docs/mkdocs_ko.yml
  39. 7
      docs/mkdocs_pt.yml
  40. 7
      docs/mkdocs_ru.yml
  41. 7
      docs/mkdocs_zh.yml
  42. 2
      docs/pt/datasets/index.md
  43. 2
      docs/ru/datasets/index.md
  44. 2
      docs/zh/datasets/index.md
  45. 60
      ultralytics/cfg/models/v3/yolov3-spp.yaml
  46. 44
      ultralytics/cfg/models/v3/yolov3-tiny.yaml
  47. 60
      ultralytics/cfg/models/v3/yolov3.yaml
  48. 82
      ultralytics/cfg/models/v5/yolov5-p6.yaml
  49. 61
      ultralytics/cfg/models/v5/yolov5.yaml
  50. 10
      ultralytics/nn/modules/head.py
  51. 2
      ultralytics/nn/modules/utils.py

@ -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"

@ -80,7 +80,7 @@ keywords: الرؤية الحاسوبية ، مجموعات البيانات ،
2. **وضع تعليقات على الصور**: قم بإضافة تعليقات على هذه الصور مع صناديق الحدود أو الشرائح أو النقاط التي تعتمد على المهمة.
3. **تصدير التعليقات**: قم بتحويل هذه التعليقات إلى تنسيق الملف *.txt *.txt المدعوم من Ultralytics.
3. **تصدير التعليقات**: قم بتحويل هذه التعليقات إلى تنسيق الملف `*.txt` `*.txt` المدعوم من Ultralytics.
4. **تنظيم مجموعة البيانات**: قم بترتيب مجموعة البيانات الخاصة بك في البنية المجلدات الصحيحة. يجب أن تحتوي على مجلدات أعلى المستوى `train/` و `val/` ، وداخل كل منهما ، مجلدات فرعية للـ `images/` و `labels/`.

@ -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/`.

@ -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

@ -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, ..]

@ -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
```

@ -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.

@ -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
<summary> Expand to understand what is happening when defining the <code>contour</code> variable.</summary>
<p>
- `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
</details>
<p></p>
---
***
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. <u>What to do next is entirely left to you as the developer.</u> A basic example of one possible next step (saving the image to file for future use) is shown.
6. <u>What to do next is entirely left to you as the developer.</u> 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

@ -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.

@ -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?

@ -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.

@ -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

@ -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.

@ -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_

@ -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._

@ -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_

@ -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

@ -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

@ -19,7 +19,7 @@ keywords: Ultralytics, neural network, nn.modules.utils, bias_init_with_prob, in
<br><br>
## ::: ultralytics.nn.modules.utils.linear_init_
## ::: ultralytics.nn.modules.utils.linear_init
<br><br>

@ -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) |

@ -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
---

@ -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](<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_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](<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>)
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](<https://latex.codecogs.com/svg.image?r_w^{max}=max(r_w,1/r_w)>)
![rhmax](https://latex.codecogs.com/svg.image?r_h^{max}=max(r_h,1/r_h))
![rhmax](<https://latex.codecogs.com/svg.image?r_h^{max}=max(r_h,1/r_h)>)
![rmax](https://latex.codecogs.com/svg.image?r^{max}=max(r_w^{max},r_h^{max}))
![rmax](<https://latex.codecogs.com/svg.image?r^{max}=max(r_w^{max},r_h^{max})>)
![match](https://latex.codecogs.com/svg.image?r^{max}<{\rm&space;anchor_t})

@ -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

@ -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:

@ -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/`.

@ -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/`.

@ -83,7 +83,7 @@ Ultralytics कटर विन क
इन छवििग बस, सखण यस कथ थसक कर, टक क आधर पर।
3. **एनशन नित कर**:
इन एनशन क *.txt फइल पप मित कर, जि Ultralytics समरित करत
इन एनशन क `*.txt`इल पप मित कर, जि Ultralytics समरित करत
4. **डट वयवसित कर**:
अपनट क सहडर सरचनयवसित कर। आपक`train/` और `val/`ष-सतर निििए, और हर एक म `images/` और `labels/` उप-निििए।

@ -48,7 +48,7 @@ YOLOv3 शखल, इनम YOLOv3, YOLOv3-Ultralytics औ
=== "Python"
`*.pt`न किए गए PyTorch मडल और किगरशन *.yaml फइल Python म YOLO() कस क करक एक मडल इस तर करनिए पस कर सकत:
`*.pt`न किए गए PyTorch मडल और किगरशन `*.yaml`इल Python म YOLO() कस क करक एक मडल इस तर करनिए पस कर सकत:
```python
from ultralytics import YOLO

@ -80,7 +80,7 @@ Ultralyticsは、検出、インスタンスセグメンテーション、ポー
2. **画像をアノテート**します:これらの画像を、タスクに応じてバウンディングボックス、セグメント、またはキーポイントでアノテートします。
3. **アノテーションをエクスポート**します:これらのアノテーションを、UltralyticsがサポートしているYOLO *.txtファイルフォーマットに変換します。
3. **アノテーションをエクスポート**します:これらのアノテーションを、UltralyticsがサポートしているYOLO `*.txt`ファイルフォーマットに変換します。
4. **データセットを編成**します:データセットを正しいフォルダ構造に配置します。`train/` および `val/` のトップレベルディレクトリーを持ち、各ディレクトリー内に `images/` および `labels/` のサブディレクトリーがあるべきです。

@ -80,7 +80,7 @@ Ultralytics는 탐지, 인스턴스 세분화, 자세 추정, 분류 및 다중
2. **이미지 주석 달기**: 이러한 이미지에 작업에 따라 바운딩 박스, 세그먼트 또는 키포인트로 주석을 답니다.
3. **주석 내보내기**: 이 주석들을 Ultralytics가 지원하는 YOLO *.txt 파일 형식으로 변환합니다.
3. **주석 내보내기**: 이 주석들을 Ultralytics가 지원하는 YOLO `*.txt` 파일 형식으로 변환합니다.
4. **데이터셋 구성**: 데이터셋을 올바른 폴더 구조로 배열합니다. 'train/'과 'val/' 상위 디렉토리를 갖고 있어야 하며, 각각 'images/' 및 'labels/' 하위 디렉토리가 있어야 합니다.

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> 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:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- الصفحة الرئيسية:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- Startseite:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- Inicio:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- Accueil:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- मपज:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- ホーム:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- 홈:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- Página Inicial:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- Главная:

@ -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: <a href="https://ultralytics.com" target="_blank">© 2024 Ultralytics Inc.</a> All rights reserved.
@ -151,7 +151,6 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
# Primary navigation ---------------------------------------------------------------------------------------------------
nav:
- 主页:

@ -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/`.

@ -80,7 +80,7 @@ Ultralytics предоставляет поддержку различных н
2. **Аннотация изображений**: Пометьте эти изображения ограничивающими рамками, сегментами или ключевыми точками в зависимости от задачи.
3. **Экспорт аннотаций**: Конвертируйте эти аннотации в формат файлов YOLO *.txt, который поддерживается Ultralytics.
3. **Экспорт аннотаций**: Конвертируйте эти аннотации в формат файлов YOLO `*.txt`, который поддерживается Ultralytics.
4. **Организация набора данных**: Распределите ваш набор данных в правильную структуру папок. У вас должны быть каталоги верхнего уровня `train/` и `val/`, и в каждом из них подкаталоги `images/` и `labels/`.

@ -80,7 +80,7 @@ Ultralytics 支持多种数据集,方便开展计算机视觉任务,诸如
2. **注释图像**:根据任务对这些图像进行边界框、分段或关键点的标记。
3. **导出注释**:将这些注释转换为 Ultralytics 支持的 YOLO *.txt 文件格式。
3. **导出注释**:将这些注释转换为 Ultralytics 支持的 YOLO `*.txt` 文件格式。
4. **组织数据集**:按正确的文件夹结构排列您的数据集。您应该有 `train/ ``val/` 顶级目录,在每个目录内,有 `images/``labels/` 子目录。

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

Loading…
Cancel
Save