ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ ΠΊ содСрТимому

Ultralytics YOLO11 Modes

Ultralytics YOLO ЭкосистСма ΠΈ ΠΈΠ½Ρ‚Π΅Π³Ρ€Π°Ρ†ΠΈΠΈ

Π’Π²Π΅Π΄Π΅Π½ΠΈΠ΅

Ultralytics YOLO11 is not just another object detection model; it's a versatile framework designed to cover the entire lifecycle of machine learning modelsβ€”from data ingestion and model training to validation, deployment, and real-world tracking. Each mode serves a specific purpose and is engineered to offer you the flexibility and efficiency required for different tasks and use-cases.



Π‘ΠΌΠΎΡ‚Ρ€ΠΈ: Ultralytics Π Π΅ΠΆΠΈΠΌΡ‹ Π‘Π°ΠΌΠΎΡƒΡ‡ΠΈΡ‚Π΅Π»ΡŒ: Train, Validate, Predict, Export & Benchmark.

Π Π΅ΠΆΠΈΠΌΡ‹ с ΠΏΠ΅Ρ€Π²ΠΎΠ³ΠΎ взгляда

Understanding the different modes that Ultralytics YOLO11 supports is critical to getting the most out of your models:

  • Π Π΅ΠΆΠΈΠΌ Ρ‚Ρ€Π΅Π½ΠΈΡ€ΠΎΠ²ΠΊΠΈ: Π£Ρ‚ΠΎΡ‡Π½ΠΈ свою модСль Π½Π° ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΈΡ… ΠΈΠ»ΠΈ ΠΏΡ€Π΅Π΄Π²Π°Ρ€ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½Π½Ρ‹Ρ… Π½Π°Π±ΠΎΡ€Π°Ρ… Π΄Π°Π½Π½Ρ‹Ρ….
  • Π Π΅ΠΆΠΈΠΌ Val: ΠšΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ Ρ‚ΠΎΡ‡ΠΊΠ° послС Ρ‚Ρ€Π΅Π½ΠΈΡ€ΠΎΠ²ΠΊΠΈ для ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ работоспособности ΠΌΠΎΠ΄Π΅Π»ΠΈ.
  • Π Π΅ΠΆΠΈΠΌ Predict: Раскрой ΠΏΡ€Π΅Π΄ΡΠΊΠ°Π·Π°Ρ‚Π΅Π»ΡŒΠ½ΡƒΡŽ силу своСй ΠΌΠΎΠ΄Π΅Π»ΠΈ Π½Π° Ρ€Π΅Π°Π»ΡŒΠ½Ρ‹Ρ… Π΄Π°Π½Π½Ρ‹Ρ….
  • Export mode: Make your model deployment-ready in various formats.
  • Π Π΅ΠΆΠΈΠΌ слСТСния: Π Π°ΡΡˆΠΈΡ€ΡŒ свою модСль обнаруТСния ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² Π΄ΠΎ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ слСТСния Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ.
  • Π Π΅ΠΆΠΈΠΌ Π±Π΅Π½Ρ‡ΠΌΠ°Ρ€ΠΊΠ°: ΠŸΡ€ΠΎΠ°Π½Π°Π»ΠΈΠ·ΠΈΡ€ΡƒΠΉ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ ΠΈ Ρ‚ΠΎΡ‡Π½ΠΎΡΡ‚ΡŒ Ρ‚Π²ΠΎΠ΅ΠΉ ΠΌΠΎΠ΄Π΅Π»ΠΈ Π² Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… срСдах развСртывания.

This comprehensive guide aims to give you an overview and practical insights into each mode, helping you harness the full potential of YOLO11.

ПоСзд

Train mode is used for training a YOLO11 model on a custom dataset. In this mode, the model is trained using the specified dataset and hyperparameters. The training process involves optimizing the model's parameters so that it can accurately predict the classes and locations of objects in an image.

ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ ΠΏΠΎΠ΅Π·Π΄ΠΎΠ²

Вэл

Val mode is used for validating a YOLO11 model after it has been trained. In this mode, the model is evaluated on a validation set to measure its accuracy and generalization performance. This mode can be used to tune the hyperparameters of the model to improve its performance.

ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ Π²Π°Π»ΠΎΠ²

