Add CLI commands for predict and train YOLOv10 models. (#13940)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
d58058505e
commit
1d7eeae325
1 changed files with 41 additions and 16 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue