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

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ์˜ˆ์‹œ

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜๋Š” ์„ธ ๊ฐ€์ง€ ์ž‘์—… ์ค‘ ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ์ž‘์—…์œผ๋กœ, ์ „์ฒด ์ด๋ฏธ์ง€๋ฅผ ๋ฏธ๋ฆฌ ์ •์˜๋œ ํด๋ž˜์Šค ์„ธํŠธ ์ค‘ ํ•˜๋‚˜๋กœ ๋ถ„๋ฅ˜ํ•˜๋Š” ์ž‘์—…์ž…๋‹ˆ๋‹ค.

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜๊ธฐ์˜ ์ถœ๋ ฅ์€ ๋‹จ์ผ ํด๋ž˜์Šค ๋ ˆ์ด๋ธ”๊ณผ ์‹ ๋ขฐ๋„ ์ ์ˆ˜์ž…๋‹ˆ๋‹ค. ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜๋Š” ์ด๋ฏธ์ง€๊ฐ€ ์†ํ•œ ํด๋ž˜์Šค๋งŒ ์•Œ๊ณ  ์‹ถ๊ณ  ํ•ด๋‹น ํด๋ž˜์Šค์˜ ๊ฐ์ฒด๊ฐ€ ์–ด๋””์— ์žˆ๋Š”์ง€ ๋˜๋Š” ์ •ํ™•ํ•œ ๋ชจ์–‘์ด ๋ฌด์—‡์ธ์ง€ ์•Œ ํ•„์š”๊ฐ€ ์—†์„ ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.



Watch: Ultralytics YOLO ์ž‘์—… ์‚ดํŽด๋ณด๊ธฐ: Ultralytics HUB๋ฅผ ์‚ฌ์šฉํ•œ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜

ํŒ

YOLO11 ๋ชจ๋ธ ๋ถ„๋ฅ˜๋Š” -cls ์ ‘๋ฏธ์‚ฌ, ์ฆ‰ yolo11n-cls.pt ์— ๋Œ€ํ•ด ์‚ฌ์ „ ๊ต์œก์„ ๋ฐ›์•˜์œผ๋ฉฐ ์ด๋ฏธ์ง€๋„ท.

๋ชจ๋ธ

YOLO11 ์‚ฌ์ „ ํ•™์Šต๋œ ๋ถ„๋ฅ˜ ๋ชจ๋ธ์ด ์—ฌ๊ธฐ์— ๋‚˜์™€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ์ง€, ์„ธ๊ทธ๋จผํŠธ ๋ฐ ํฌ์ฆˆ ๋ชจ๋ธ์€ COCO ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ ์‚ฌ์ „ ํ•™์Šต๋œ ๋ฐ˜๋ฉด, ๋ถ„๋ฅ˜ ๋ชจ๋ธ์€ ImageNet ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ ์‚ฌ์ „ ํ•™์Šต๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋ชจ๋ธ์€ ์ฒ˜์Œ ์‚ฌ์šฉํ•  ๋•Œ ์ตœ์‹  Ultralytics ๋ฆด๋ฆฌ์Šค์—์„œ ์ž๋™์œผ๋กœ ๋‹ค์šด๋กœ๋“œ๋ฉ๋‹ˆ๋‹ค.