ΠŸΡ€Π΅Π΄ΡΠΊΠ°Π·Ρ‹Π²Π°ΠΉ

Predict mode is used for making predictions using a trained YOLO11 model on new images or videos. In this mode, the model is loaded from a checkpoint file, and the user can provide images or videos to perform inference. The model predicts the classes and locations of objects in the input images or videos.

ΠŸΡ€Π΅Π΄ΡΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΏΡ€ΠΈΠΌΠ΅Ρ€Ρ‹

Экспорт

Export mode is used for exporting a YOLO11 model to a format that can be used for deployment. In this mode, the model is converted to a format that can be used by other software applications or hardware devices. This mode is useful when deploying the model to production environments.

ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ экспорта

Π’Ρ€Π΅ΠΊ

Track mode is used for tracking objects in real-time using a YOLO11 model. In this mode, the model is loaded from a checkpoint file, and the user can provide a live video stream to perform real-time object tracking. This mode is useful for applications such as surveillance systems or self-driving cars.

ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ Ρ‚Ρ€Π΅ΠΊΠΎΠ²

Π‘Π΅Π½Ρ‡ΠΌΠ°Ρ€ΠΊ

Benchmark mode is used to profile the speed and accuracy of various export formats for YOLO11. The benchmarks provide information on the size of the exported format, its mAP50-95 metrics (for object detection, segmentation, and pose) or accuracy_top5 metrics (for classification), and the inference time in milliseconds per image across various formats like ONNX, OpenVINO, TensorRT, and others. This information can help users choose the optimal export format for their specific use case based on their requirements for speed and accuracy.

ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ эталонов

Π’ΠžΠŸΠ ΠžΠ‘Π« И ΠžΠ’Π’Π•Π’Π«

How do I train a custom object detection model with Ultralytics YOLO11?

Training a custom object detection model with Ultralytics YOLO11 involves using the train mode. You need a dataset formatted in YOLO format, containing images and corresponding annotation files. Use the following command to start the training process:

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

from ultralytics import YOLO

# Load a pre-trained YOLO model (you can choose n, s, m, l, or x versions)
model = YOLO("yolo11n.pt")

# Start training on your custom dataset
model.train(data="path/to/dataset.yaml", epochs=100, imgsz=640)
# Train a YOLO model from the command line
yolo train data=path/to/dataset.yaml epochs=100 imgsz=640

Π—Π° Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½Ρ‹ΠΌΠΈ инструкциями Ρ‚Ρ‹ моТСшь ΠΎΠ±Ρ€Π°Ρ‚ΠΈΡ‚ΡŒΡΡ ΠΊ руководству ΠΏΠΎ Ρ‚Ρ€Π΅Π½ΠΈΡ€ΠΎΠ²ΠΊΠ°ΠΌUltralytics .

What metrics does Ultralytics YOLO11 use to validate the model's performance?

Ultralytics YOLO11 uses various metrics during the validation process to assess model performance. These include:

  • mAP (срСдняя срСдняя Ρ‚ΠΎΡ‡Π½ΠΎΡΡ‚ΡŒ): Π—Π΄Π΅ΡΡŒ оцСниваСтся Ρ‚ΠΎΡ‡Π½ΠΎΡΡ‚ΡŒ обнаруТСния ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ².
  • IOU (Intersection over Union): Π˜Π·ΠΌΠ΅Ρ€ΡΠ΅Ρ‚ ΠΏΠ΅Ρ€Π΅ΠΊΡ€Ρ‹Ρ‚ΠΈΠ΅ ΠΌΠ΅ΠΆΠ΄Ρƒ прСдсказанными ΠΈ истинными Π³Ρ€Π°Π½ΠΈΡ†Π°ΠΌΠΈ.
  • Precision and Recall: Precision measures the ratio of true positive detections to the total detected positives, while recall measures the ratio of true positive detections to the total actual positives.

Π’Ρ‹ моТСшь Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΡƒΡŽ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚ΡŒ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΡƒ:

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

from ultralytics import YOLO

# Load a pre-trained or custom YOLO model
model = YOLO("yolo11n.pt")

