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

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Muhammad Rizwan Munawar 2024-06-24 22:53:45 +05:00 committed by GitHub
parent d58058505e
commit 1d7eeae325
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,6 +122,10 @@ Here is a detailed comparison of YOLOv10 variants with other state-of-the-art mo
For predicting new images with YOLOv10:
!!! Example
=== "Python"
```python
from ultralytics import YOLO
@ -135,8 +139,19 @@ results = model("image.jpg")
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:
!!! Example
=== "Python"
```python
from ultralytics import YOLO
@ -147,6 +162,16 @@ model = YOLO("yolov10n.yaml")
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.