๋ชจ๋ธ ํฌ๊ธฐ
(ํ”ฝ์…€)
acc
top1
ACC
TOP5
์†๋„
CPU ONNX
(ms)
์†๋„
T4TensorRT10
(ms)
๋งค๊ฐœ๋ณ€์ˆ˜
(M)
FLOPs
(B) at 640
YOLO11n-cls 224 70.0 89.4 5.0 ยฑ 0.3 1.1 ยฑ 0.0 1.6 3.3
YOLO11s-cls 224 75.4 92.7 7.9 ยฑ 0.2 1.3 ยฑ 0.0 5.5 12.1
YOLO11m-cls 224 77.3 93.9 17.2 ยฑ 0.4 2.0 ยฑ 0.0 10.4 39.3
YOLO11l-cls 224 78.3 94.3 23.2 ยฑ 0.3 2.8 ยฑ 0.0 12.9 49.4
YOLO11x-cls 224 79.5 94.9 41.4 ยฑ 0.9 3.8 ยฑ 0.0 28.4 110.4
  • acc ๊ฐ’์€ ๋ชจ๋ธ ์ •ํ™•๋„์ž…๋‹ˆ๋‹ค. ์ด๋ฏธ์ง€๋„ท ๋ฐ์ดํ„ฐ ์„ธํŠธ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์ง‘ํ•ฉ.
    ๋ณต์ œ ๋Œ€์ƒ yolo val classify data=path/to/ImageNet device=0
  • ์†๋„ ์ด๋ฏธ์ง€๋„ท ๊ฐ’ ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด ํ‰๊ท ์„ ๊ตฌํ•ฉ๋‹ˆ๋‹ค. Amazon EC2 P4d ์ธ์Šคํ„ด์Šค์ž…๋‹ˆ๋‹ค.
    ๋ณต์ œ ๋Œ€์ƒ yolo val classify data=path/to/ImageNet batch=1 device=0|cpu

๊ธฐ์ฐจ

์ด๋ฏธ์ง€ ํฌ๊ธฐ 64์—์„œ 100๊ฐœ์˜ ์—ํฌํฌ์— ๋Œ€ํ•ด MNIST160 ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ YOLO11n-cls๋ฅผ ํ›ˆ๋ จํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ธ์ˆ˜์˜ ์ „์ฒด ๋ชฉ๋ก์€ ๊ตฌ์„ฑ ํŽ˜์ด์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.yaml")  # build a new model from YAML
model = YOLO("yolo11n-cls.pt")  # load a pretrained model (recommended for training)
model = YOLO("yolo11n-cls.yaml").load("yolo11n-cls.pt")  # build from YAML and transfer weights

# Train the model
results = model.train(data="mnist160", epochs=100, imgsz=64)
# Build a new model from YAML and start training from scratch
yolo classify train data=mnist160 model=yolo11n-cls.yaml epochs=100 imgsz=64

# Start training from a pretrained *.pt model
yolo classify train data=mnist160 model=yolo11n-cls.pt epochs=100 imgsz=64

# Build a new model from YAML, transfer pretrained weights to it and start training
yolo classify train data=mnist160 model=yolo11n-cls.yaml pretrained=yolo11n-cls.pt epochs=100 imgsz=64

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ ํ˜•์‹

YOLO ๋ถ„๋ฅ˜ ๋ฐ์ดํ„ฐ์…‹ ํ˜•์‹์€ ๋ฐ์ดํ„ฐ์…‹ ๊ฐ€์ด๋“œ์—์„œ ์ž์„ธํžˆ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Val

ํ•™์Šต๋œ YOLO11n-cls ๋ชจ๋ธ ๊ฒ€์ฆํ•˜๊ธฐ ์ •ํ™•์„ฑ ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ธ์ˆ˜๊ฐ€ ํ•„์š”ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ model ๊ต์œก ์œ ์ง€ data ๋ฐ ์ธ์ˆ˜๋ฅผ ๋ชจ๋ธ ์†์„ฑ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.pt")  # load an official model
model = YOLO("path/to/best.pt")  # load a custom model

# Validate the model
metrics = model.val()  # no arguments needed, dataset and settings remembered
metrics.top1  # top1 accuracy
metrics.top5  # top5 accuracy
yolo classify val model=yolo11n-cls.pt  # val official model
yolo classify val model=path/to/best.pt  # val custom model

์˜ˆ์ธก

ํ•™์Šต๋œ YOLO11n-cls ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€์— ๋Œ€ํ•œ ์˜ˆ์ธก์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.pt")  # load an official model
model = YOLO("path/to/best.pt")  # load a custom model

# Predict with the model
results = model("https://ultralytics.com/images/bus.jpg")  # predict on an image
yolo classify predict model=yolo11n-cls.pt source='https://ultralytics.com/images/bus.jpg'  # predict with official model
yolo classify predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg'  # predict with custom model

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

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

