YOLO11 Tasks, Modes, Usage, Macros and Solutions Updates (#16593)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
3093fc9ec2
commit
51e93d6111
31 changed files with 541 additions and 541 deletions
|
|
@ -26,16 +26,16 @@ The output of an instance segmentation model is a set of masks or contours that
|
|||
|
||||
!!! tip
|
||||
|
||||
YOLOv8 Segment models use the `-seg` suffix, i.e. `yolov8n-seg.pt` and are pretrained on [COCO](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml).
|
||||
YOLO11 Segment models use the `-seg` suffix, i.e. `yolo11n-seg.pt` and are pretrained on [COCO](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml).
|
||||
|
||||
## [Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models/v8)
|
||||
## [Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models/11)
|
||||
|
||||
YOLOv8 pretrained Segment models are shown here. Detect, Segment and Pose models are pretrained on the [COCO](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml) dataset, while Classify models are pretrained on the [ImageNet](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/ImageNet.yaml) dataset.
|
||||
YOLO11 pretrained Segment models are shown here. Detect, Segment and Pose models are pretrained on the [COCO](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml) dataset, while Classify models are pretrained on the [ImageNet](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/ImageNet.yaml) dataset.
|
||||
|
||||
[Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases) on first use.
|
||||
|
||||
| Model | size<br><sup>(pixels) | mAP<sup>box<br>50-95 | mAP<sup>mask<br>50-95 | Speed<br><sup>CPU ONNX<br>(ms) | Speed<br><sup>T4 TensorRT10<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
|----------------------------------------------------------------------------------------------|-----------------------|----------------------|-----------------------|--------------------------------|-------------------------------------|--------------------|-------------------|
|
||||
| -------------------------------------------------------------------------------------------- | --------------------- | -------------------- | --------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLO11n-seg](https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n-seg.pt) | 640 | 38.9 | 32.0 | 65.9 ± 1.1 | 1.8 ± 0.0 | 2.9 | 10.4 |
|
||||
| [YOLO11s-seg](https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11s-seg.pt) | 640 | 46.6 | 37.8 | 117.6 ± 4.9 | 2.9 ± 0.0 | 10.1 | 35.5 |
|
||||
| [YOLO11m-seg](https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11m-seg.pt) | 640 | 51.5 | 41.5 | 281.6 ± 1.2 | 6.3 ± 0.1 | 22.4 | 123.3 |
|
||||
|
|
@ -47,7 +47,7 @@ YOLOv8 pretrained Segment models are shown here. Detect, Segment and Pose models
|
|||
|
||||
## Train
|
||||
|
||||
Train YOLOv8n-seg on the COCO128-seg dataset for 100 [epochs](https://www.ultralytics.com/glossary/epoch) at image size 640. For a full list of available arguments see the [Configuration](../usage/cfg.md) page.
|
||||
Train YOLO11n-seg on the COCO128-seg dataset for 100 [epochs](https://www.ultralytics.com/glossary/epoch) at image size 640. For a full list of available arguments see the [Configuration](../usage/cfg.md) page.
|
||||
|
||||
!!! example
|
||||
|
||||
|
|
@ -57,9 +57,9 @@ Train YOLOv8n-seg on the COCO128-seg dataset for 100 [epochs](https://www.ultral
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolov8n-seg.yaml") # build a new model from YAML
|
||||
model = YOLO("yolov8n-seg.pt") # load a pretrained model (recommended for training)
|
||||
model = YOLO("yolov8n-seg.yaml").load("yolov8n.pt") # build from YAML and transfer weights
|
||||
model = YOLO("yolo11n-seg.yaml") # build a new model from YAML
|
||||
model = YOLO("yolo11n-seg.pt") # load a pretrained model (recommended for training)
|
||||
model = YOLO("yolo11n-seg.yaml").load("yolo11n.pt") # build from YAML and transfer weights
|
||||
|
||||
# Train the model
|
||||
results = model.train(data="coco8-seg.yaml", epochs=100, imgsz=640)
|
||||
|
|
@ -69,13 +69,13 @@ Train YOLOv8n-seg on the COCO128-seg dataset for 100 [epochs](https://www.ultral
|
|||
|
||||
```bash
|
||||
# Build a new model from YAML and start training from scratch
|
||||
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.yaml epochs=100 imgsz=640
|
||||
yolo segment train data=coco8-seg.yaml model=yolo11n-seg.yaml epochs=100 imgsz=640
|
||||
|
||||
# Start training from a pretrained *.pt model
|
||||
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.pt epochs=100 imgsz=640
|
||||
yolo segment train data=coco8-seg.yaml model=yolo11n-seg.pt epochs=100 imgsz=640
|
||||
|
||||
# Build a new model from YAML, transfer pretrained weights to it and start training
|
||||
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.yaml pretrained=yolov8n-seg.pt epochs=100 imgsz=640
|
||||
yolo segment train data=coco8-seg.yaml model=yolo11n-seg.yaml pretrained=yolo11n-seg.pt epochs=100 imgsz=640
|
||||
```
|
||||
|
||||
### Dataset format
|
||||
|
|
@ -84,7 +84,7 @@ YOLO segmentation dataset format can be found in detail in the [Dataset Guide](.
|
|||
|
||||
## Val
|
||||
|
||||
Validate trained YOLOv8n-seg model [accuracy](https://www.ultralytics.com/glossary/accuracy) on the COCO128-seg dataset. No arguments are needed as the `model` retains its training `data` and arguments as model attributes.
|
||||
Validate trained YOLO11n-seg model [accuracy](https://www.ultralytics.com/glossary/accuracy) on the COCO128-seg dataset. No arguments are needed as the `model` retains its training `data` and arguments as model attributes.
|
||||
|
||||
!!! example
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ Validate trained YOLOv8n-seg model [accuracy](https://www.ultralytics.com/glossa
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolov8n-seg.pt") # load an official model
|
||||
model = YOLO("yolo11n-seg.pt") # load an official model
|
||||
model = YOLO("path/to/best.pt") # load a custom model
|
||||
|
||||
# Validate the model
|
||||
|
|
@ -112,13 +112,13 @@ Validate trained YOLOv8n-seg model [accuracy](https://www.ultralytics.com/glossa
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo segment val model=yolov8n-seg.pt # val official model
|
||||
yolo segment val model=yolo11n-seg.pt # val official model
|
||||
yolo segment val model=path/to/best.pt # val custom model
|
||||
```
|
||||
|
||||
## Predict
|
||||
|
||||
Use a trained YOLOv8n-seg model to run predictions on images.
|
||||
Use a trained YOLO11n-seg model to run predictions on images.
|
||||
|
||||
!!! example
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ Use a trained YOLOv8n-seg model to run predictions on images.
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolov8n-seg.pt") # load an official model
|
||||
model = YOLO("yolo11n-seg.pt") # load an official model
|
||||
model = YOLO("path/to/best.pt") # load a custom model
|
||||
|
||||
# Predict with the model
|
||||
|
|
@ -138,7 +138,7 @@ Use a trained YOLOv8n-seg model to run predictions on images.
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo segment predict model=yolov8n-seg.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
|
||||
yolo segment predict model=yolo11n-seg.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
|
||||
yolo segment predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
|
||||
```
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ See full `predict` mode details in the [Predict](../modes/predict.md) page.
|
|||
|
||||
## Export
|
||||
|
||||
Export a YOLOv8n-seg model to a different format like ONNX, CoreML, etc.
|
||||
Export a YOLO11n-seg model to a different format like ONNX, CoreML, etc.
|
||||
|
||||
!!! example
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ Export a YOLOv8n-seg model to a different format like ONNX, CoreML, etc.
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolov8n-seg.pt") # load an official model
|
||||
model = YOLO("yolo11n-seg.pt") # load an official model
|
||||
model = YOLO("path/to/best.pt") # load a custom trained model
|
||||
|
||||
# Export the model
|
||||
|
|
@ -166,11 +166,11 @@ Export a YOLOv8n-seg model to a different format like ONNX, CoreML, etc.
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo export model=yolov8n-seg.pt format=onnx # export official model
|
||||
yolo export model=yolo11n-seg.pt format=onnx # export official model
|
||||
yolo export model=path/to/best.pt format=onnx # export custom trained model
|
||||
```
|
||||
|
||||
Available YOLOv8-seg export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolov8n-seg.onnx`. Usage examples are shown for your model after export completes.
|
||||
Available YOLO11-seg export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolo11n-seg.onnx`. Usage examples are shown for your model after export completes.
|
||||
|
||||
{% include "macros/export-table.md" %}
|
||||
|
||||
|
|
@ -178,9 +178,9 @@ See full `export` details in the [Export](../modes/export.md) page.
|
|||
|
||||
## FAQ
|
||||
|
||||
### How do I train a YOLOv8 segmentation model on a custom dataset?
|
||||
### How do I train a YOLO11 segmentation model on a custom dataset?
|
||||
|
||||
To train a YOLOv8 segmentation model on a custom dataset, you first need to prepare your dataset in the YOLO segmentation format. You can use tools like [JSON2YOLO](https://github.com/ultralytics/JSON2YOLO) to convert datasets from other formats. Once your dataset is ready, you can train the model using Python or CLI commands:
|
||||
To train a YOLO11 segmentation model on a custom dataset, you first need to prepare your dataset in the YOLO segmentation format. You can use tools like [JSON2YOLO](https://github.com/ultralytics/JSON2YOLO) to convert datasets from other formats. Once your dataset is ready, you can train the model using Python or CLI commands:
|
||||
|
||||
!!! example
|
||||
|
||||
|
|
@ -189,8 +189,8 @@ To train a YOLOv8 segmentation model on a custom dataset, you first need to prep
|
|||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# Load a pretrained YOLOv8 segment model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
# Load a pretrained YOLO11 segment model
|
||||
model = YOLO("yolo11n-seg.pt")
|
||||
|
||||
# Train the model
|
||||
results = model.train(data="path/to/your_dataset.yaml", epochs=100, imgsz=640)
|
||||
|
|
@ -199,18 +199,18 @@ To train a YOLOv8 segmentation model on a custom dataset, you first need to prep
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo segment train data=path/to/your_dataset.yaml model=yolov8n-seg.pt epochs=100 imgsz=640
|
||||
yolo segment train data=path/to/your_dataset.yaml model=yolo11n-seg.pt epochs=100 imgsz=640
|
||||
```
|
||||
|
||||
Check the [Configuration](../usage/cfg.md) page for more available arguments.
|
||||
|
||||
### What is the difference between [object detection](https://www.ultralytics.com/glossary/object-detection) and instance segmentation in YOLOv8?
|
||||
### What is the difference between [object detection](https://www.ultralytics.com/glossary/object-detection) and instance segmentation in YOLO11?
|
||||
|
||||
Object detection identifies and localizes objects within an image by drawing bounding boxes around them, whereas instance segmentation not only identifies the bounding boxes but also delineates the exact shape of each object. YOLOv8 instance segmentation models provide masks or contours that outline each detected object, which is particularly useful for tasks where knowing the precise shape of objects is important, such as medical imaging or autonomous driving.
|
||||
Object detection identifies and localizes objects within an image by drawing bounding boxes around them, whereas instance segmentation not only identifies the bounding boxes but also delineates the exact shape of each object. YOLO11 instance segmentation models provide masks or contours that outline each detected object, which is particularly useful for tasks where knowing the precise shape of objects is important, such as medical imaging or autonomous driving.
|
||||
|
||||
### Why use YOLOv8 for instance segmentation?
|
||||
### Why use YOLO11 for instance segmentation?
|
||||
|
||||
Ultralytics YOLOv8 is a state-of-the-art model recognized for its high accuracy and real-time performance, making it ideal for instance segmentation tasks. YOLOv8 Segment models come pretrained on the [COCO dataset](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml), ensuring robust performance across a variety of objects. Additionally, YOLOv8 supports training, validation, prediction, and export functionalities with seamless integration, making it highly versatile for both research and industry applications.
|
||||
Ultralytics YOLO11 is a state-of-the-art model recognized for its high accuracy and real-time performance, making it ideal for instance segmentation tasks. YOLO11 Segment models come pretrained on the [COCO dataset](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml), ensuring robust performance across a variety of objects. Additionally, YOLOv8 supports training, validation, prediction, and export functionalities with seamless integration, making it highly versatile for both research and industry applications.
|
||||
|
||||
### How do I load and validate a pretrained YOLOv8 segmentation model?
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ Loading and validating a pretrained YOLOv8 segmentation model is straightforward
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a pretrained model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
model = YOLO("yolo11n-seg.pt")
|
||||
|
||||
# Validate the model
|
||||
metrics = model.val()
|
||||
|
|
@ -235,7 +235,7 @@ Loading and validating a pretrained YOLOv8 segmentation model is straightforward
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo segment val model=yolov8n-seg.pt
|
||||
yolo segment val model=yolo11n-seg.pt
|
||||
```
|
||||
|
||||
These steps will provide you with validation metrics like [Mean Average Precision](https://www.ultralytics.com/glossary/mean-average-precision-map) (mAP), crucial for assessing model performance.
|
||||
|
|
@ -252,7 +252,7 @@ Exporting a YOLOv8 segmentation model to ONNX format is simple and can be done u
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a pretrained model
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
model = YOLO("yolo11n-seg.pt")
|
||||
|
||||
# Export the model to ONNX format
|
||||
model.export(format="onnx")
|
||||
|
|
@ -261,7 +261,7 @@ Exporting a YOLOv8 segmentation model to ONNX format is simple and can be done u
|
|||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo export model=yolov8n-seg.pt format=onnx
|
||||
yolo export model=yolo11n-seg.pt format=onnx
|
||||
```
|
||||
|
||||
For more details on exporting to various formats, refer to the [Export](../modes/export.md) page.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue