์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค ์‚ฌ์šฉ๋ฒ•

YOLO ๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค(CLI)๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด Python ํ™˜๊ฒฝ ์—†์ด๋„ ๊ฐ„๋‹จํ•œ ํ•œ ์ค„ ๋ช…๋ น์œผ๋กœ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. CLI ์‚ฌ์šฉ์ž ์ง€์ •์ด๋‚˜ Python ์ฝ”๋“œ๊ฐ€ ํ•„์š”ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ„ฐ๋ฏธ๋„์—์„œ ๋ชจ๋“  ์ž‘์—…์„ ๊ฐ„๋‹จํžˆ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. yolo ๋ช…๋ น์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.



Watch: Mastering Ultralytics YOLO: CLI

์˜ˆ

Ultralytics yolo ๋ช…๋ น์€ ๋‹ค์Œ ๊ตฌ๋ฌธ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค:

yolo TASK MODE ARGS

Where   TASK (optional) is one of [detect, segment, classify, pose, obb]
        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.
๋ชจ๋“  ARG ์ „๋ฌธ ๋ณด๊ธฐ ๊ตฌ์„ฑ ๊ฐ€์ด๋“œ ๋˜๋Š” yolo cfg

Train a detection model for 10 epochs with an initial learning_rate of 0.01

yolo train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01

์ด๋ฏธ์ง€ ํฌ๊ธฐ 320์—์„œ ์‚ฌ์ „ ํ•™์Šต๋œ ์„ธ๊ทธ๋จผํ…Œ์ด์…˜ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜์—ฌ YouTube ๋™์˜์ƒ์„ ์˜ˆ์ธกํ•ฉ๋‹ˆ๋‹ค:

yolo predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320

๋ฐฐ์น˜ ํฌ๊ธฐ 1, ์ด๋ฏธ์ง€ ํฌ๊ธฐ 640์˜ ์‚ฌ์ „ ํ•™์Šต๋œ ํƒ์ง€ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค:

yolo val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640

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

ํŠน์ˆ˜ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์—ฌ ๋ฒ„์ „ ํ™•์ธ, ์„ค์ • ๋ณด๊ธฐ, ๊ฒ€์‚ฌ ์‹คํ–‰ ๋“ฑ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

yolo help
yolo checks
yolo version
yolo settings
yolo copy-cfg
yolo cfg

Where:

  • TASK (์„ ํƒ ์‚ฌํ•ญ)์€ ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. [detect, segment, classify, pose, obb]. If it is not passed explicitly YOLO11 will try to guess the TASK ๋ฅผ ๋ชจ๋ธ ์œ ํ˜•์—์„œ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  • MODE (ํ•„์ˆ˜)๋Š” ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. [train, val, predict, export, track, benchmark]
  • ARGS (์„ ํƒ ์‚ฌํ•ญ) ์‚ฌ์šฉ์ž ์ง€์ • arg=value ๊ฐ™์€ imgsz=320 ๊ธฐ๋ณธ๊ฐ’์„ ์žฌ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ „์ฒด ๋ชฉ๋ก์€ ARGS ๋ฅผ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค. ๊ตฌ์„ฑ ํŽ˜์ด์ง€์™€ defaults.yaml

๊ฒฝ๊ณ 

์ธ์ˆ˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ „๋‹ฌ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. arg=val ์Œ, ๋“ฑํ˜ธ๋กœ ๋‚˜๋ˆˆ = ๊ธฐํ˜ธ๋กœ ๊ตฌ๋ถ„ํ•˜๊ณ  ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„ ๋ฅผ ์Œ์œผ๋กœ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค. -- ์ธ์ˆ˜ ์ ‘๋‘์‚ฌ ๋˜๋Š” ์‰ผํ‘œ , ์ธ์ž ์‚ฌ์ด์— ์žˆ์Šต๋‹ˆ๋‹ค.

  • yolo predict model=yolo11n.pt imgsz=640 conf=0.25 ย  โœ…
  • yolo predict model yolo11n.pt imgsz 640 conf 0.25 ย  โŒ
  • yolo predict --model yolo11n.pt --imgsz 640 --conf 0.25 ย  โŒ

๊ธฐ์ฐจ

Train YOLO11n on the COCO8 dataset for 100 epochs at image size 640. For a full list of available arguments see the Configuration page.

์˜ˆ

Start training YOLO11n on COCO8 for 100 epochs at image-size 640.

yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640

์ค‘๋‹จ๋œ ๊ต์œก์„ ์žฌ๊ฐœํ•ฉ๋‹ˆ๋‹ค.

yolo detect train resume model=last.pt

Val

Validate trained YOLO11n model accuracy on the COCO8 dataset. No arguments are needed as the model ๊ต์œก ์œ ์ง€ data ๋ฐ ์ธ์ˆ˜๋ฅผ ๋ชจ๋ธ ์†์„ฑ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ

Validate an official YOLO11n model.

yolo detect val model=yolo11n.pt

์‚ฌ์šฉ์ž ์ง€์ • ํ•™์Šต๋œ ๋ชจ๋ธ์„ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค.

yolo detect val model=path/to/best.pt

์˜ˆ์ธก

Use a trained YOLO11n model to run predictions on images.

์˜ˆ

Predict with an official YOLO11n model.

yolo detect predict model=yolo11n.pt source='https://ultralytics.com/images/bus.jpg'

์‚ฌ์šฉ์ž ์ง€์ • ๋ชจ๋ธ๋กœ ์˜ˆ์ธกํ•˜์„ธ์š”.

yolo detect predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg'

๋‚ด๋ณด๋‚ด๊ธฐ

Export a YOLO11n model to a different format like ONNX, CoreML, etc.

์˜ˆ

Export an official YOLO11n model to ONNX format.

yolo export model=yolo11n.pt format=onnx

์‚ฌ์šฉ์ž ์ง€์ • ํ•™์Šต๋œ ๋ชจ๋ธ์„ ONNX ํ˜•์‹์œผ๋กœ ๋‚ด๋ณด๋ƒ…๋‹ˆ๋‹ค.

yolo export model=path/to/best.pt format=onnx

Available YOLO11 export formats are in the table below. You can export to any format using the format ์ธ์ˆ˜, ์ฆ‰ format='onnx' ๋˜๋Š” format='engine'.

ํ˜•์‹ format ์ธ์ˆ˜ ๋ชจ๋ธ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์ธ์ˆ˜
PyTorch - yolo11n.pt โœ… -
TorchScript torchscript yolo11n.torchscript โœ… imgsz, optimize, batch
ONNX onnx yolo11n.onnx โœ… imgsz, half, dynamic, simplify, opset, batch
OpenVINO openvino yolo11n_openvino_model/ โœ… imgsz, half, int8, batch
TensorRT engine yolo11n.engine โœ… imgsz, half, dynamic, simplify, workspace, int8, batch
CoreML coreml yolo11n.mlpackage โœ… imgsz, half, int8, nms, batch
TF SavedModel saved_model yolo11n_saved_model/ โœ… imgsz, keras, int8, batch
TF GraphDef pb yolo11n.pb โŒ imgsz, batch
TF Lite tflite yolo11n.tflite โœ… imgsz, half, int8, batch
TF Edge TPU edgetpu yolo11n_edgetpu.tflite โœ… imgsz
TF.js tfjs yolo11n_web_model/ โœ… imgsz, half, int8, batch
PaddlePaddle paddle yolo11n_paddle_model/ โœ… imgsz, batch
NCNN ncnn yolo11n_ncnn_model/ โœ… imgsz, half, batch

์ „์ฒด ๋ณด๊ธฐ export ์„ธ๋ถ€ ์ •๋ณด์—์„œ ๋‚ด๋ณด๋‚ด๊ธฐ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ ์ธ์ˆ˜ ์žฌ์ •์˜

๊ธฐ๋ณธ ์ธ์ˆ˜๋Š” CLI ์— ์ธ์ž๋กœ ์ „๋‹ฌํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ์žฌ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. arg=value ์Œ์ž…๋‹ˆ๋‹ค.

ํŒ

๋‹ค์Œ์— ๋Œ€ํ•œ ํƒ์ง€ ๋ชจ๋ธ ํ•™์Šต 10 epochs ์™€ ํ•จ๊ป˜ learning_rate ์˜ 0.01

yolo detect train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01

์ด๋ฏธ์ง€ ํฌ๊ธฐ 320์—์„œ ์‚ฌ์ „ ํ•™์Šต๋œ ์„ธ๊ทธ๋จผํ…Œ์ด์…˜ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜์—ฌ YouTube ๋™์˜์ƒ์„ ์˜ˆ์ธกํ•ฉ๋‹ˆ๋‹ค:

yolo segment predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320

๋ฐฐ์น˜ ํฌ๊ธฐ 1 ๋ฐ ์ด๋ฏธ์ง€ ํฌ๊ธฐ 640์—์„œ ์‚ฌ์ „ ํ•™์Šต๋œ ํƒ์ง€ ๋ชจ๋ธ์˜ ์œ ํšจ์„ฑ์„ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค:

yolo detect val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640

๊ธฐ๋ณธ ๊ตฌ์„ฑ ํŒŒ์ผ ์žฌ์ •์˜

