Skip to content

Oriented Bounding Boxes Object Detection

Oriented object detection goes a step further than object detection and introduce an extra angle to locate objects more accurate in an image.

The output of an oriented object detector is a set of rotated bounding boxes that exactly enclose the objects in the image, along with class labels and confidence scores for each box. Object detection is a good choice when you need to identify objects of interest in a scene, but don't need to know exactly where the object is or its exact shape.

Tip

YOLO11 OBB models use the -obb suffix, i.e. yolo11n-obb.pt and are pretrained on DOTAv1.



Watch: Object Detection using Ultralytics YOLO Oriented Bounding Boxes (YOLO-OBB)

Visual Samples

Ships Detection using OBBVehicle Detection using OBB
Ships Detection using OBBVehicle Detection using OBB

Models

YOLO11 pretrained OBB models are shown here, which are pretrained on the DOTAv1 dataset.

Models download automatically from the latest Ultralytics release on first use.

Modelsize
(pixels)
mAPtest
50
Speed
CPU ONNX
(ms)
Speed
T4 TensorRT10
(ms)
params
(M)
FLOPs
(B)
YOLO11n-obb102478.4117.6 ± 0.84.4 ± 0.02.717.2
YOLO11s-obb102479.5219.4 ± 4.05.1 ± 0.09.757.5
YOLO11m-obb102480.9562.8 ± 2.910.1 ± 0.420.9183.5
YOLO11l-obb102481.0712.5 ± 5.013.5 ± 0.626.2232.0
YOLO11x-obb102481.31408.6 ± 7.728.6 ± 1.058.8520.2
  • mAPtest values are for single-model multiscale on DOTAv1 dataset.
    Reproduce by yolo val obb data=DOTAv1.yaml device=0 split=test and submit merged results to DOTA evaluation.
  • Speed averaged over DOTAv1 val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val obb data=DOTAv1.yaml batch=1 device=0|cpu

Train

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

Example

from ultralytics import YOLO

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

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

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

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



Watch: How to Train Ultralytics YOLO-OBB (Oriented Bounding Boxes) Models on DOTA Dataset using Ultralytics HUB

Dataset format

OBB dataset format can be found in detail in the Dataset Guide.

Val

Validate trained YOLO11n-obb model accuracy on the DOTA8 dataset. No arguments are needed as the model retains its training data and arguments as model attributes.

Example

from ultralytics import YOLO

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

# Validate the model
metrics = model.val(data="dota8.yaml")  # 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
yolo obb val model=yolo11n-obb.pt data=dota8.yaml  # val official model
yolo obb val model=path/to/best.pt data=path/to/data.yaml  # val custom model

Predict

Use a trained YOLO11n-obb model to run predictions on images.

Example

from ultralytics import YOLO

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



Watch: How to Detect and Track Storage Tanks using Ultralytics YOLO-OBB | Oriented Bounding Boxes | DOTA

See full predict mode details in the Predict page.

Export

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

Example

from ultralytics import YOLO

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

Available YOLO11-obb export formats are in the table below. You can export to any format using the format argument, i.e. format='onnx' or format='engine'. You can predict or validate directly on exported models, i.e. yolo predict model=yolo11n-obb.onnx. Usage examples are shown for your model after export completes.

Formatformat ArgumentModelMetadataArguments
PyTorch-yolo11n-obb.pt-
TorchScripttorchscriptyolo11n-obb.torchscriptimgsz, optimize, batch
ONNXonnxyolo11n-obb.onnximgsz, half, dynamic, simplify, opset, batch
OpenVINOopenvinoyolo11n-obb_openvino_model/imgsz, half, int8, batch
TensorRTengineyolo11n-obb.engineimgsz, half, dynamic, simplify, workspace, int8, batch
CoreMLcoremlyolo11n-obb.mlpackageimgsz, half, int8, nms, batch
TF SavedModelsaved_modelyolo11n-obb_saved_model/imgsz, keras, int8, batch
TF GraphDefpbyolo11n-obb.pbimgsz, batch
TF Litetfliteyolo11n-obb.tfliteimgsz, half, int8, batch
TF Edge TPUedgetpuyolo11n-obb_edgetpu.tfliteimgsz
TF.jstfjsyolo11n-obb_web_model/imgsz, half, int8, batch
PaddlePaddlepaddleyolo11n-obb_paddle_model/imgsz, batch
MNNmnnyolo11n-obb.mnnimgsz, batch, int8, half
NCNNncnnyolo11n-obb_ncnn_model/imgsz, half, batch
IMX500imxyolo11n-obb_imx_model/imgsz, int8

See full export details in the Export page.

FAQ

What are Oriented Bounding Boxes (OBB) and how do they differ from regular bounding boxes?

Oriented Bounding Boxes (OBB) include an additional angle to enhance object localization accuracy in images. Unlike regular bounding boxes, which are axis-aligned rectangles, OBBs can rotate to fit the orientation of the object better. This is particularly useful for applications requiring precise object placement, such as aerial or satellite imagery (Dataset Guide).

How do I train a YOLO11n-obb model using a custom dataset?

To train a YOLO11n-obb model with a custom dataset, follow the example below using Python or CLI:

Example

from ultralytics import YOLO

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

# Train the model
results = model.train(data="path/to/custom_dataset.yaml", epochs=100, imgsz=640)
yolo obb train data=path/to/custom_dataset.yaml model=yolo11n-obb.pt epochs=100 imgsz=640

For more training arguments, check the Configuration section.

What datasets can I use for training YOLO11-OBB models?

YOLO11-OBB models are pretrained on datasets like DOTAv1 but you can use any dataset formatted for OBB. Detailed information on OBB dataset formats can be found in the Dataset Guide.

How can I export a YOLO11-OBB model to ONNX format?

Exporting a YOLO11-OBB model to ONNX format is straightforward using either Python or CLI:

Example

from ultralytics import YOLO

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

# Export the model
model.export(format="onnx")
yolo export model=yolo11n-obb.pt format=onnx

For more export formats and details, refer to the Export page.

How do I validate the accuracy of a YOLO11n-obb model?

To validate a YOLO11n-obb model, you can use Python or CLI commands as shown below:

Example

from ultralytics import YOLO

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

# Validate the model
metrics = model.val(data="dota8.yaml")
yolo obb val model=yolo11n-obb.pt data=dota8.yaml

See full validation details in the Val section.

📅 Created 10 months ago ✏️ Updated 26 days ago

Comments