사용법 (학습·추론)
사용법 (학습·추론)
Ultralytics의 YOLO 클래스로 YOLO11을 아주 간단하게 다룰 수 있어요. COCO 사전학습 모델을 불러와 학습하고, 추론도 같은 인터페이스로 해요.
학습
from ultralytics import YOLO
# COCO 사전학습 YOLO11n 모델 로드
model = YOLO("yolo11n.pt")
# COCO8 예제 데이터셋으로 100 epoch 학습
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
추론 (Predict)
from ultralytics import YOLO
# 사전학습 모델 로드
model = YOLO("yolo11n.pt")
# 이미지에서 추론
results = model("https://ultralytics.com/images/bus.jpg")
# 결과 처리
for r in results:
boxes = r.boxes # Boxes object for bbox outputs
masks = r.masks # Masks object for segmentation masks outputs
probs = r.probs # Class probabilities for classification outputs
모드 안내
학습(Train), 검증(Val), 추론(Predict), 내보내기(Export) 등 각 모드의 상세한 옵션은 Ultralytics 문서의 각 페이지에서 확인할 수 있어요. 모델 파일(yolo11n.pt) 등은 Ultralytics Assets 릴리스에서 제공돼요.