콘텐츠로 건너뛰기

물체 감지

물체 감지 예시

Object detection is a task that involves identifying the location and class of objects in an image or video stream.

객체 감지기의 출력은 이미지에서 객체를 둘러싸는 경계 상자 집합과 각 상자에 대한 클래스 레이블 및 신뢰도 점수로 구성됩니다. 객체 감지는 장면에서 관심 있는 객체를 식별해야 하지만 객체의 정확한 위치나 모양을 정확히 알 필요는 없는 경우에 적합한 선택입니다.



Watch: Object Detection with Pre-trained Ultralytics YOLO Model.

YOLO11 Detect models are the default YOLO11 models, i.e. yolo11n.pt 에 대해 사전 교육을 받았으며 COCO.

모델

YOLO11 pretrained Detect models are shown here. Detect, Segment and Pose models are pretrained on the COCO dataset, while Classify models are pretrained on the ImageNet dataset.

모델은 처음 사용할 때 최신 Ultralytics 릴리스에서 자동으로 다운로드됩니다.

모델크기
(픽셀)
mAPval
50-95
속도
CPU ONNX
(ms)
Speed
T4 TensorRT10
(ms)
매개변수
(M)
FLOPs
(B)
YOLO11n64039.556.1 ± 0.81.5 ± 0.02.66.5
YOLO11s64047.090.0 ± 1.22.5 ± 0.09.421.5
YOLO11m64051.5183.2 ± 2.04.7 ± 0.120.168.0
YOLO11l64053.4238.6 ± 1.46.2 ± 0.125.386.9
YOLO11x64054.7462.8 ± 6.711.3 ± 0.256.9194.9
  • mAPval 값은 단일 모델 단일 스케일에 대한 것입니다. COCO val2017 데이터 세트.
    복제 대상 yolo val detect data=coco.yaml device=0
  • 속도 를 사용하여 COCO 값 이미지에 대한 평균을 구합니다. Amazon EC2 P4d 인스턴스.
    복제 대상 yolo val detect data=coco.yaml batch=1 device=0|cpu

기차

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

from ultralytics import YOLO

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

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

# Start training from a pretrained *.pt model
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640

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

데이터 집합 형식

YOLO 탐지 데이터 세트 형식은 데이터 세트 가이드에서 자세히 확인할 수 있습니다. 기존 데이터셋을 다른 형식(예: COCO 등)에서 YOLO 형식으로 변환하려면 JSON2YOLO 도구( Ultralytics)를 사용하세요.

Val

Validate trained YOLO11n model accuracy on the COCO8 dataset. No arguments are needed as the model 교육 유지 data 및 인수를 모델 속성으로 사용합니다.

from ultralytics import YOLO

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

예측

Use a trained YOLO11n model to run predictions on images.

from ultralytics import YOLO

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

전체 보기 predict 모드 세부 정보에서 예측 페이지로 이동합니다.

내보내기

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

from ultralytics import YOLO

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

Available YOLO11 export formats are in the table below. You can export to any format using the format 인수, 즉 format='onnx' 또는 format='engine'. 내보낸 모델에서 직접 예측하거나 유효성을 검사할 수 있습니다. yolo predict model=yolo11n.onnx. 내보내기가 완료된 후 모델에 대한 사용 예가 표시됩니다.

형식format 인수모델메타데이터인수
PyTorch-yolo11n.pt-
TorchScripttorchscriptyolo11n.torchscriptimgsz, optimize, batch
ONNXonnxyolo11n.onnximgsz, half, dynamic, simplify, opset, batch
OpenVINOopenvinoyolo11n_openvino_model/imgsz, half, int8, batch
TensorRTengineyolo11n.engineimgsz, half, dynamic, simplify, workspace, int8, batch
CoreMLcoremlyolo11n.mlpackageimgsz, half, int8, nms, batch
TF SavedModelsaved_modelyolo11n_saved_model/imgsz, keras, int8, batch
TF GraphDefpbyolo11n.pbimgsz, batch
TF Litetfliteyolo11n.tfliteimgsz, half, int8, batch
TF Edge TPUedgetpuyolo11n_edgetpu.tfliteimgsz
TF.jstfjsyolo11n_web_model/imgsz, half, int8, batch
PaddlePaddlepaddleyolo11n_paddle_model/imgsz, batch
NCNNncnnyolo11n_ncnn_model/imgsz, half, batch

전체 보기 export 세부 정보에서 내보내기 페이지로 이동합니다.

자주 묻는 질문

How do I train a YOLO11 model on my custom dataset?

Training a YOLO11 model on a custom dataset involves a few steps:

  1. 데이터 집합을 준비합니다: 데이터 세트가 YOLO 형식인지 확인합니다. 지침은 데이터 세트 가이드를 참조하세요.
  2. 모델을 로드합니다: Ultralytics YOLO 라이브러리를 사용하여 사전 학습된 모델을 로드하거나 YAML 파일에서 새 모델을 생성합니다.
  3. 모델 훈련: 실행 train 메서드 또는 Python 또는 yolo detect train 명령으로 CLI.

from ultralytics import YOLO

# Load a pretrained model
model = YOLO("yolo11n.pt")

# Train the model on your custom dataset
model.train(data="my_custom_dataset.yaml", epochs=100, imgsz=640)
yolo detect train data=my_custom_dataset.yaml model=yolo11n.pt epochs=100 imgsz=640

자세한 구성 옵션은 구성 페이지를 참조하세요.

What pretrained models are available in YOLO11?

Ultralytics YOLO11 offers various pretrained models for object detection, segmentation, and pose estimation. These models are pretrained on the COCO dataset or ImageNet for classification tasks. Here are some of the available models:

자세한 목록과 성능 지표는 모델 섹션을 참조하세요.

How can I validate the accuracy of my trained YOLO model?

To validate the accuracy of your trained YOLO11 model, you can use the .val() 메서드 또는 Python 또는 yolo detect val CLI명령을 실행합니다. 그러면 mAP50-95, mAP50 등과 같은 메트릭이 제공됩니다.

from ultralytics import YOLO

# Load the model
model = YOLO("path/to/best.pt")

# Validate the model
metrics = model.val()
print(metrics.box.map)  # mAP50-95
yolo detect val model=path/to/best.pt

자세한 인증 정보는 Val 페이지에서 확인하세요.

What formats can I export a YOLO11 model to?

Ultralytics YOLO11 allows exporting models to various formats such as ONNX, TensorRT, CoreML, and more to ensure compatibility across different platforms and devices.

from ultralytics import YOLO

# Load the model
model = YOLO("yolo11n.pt")

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

내보내기 페이지에서 지원되는 형식의 전체 목록과 지침을 확인하세요.

Why should I use Ultralytics YOLO11 for object detection?

Ultralytics YOLO11 is designed to offer state-of-the-art performance for object detection, segmentation, and pose estimation. Here are some key advantages:

  1. 사전 학습된 모델: COCO 및 ImageNet과 같은 인기 있는 데이터 세트에서 사전 학습된 모델을 활용하여 더 빠르게 개발할 수 있습니다.
  2. 높은 정확도: 인상적인 맵 점수를 달성하여 신뢰할 수 있는 물체 감지를 보장합니다.
  3. 속도: 실시간 추론에 최적화되어 있어 신속한 처리가 필요한 애플리케이션에 이상적입니다.
  4. 유연성: 여러 플랫폼에 배포할 수 있도록 ONNX , TensorRT 등 다양한 형식으로 모델을 내보낼 수 있습니다.

Explore our Blog for use cases and success stories showcasing YOLO11 in action.

📅 Created 11 months ago ✏️ Updated 20 days ago

댓글