# Run validation on your dataset
model.val(data="path/to/validation.yaml")
# Validate a YOLO model from the command line
yolo val data=path/to/validation.yaml

ΠŸΠΎΠ΄Ρ€ΠΎΠ±Π½Π΅Π΅ ΠΎΠ± этом Ρ‡ΠΈΡ‚Π°ΠΉ Π² руководствС ΠΏΠΎ Π²Π°Π»ΠΈΠ΄Π°Ρ†ΠΈΠΈ.

How can I export my YOLO11 model for deployment?

Ultralytics YOLO11 offers export functionality to convert your trained model into various deployment formats such as ONNX, TensorRT, CoreML, and more. Use the following example to export your model:

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

from ultralytics import YOLO

# Load your trained YOLO model
model = YOLO("yolo11n.pt")

# Export the model to ONNX format (you can specify other formats as needed)
model.export(format="onnx")
# Export a YOLO model to ONNX format from the command line
yolo export model=yolo11n.pt format=onnx

ΠŸΠΎΠ΄Ρ€ΠΎΠ±Π½Ρ‹Π΅ шаги для ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π° экспорта ΠΌΠΎΠΆΠ½ΠΎ Π½Π°ΠΉΡ‚ΠΈ Π² руководствС ΠΏΠΎ экспорту.

What is the purpose of the benchmark mode in Ultralytics YOLO11?

Benchmark mode in Ultralytics YOLO11 is used to analyze the speed and accuracy of various export formats such as ONNX, TensorRT, and OpenVINO. It provides metrics like model size, mAP50-95 для обнаруТСния ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ², Π° Ρ‚Π°ΠΊΠΆΠ΅ врСмя Π²Ρ‹Π²ΠΎΠ΄Π° для Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… Π°ΠΏΠΏΠ°Ρ€Π°Ρ‚Π½Ρ‹Ρ… установок, Ρ‡Ρ‚ΠΎ ΠΏΠΎΠΌΠΎΠΆΠ΅Ρ‚ Ρ‚Π΅Π±Π΅ Π²Ρ‹Π±Ρ€Π°Ρ‚ΡŒ Π½Π°ΠΈΠ±ΠΎΠ»Π΅Π΅ подходящий Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ для Ρ‚Π²ΠΎΠΈΡ… потрСбностСй Π² Ρ€Π°Π·Π²Π΅Ρ€Ρ‚Ρ‹Π²Π°Π½ΠΈΠΈ.

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

from ultralytics.utils.benchmarks import benchmark

# Run benchmark on GPU (device 0)
# You can adjust parameters like model, dataset, image size, and precision as needed
benchmark(model="yolo11n.pt", data="coco8.yaml", imgsz=640, half=False, device=0)
# Benchmark a YOLO model from the command line
# Adjust parameters as needed for your specific use case
yolo benchmark model=yolo11n.pt data='coco8.yaml' imgsz=640 half=False device=0

Π—Π° Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½ΠΎΠΉ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠ΅ΠΉ обращайся ΠΊ руководству ΠΏΠΎ Π±Π΅Π½Ρ‡ΠΌΠ°Ρ€ΠΊΠ°ΠΌ.

How can I perform real-time object tracking using Ultralytics YOLO11?

Real-time object tracking can be achieved using the track mode in Ultralytics YOLO11. This mode extends object detection capabilities to track objects across video frames or live feeds. Use the following example to enable tracking:

ΠŸΡ€ΠΈΠΌΠ΅Ρ€

from ultralytics import YOLO

# Load a pre-trained YOLO model
model = YOLO("yolo11n.pt")

# Start tracking objects in a video
# You can also use live video streams or webcam input
model.track(source="path/to/video.mp4")
# Perform object tracking on a video from the command line
# You can specify different sources like webcam (0) or RTSP streams
yolo track source=path/to/video.mp4

ΠŸΠΎΠ΄Ρ€ΠΎΠ±Π½Ρ‹Π΅ инструкции ΠΌΠΎΠΆΠ½ΠΎ Π½Π°ΠΉΡ‚ΠΈ Π² руководствС ΠΏΠΎ Ρ‚Ρ€Π΅ΠΊΡƒ.


πŸ“… Created 11 months ago ✏️ Updated 11 days ago

ΠšΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