Fix and add missing infos about available CLI TASK commands in docs and code comments (#16697)
This commit is contained in:
parent
70ba988c68
commit
4b95ae70a0
4 changed files with 14 additions and 14 deletions
|
|
@ -61,8 +61,8 @@ HELP_MSG = """
|
|||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolov8n.yaml") # build a new model from scratch
|
||||
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
|
||||
model = YOLO("yolo11n.yaml") # build a new model from scratch
|
||||
model = YOLO("yolo11n.pt") # load a pretrained model (recommended for training)
|
||||
|
||||
# Use the model
|
||||
results = model.train(data="coco8.yaml", epochs=3) # train the model
|
||||
|
|
@ -77,21 +77,21 @@ HELP_MSG = """
|
|||
yolo TASK MODE ARGS
|
||||
|
||||
Where TASK (optional) is one of [detect, segment, classify, pose, obb]
|
||||
MODE (required) is one of [train, val, predict, export, benchmark]
|
||||
MODE (required) is one of [train, val, predict, export, track, benchmark]
|
||||
ARGS (optional) are any number of custom "arg=value" pairs like "imgsz=320" that override defaults.
|
||||
See all ARGS at https://docs.ultralytics.com/usage/cfg or with "yolo cfg"
|
||||
|
||||
- Train a detection model for 10 epochs with an initial learning_rate of 0.01
|
||||
yolo detect train data=coco8.yaml model=yolov8n.pt epochs=10 lr0=0.01
|
||||
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01
|
||||
|
||||
- Predict a YouTube video using a pretrained segmentation model at image size 320:
|
||||
yolo segment predict model=yolov8n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320
|
||||
yolo segment predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320
|
||||
|
||||
- Val a pretrained detection model at batch-size 1 and image size 640:
|
||||
yolo detect val model=yolov8n.pt data=coco8.yaml batch=1 imgsz=640
|
||||
yolo detect val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640
|
||||
|
||||
- Export a YOLOv8n classification model to ONNX format at image size 224 by 128 (no TASK required)
|
||||
yolo export model=yolov8n-cls.pt format=onnx imgsz=224,128
|
||||
- Export a YOLO11n classification model to ONNX format at image size 224 by 128 (no TASK required)
|
||||
yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
|
||||
|
||||
- Run special commands:
|
||||
yolo help
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue