Add CLI commands for `predict` and `train` YOLOv10 models. (#13940)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
pull/13943/head
Muhammad Rizwan Munawar 5 months ago committed by GitHub
parent d58058505e
commit 1d7eeae325
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 57
      docs/en/models/yolov10.md

@ -122,31 +122,56 @@ Here is a detailed comparison of YOLOv10 variants with other state-of-the-art mo
For predicting new images with YOLOv10:
```python
from ultralytics import YOLO
!!! Example
# Load a pre-trained YOLOv10n model
model = YOLO("yolov10n.pt")
=== "Python"
# Perform object detection on an image
results = model("image.jpg")
```python
from ultralytics import YOLO
# Display the results
results[0].show()
```
# Load a pre-trained YOLOv10n model
model = YOLO("yolov10n.pt")
# Perform object detection on an image
results = model("image.jpg")
# Display the results
results[0].show()
```
=== "CLI"
```bash
# Load a COCO-pretrained YOLOv10n model and run inference on the 'bus.jpg' image
yolo detect predict model=yolov10n.pt source=path/to/bus.jpg
```
For training YOLOv10 on a custom dataset:
```python
from ultralytics import YOLO
!!! Example
# Load YOLOv10n model from scratch
model = YOLO("yolov10n.yaml")
=== "Python"
# Train the model
model.train(data="coco8.yaml", epochs=100, imgsz=640)
```
```python
from ultralytics import YOLO
# Load YOLOv10n model from scratch
model = YOLO("yolov10n.yaml")
# Train the model
model.train(data="coco8.yaml", epochs=100, imgsz=640)
```
=== "CLI"
```bash
# Build a YOLOv10n model from scratch and train it on the COCO8 example dataset for 100 epochs
yolo train model=yolov10n.yaml data=coco8.yaml epochs=100 imgsz=640
# Build a YOLOv10n model from scratch and run inference on the 'bus.jpg' image
yolo predict model=yolov10n.yaml source=path/to/bus.jpg
```
## Supported Tasks and Modes
The YOLOv10 models series offers a range of models, each optimized for high-performance [Object Detection](../tasks/detect.md). These models cater to varying computational needs and accuracy requirements, making them versatile for a wide array of applications.

Loading…
Cancel
Save