ONNX, CoreML ๋“ฑ๊ณผ ๊ฐ™์€ ๋‹ค๋ฅธ ํ˜•์‹์œผ๋กœ YOLO11n-cls ๋ชจ๋ธ์„ ๋‚ด๋ณด๋ƒ…๋‹ˆ๋‹ค.

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.pt")  # load an official model
model = YOLO("path/to/best.pt")  # load a custom trained model

# Export the model
model.export(format="onnx")
yolo export model=yolo11n-cls.pt format=onnx  # export official model
yolo export model=path/to/best.pt format=onnx  # export custom trained model

์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ YOLO11-cls ๋‚ด๋ณด๋‚ด๊ธฐ ํ˜•์‹์€ ์•„๋ž˜ ํ‘œ์— ๋‚˜์™€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋“  ํ˜•์‹์œผ๋กœ ๋‚ด๋ณด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. format ์ธ์ˆ˜, ์ฆ‰ format='onnx' ๋˜๋Š” format='engine'. ๋‚ด๋ณด๋‚ธ ๋ชจ๋ธ์—์„œ ์ง์ ‘ ์˜ˆ์ธกํ•˜๊ฑฐ๋‚˜ ๊ฒ€์ฆํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. yolo predict model=yolo11n-cls.onnx. ๋‚ด๋ณด๋‚ด๊ธฐ๊ฐ€ ์™„๋ฃŒ๋œ ํ›„ ๋ชจ๋ธ์— ๋Œ€ํ•œ ์‚ฌ์šฉ ์˜ˆ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

ํ˜•์‹ format ์ธ์ˆ˜ ๋ชจ๋ธ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์ธ์ˆ˜
PyTorch - yolo11n-cls.pt โœ… -
TorchScript torchscript yolo11n-cls.torchscript โœ… imgsz, optimize, batch
ONNX onnx yolo11n-cls.onnx โœ… imgsz, half, dynamic, simplify, opset, batch
OpenVINO openvino yolo11n-cls_openvino_model/ โœ… imgsz, half, int8, batch
TensorRT engine yolo11n-cls.engine โœ… imgsz, half, dynamic, simplify, workspace, int8, batch
CoreML coreml yolo11n-cls.mlpackage โœ… imgsz, half, int8, nms, batch
TF SavedModel saved_model yolo11n-cls_saved_model/ โœ… imgsz, keras, int8, batch
TF GraphDef pb yolo11n-cls.pb โŒ imgsz, batch
TF Lite tflite yolo11n-cls.tflite โœ… imgsz, half, int8, batch
TF Edge TPU edgetpu yolo11n-cls_edgetpu.tflite โœ… imgsz
TF.js tfjs yolo11n-cls_web_model/ โœ… imgsz, half, int8, batch
PaddlePaddle paddle yolo11n-cls_paddle_model/ โœ… imgsz, batch
MNN mnn yolo11n-cls.mnn โœ… imgsz, batch, int8, half
NCNN ncnn yolo11n-cls_ncnn_model/ โœ… imgsz, half, batch
IMX500 imx yolo11n-cls_imx_model/ โœ… imgsz, int8

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

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

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜์—์„œ YOLO11 ์˜ ๋ชฉ์ ์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

YOLO11 ๋ชจ๋ธ๊ณผ ๊ฐ™์€ yolo11n-cls.pt๋Š” ํšจ์œจ์ ์ธ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜๋ฅผ ์œ„ํ•ด ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์‹ ๋ขฐ๋„ ์ ์ˆ˜์™€ ํ•จ๊ป˜ ์ „์ฒด ์ด๋ฏธ์ง€์— ๋‹จ์ผ ํด๋ž˜์Šค ๋ ˆ์ด๋ธ”์„ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ์ด๋ฏธ์ง€ ๋‚ด ๋ฌผ์ฒด์˜ ์œ„์น˜๋‚˜ ๋ชจ์–‘์„ ์‹๋ณ„ํ•˜๋Š” ๋Œ€์‹  ์ด๋ฏธ์ง€์˜ ํŠน์ • ํด๋ž˜์Šค๋งŒ ์•Œ๋ฉด ์ถฉ๋ถ„ํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ํŠนํžˆ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜๋ฅผ ์œ„ํ•ด YOLO11 ๋ชจ๋ธ์„ ์–ด๋–ป๊ฒŒ ํ›ˆ๋ จํ•˜๋‚˜์š”?