์žฌ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. default.yaml ๊ตฌ์„ฑ ํŒŒ์ผ์„ ์™„์ „ํžˆ ์ƒˆ ํŒŒ์ผ๋กœ ์ „๋‹ฌํ•˜์—ฌ cfg ์ธ์ž, ์ฆ‰ cfg=custom.yaml.

์ด๋ ‡๊ฒŒ ํ•˜๋ ค๋ฉด ๋จผ์ € default.yaml ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ˜„์žฌ ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ์— yolo copy-cfg ๋ช…๋ น์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‹ค์Œ์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. default_copy.yaml๋กœ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. cfg=default_copy.yaml ์™€ ๊ฐ™์€ ์ถ”๊ฐ€ ์ธ์ž์™€ ํ•จ๊ป˜ imgsz=320 ์ด ์˜ˆ์ œ์—์„œ๋Š”

์˜ˆ

yolo copy-cfg
yolo cfg=default_copy.yaml imgsz=320

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ

How do I use the Ultralytics YOLO11 command line interface (CLI) for model training?

To train a YOLO11 model using the CLI, you can execute a simple one-line command in the terminal. For example, to train a detection model for 10 epochs with a learning rate of 0.01, you would run:

yolo train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01

์ด ๋ช…๋ น์€ train ๋ชจ๋“œ๋ฅผ ํŠน์ • ์ธ์ˆ˜์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ธ์ˆ˜์˜ ์ „์ฒด ๋ชฉ๋ก์€ ๋‹ค์Œ์„ ์ฐธ์กฐํ•˜์„ธ์š”. ๊ตฌ์„ฑ ๊ฐ€์ด๋“œ.

What tasks can I perform with the Ultralytics YOLO11 CLI?

The Ultralytics YOLO11 CLI supports a variety of tasks including detection, segmentation, classification, validation, prediction, export, and tracking. For instance:

  • ๋ชจ๋ธ ํ›ˆ๋ จ: ์‹คํ–‰ yolo train data=<data.yaml> model=<model.pt> epochs=<num>.
  • ์˜ˆ์ธก ์‹คํ–‰: ์‚ฌ์šฉ yolo predict model=<model.pt> source=<data_source> imgsz=<image_size>.
  • ๋ชจ๋ธ ๋‚ด๋ณด๋‚ด๊ธฐ: ์‹คํ–‰ yolo export model=<model.pt> format=<export_format>.

๊ฐ ์ž‘์—…์€ ๋‹ค์–‘ํ•œ ์ธ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๊ตฌ๋ฌธ๊ณผ ์˜ˆ์ œ๋Š” ํ›ˆ๋ จ, ์˜ˆ์ธก, ๋‚ด๋ณด๋‚ด๊ธฐ ๋“ฑ์˜ ๊ฐ ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

How can I validate the accuracy of a trained YOLO11 model using the CLI?

To validate a YOLO11 model's accuracy, use the val mode. For example, to validate a pretrained detection model with a batch size of 1 and image size of 640, run:

yolo val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640

์ด ๋ช…๋ น์€ ์ง€์ •๋œ ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ ๋ชจ๋ธ์„ ํ‰๊ฐ€ํ•˜๊ณ  ์„ฑ๋Šฅ ๋ฉ”ํŠธ๋ฆญ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ Val ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

What formats can I export my YOLO11 models to using the CLI?

YOLO11 models can be exported to various formats such as ONNX, CoreML, TensorRT, and more. For instance, to export a model to ONNX format, run:

yolo export model=yolo11n.pt format=onnx

์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋‚ด๋ณด๋‚ด๊ธฐ ํŽ˜์ด์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

How do I customize YOLO11 CLI commands to override default arguments?

To override default arguments in YOLO11 CLI commands, pass them as arg=value ์Œ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์‚ฌ์šฉ์ž ์ง€์ • ์ธ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋ธ์„ ํ•™์Šตํ•˜๋ ค๋ฉด ๋‹ค์Œ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค:

yolo train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01

์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ธ์ˆ˜์˜ ์ „์ฒด ๋ชฉ๋ก๊ณผ ์„ค๋ช…์€ ์„ค์ • ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”. ๊ธฐ๋ณธ ์ธ์ˆ˜ ์žฌ์ •์˜ํ•˜๊ธฐ ์„น์…˜์— ํ‘œ์‹œ๋œ ๋Œ€๋กœ ์ธ์ˆ˜์˜ ํ˜•์‹์ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ง€์ •๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.


๐Ÿ“… Created 11 months ago โœ๏ธ Updated 6 days ago

๋Œ“๊ธ€