Oriented Bounding Box Object Detection

Oriented Bounding Box Object Detection1. Model Introduction2. Start2.1. Enter docker2.2. Directed bounding box object detection: imageEffect preview2.3, directional border object detection: videoEffect preview2.4, directional border object detection: real-time detectionEffect previewReferences

Use Python to demonstrate the effect of Ultralytics: Oriented Bounding Boxes Object Detection in image, video, and real-time detection.

1. Model Introduction

Oriented Bounding Box Object Detection, also known as Oriented Object Detection, goes a step further than standard object detection. It introduces an additional angle to more accurately locate objects in the image.

The output of the oriented object detector is a set of rotated bounding boxes that accurately surround objects in the image, as well as the category label and confidence score of each bounding box. Oriented bounding boxes are particularly useful when objects appear at different angles, such as in aerial images, where traditional axis-aligned bounding boxes may include unnecessary background.

Simply put, oriented object detection can accurately surround tilted objects with tilted boxes, thereby reducing unnecessary background areas and improving detection accuracy.

2. Start

2.1. Enter docker

Run YOLOv11's docker script

2.2. Directed bounding box object detection: image

Use yolo11n-obb.pt to predict images under the ultralytics project (not the images that come with ultralytics).

Enter the code folder:

Run the code:

Effect preview

Yolo recognizes the output image location: /ultralytics/ultralytics/output/

1. View using jupyter lab

Open another terminal to enter the docker container and use jupyter lab to view the image

image-20250324155841464

image-20250324155023395

Access directly through http://localhost:8080/ in the system browser:

image-20250324191924451

2. Copy the file to the host machine for viewing

Enter the following command in the host terminal

image-20241231094016499

Sample code:

2.3, directional border object detection: video

Use yolo11n-obb.pt to predict the video under the ultralytics project (not the video that comes with ultralytics).

Enter the code folder:

Run the code:

Effect preview

Yolo recognizes the output video location: /ultralytics/ultralytics/output/

The output video will be displayed in real time during the code running. If you want to view the video later, you can refer to the above [2. Copy the file to the host machine for viewing] tutorial operation.

image-20241231104454064

Sample code:

2.4, directional border object detection: real-time detection

Use yolo11n-obb.pt to predict the USB camera screen.

Enter the code folder:

Run the code: click on the preview screen, press the q key to terminate the program!

Effect preview

Yolo recognizes the output video location: /ultralytics/ultralytics/output/

The camera screen will be displayed in real time during the code running. If you want to view the video later, you can refer to the above [2. Copy the file to the host machine for viewing] tutorial operation.

image-20241231105721479

Sample code:

References

https://docs.ultralytics.com/tasks/obb/