YOLO11 ๋ชจ๋ธ์„ ํ›ˆ๋ จํ•˜๋ ค๋ฉด Python ๋˜๋Š” CLI ๋ช…๋ น์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด yolo11n-cls ๋ชจ๋ธ์„ ์ด๋ฏธ์ง€ ํฌ๊ธฐ 64์˜ 100๊ฐœ ์—ํฌํฌ์— ๋Œ€ํ•ด MNIST160 ๋ฐ์ดํ„ฐ ์„ธํŠธ์— ์ ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค:

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.pt")  # load a pretrained model (recommended for training)

# Train the model
results = model.train(data="mnist160", epochs=100, imgsz=64)
yolo classify train data=mnist160 model=yolo11n-cls.pt epochs=100 imgsz=64

๋” ๋งŽ์€ ๊ตฌ์„ฑ ์˜ต์…˜์„ ๋ณด๋ ค๋ฉด ๊ตฌ์„ฑ ํŽ˜์ด์ง€๋ฅผ ๋ฐฉ๋ฌธํ•˜์„ธ์š”.

์‚ฌ์ „ ํ•™์Šต๋œ YOLO11 ๋ถ„๋ฅ˜ ๋ชจ๋ธ์€ ์–ด๋””์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ๋‚˜์š”?

์‚ฌ์ „ ํ•™์Šต๋œ YOLO11 ๋ถ„๋ฅ˜ ๋ชจ๋ธ์€ ๋‹ค์Œ์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋ธ ์„น์…˜์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ชจ๋ธ yolo11n-cls.pt, yolo11s-cls.pt, yolo11m-cls.pt๋“ฑ์— ๋Œ€ํ•ด ์‚ฌ์ „ ๊ต์œก์„ ๋ฐ›์€ ํ›„ ์ด๋ฏธ์ง€๋„ท ๋ฐ์ดํ„ฐ ์„ธํŠธ๋ฅผ ์‰ฝ๊ฒŒ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ๋‹ค์–‘ํ•œ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ์ž‘์—…์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ•™์Šต๋œ YOLO11 ๋ชจ๋ธ์„ ๋‹ค๋ฅธ ํ˜•์‹์œผ๋กœ ๋‚ด๋ณด๋‚ด๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜์š”?

ํ•™์Šต๋œ YOLO11 ๋ชจ๋ธ์„ Python ๋˜๋Š” CLI ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์–‘ํ•œ ํ˜•์‹์œผ๋กœ ๋‚ด๋ณด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๋ชจ๋ธ์„ ONNX ํ˜•์‹์œผ๋กœ ๋‚ด๋ณด๋‚ด๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•˜์„ธ์š”:

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.pt")  # load the trained model

# Export the model to ONNX
model.export(format="onnx")
yolo export model=yolo11n-cls.pt format=onnx  # export the trained model to ONNX format

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

ํ›ˆ๋ จ๋œ YOLO11 ๋ถ„๋ฅ˜ ๋ชจ๋ธ์˜ ์œ ํšจ์„ฑ์„ ๊ฒ€์‚ฌํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜์š”?

MNIST160๊ณผ ๊ฐ™์€ ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ ํ•™์Šต๋œ ๋ชจ๋ธ์˜ ์ •ํ™•๋„๋ฅผ ๊ฒ€์ฆํ•˜๋ ค๋ฉด ๋‹ค์Œ Python ๋˜๋Š” CLI ๋ช…๋ น์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-cls.pt")  # load the trained model

# Validate the model
metrics = model.val()  # no arguments needed, uses the dataset and settings from training
metrics.top1  # top1 accuracy
metrics.top5  # top5 accuracy
yolo classify val model=yolo11n-cls.pt  # validate the trained model

์ž์„ธํ•œ ๋‚ด์šฉ์€ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๐Ÿ“…1 ๋…„ ์ „ ์ƒ์„ฑ๋จ โœ๏ธ 1๊ฐœ์›” ์ „ ์—…๋ฐ์ดํŠธ๋จ

๋Œ“๊ธ€