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

์ธ์Šคํ„ด์Šค ์„ธ๋ถ„ํ™”

์ธ์Šคํ„ด์Šค ์„ธ๋ถ„ํ™” ์˜ˆ์‹œ

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

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



Watch: Python ์—์„œ ์‚ฌ์ „ ํ•™์Šต๋œ Ultralytics YOLOv8 ๋ชจ๋ธ๋กœ ์„ธ๋ถ„ํ™” ์‹คํ–‰ .

ํŒ

YOLOv8 ์„ธ๊ทธ๋จผํŠธ ๋ชจ๋ธ์€ -seg ์ ‘๋ฏธ์‚ฌ, ์ฆ‰ yolov8n-seg.pt ์— ๋Œ€ํ•ด ์‚ฌ์ „ ๊ต์œก์„ ๋ฐ›์•˜์œผ๋ฉฐ COCO.

๋ชจ๋ธ

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

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

๋ชจ๋ธ ํฌ๊ธฐ
(ํ”ฝ์…€)
mAPbox
50-95
mAPmask
50-95
์†๋„
CPU ONNX
(ms)
์†๋„
A100 TensorRT
(ms)
๋งค๊ฐœ๋ณ€์ˆ˜
(M)
FLOPs
(B)
YOLOv8n-seg 640 36.7 30.5 96.1 1.21 3.4 12.6
YOLOv8s-seg 640 44.6 36.8 155.7 1.47 11.8 42.6
YOLOv8m-seg 640 49.9 40.8 317.0 2.18 27.3 110.2
YOLOv8l-seg 640 52.3 42.6 572.4 2.79 46.0 220.5
YOLOv8x-seg 640 53.4 43.4 712.1 4.02 71.8 344.1
  • mAPval ๊ฐ’์€ ๋‹จ์ผ ๋ชจ๋ธ ๋‹จ์ผ ์Šค์ผ€์ผ์— ๋Œ€ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. COCO val2017 ๋ฐ์ดํ„ฐ ์„ธํŠธ.
    ๋ณต์ œ ๋Œ€์ƒ yolo val segment data=coco.yaml device=0
  • ์†๋„ ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ COCO ๊ฐ’ ์ด๋ฏธ์ง€์— ๋Œ€ํ•œ ํ‰๊ท ์„ ๊ตฌํ•ฉ๋‹ˆ๋‹ค. Amazon EC2 P4d ์ธ์Šคํ„ด์Šค.
    ๋ณต์ œ ๋Œ€์ƒ yolo val segment data=coco8-seg.yaml batch=1 device=0|cpu

๊ธฐ์ฐจ

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

์˜ˆ

from ultralytics import YOLO

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

# Train the model
results = model.train(data="coco8-seg.yaml", epochs=100, imgsz=640)
# Build a new model from YAML and start training from scratch
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.yaml epochs=100 imgsz=640

# Start training from a pretrained *.pt model
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.pt epochs=100 imgsz=640

# Build a new model from YAML, transfer pretrained weights to it and start training
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.yaml pretrained=yolov8n-seg.pt epochs=100 imgsz=640

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

YOLO ์„ธ๋ถ„ํ™” ๋ฐ์ดํ„ฐ ์„ธํŠธ ํ˜•์‹์€ ๋ฐ์ดํ„ฐ ์„ธํŠธ ๊ฐ€์ด๋“œ์—์„œ ์ž์„ธํžˆ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ์กด ๋ฐ์ดํ„ฐ์…‹์„ ๋‹ค๋ฅธ ํ˜•์‹(์˜ˆ: COCO ๋“ฑ)์—์„œ YOLO ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋ ค๋ฉด JSON2YOLO ๋„๊ตฌ( Ultralytics)๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”.

Val

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

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolov8n-seg.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.box.map  # map50-95(B)
metrics.box.map50  # map50(B)
metrics.box.map75  # map75(B)
metrics.box.maps  # a list contains map50-95(B) of each category
metrics.seg.map  # map50-95(M)
metrics.seg.map50  # map50(M)
metrics.seg.map75  # map75(M)
metrics.seg.maps  # a list contains map50-95(M) of each category
yolo segment val model=yolov8n-seg.pt  # val official model
yolo segment val model=path/to/best.pt  # val custom model

์˜ˆ์ธก

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

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolov8n-seg.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 segment predict model=yolov8n-seg.pt source='https://ultralytics.com/images/bus.jpg'  # predict with official model
yolo segment predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg'  # predict with custom model

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

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

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

์˜ˆ

from ultralytics import YOLO

# Load a model
model = YOLO("yolov8n-seg.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=yolov8n-seg.pt format=onnx  # export official model
yolo export model=path/to/best.pt format=onnx  # export custom trained model

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

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

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



์ƒ์„ฑ 2023-11-12, ์—…๋ฐ์ดํŠธ 2024-05-18
์ž‘์„ฑ์ž: glenn-jocher (16), Burhan-Q (3), Laughing-q (1)

๋Œ“๊ธ€