Standard object detectors draw axis-aligned boxes — great for people and cars shot head-on, useless for a plane parked diagonally on a runway. Oriented Bounding Box (OBB) detection fixes that by predicting rotated rectangles that follow each object's heading. This project runs Ultralytics YOLO-OBB models on NVIDIA DeepStream 9.0, so you get a full, hardware-accelerated video pipeline where DeepStream handles parsing and rendering of those rotated boxes for you.

Repo: github.com/Vishnu-RM-2001/deepstream-obb

What is OBB detection?

An axis-aligned box has 4 numbers (x, y, w, h). An oriented box adds an angle, so it can tightly wrap a rotated object. This matters most in aerial and satellite imagery, where aircraft, ships, vehicles, and sports courts appear at every angle. Tighter boxes mean less background inside the box, cleaner overlap handling, and an actual heading you can use downstream.

Why DeepStream?

  • End-to-end GPU pipeline — decode → batch → inference → render, all on the GPU.
  • Built-in OBB parserNvDsInferParseCustomYoloV11OBB handles decoding, confidence filtering, and NMS.
  • Native rotated-box renderingnvdsosd draws the angled boxes automatically.
  • Config-driven — almost no code; you mostly edit text config files.

What you need

Host machine

  • NVIDIA GPU with driver ≥ 590.48.01
  • Docker + NVIDIA Container Toolkit
  • Python 3 with the Ultralytics library

Inside the DeepStream 9.0 container

  • Ubuntu 24.04 · CUDA 13.1 · TensorRT 10.14 · GStreamer 1.24.2

Setup

1. Pull the DeepStream image

docker pull nvcr.io/nvidia/deepstream:9.0-samples-multiarch

2. Export your YOLO-OBB model to ONNX

pip install ultralytics
mkdir -p models && cd models

# YOLOv8-OBB
python3 -c "from ultralytics import YOLO; YOLO('yolov8n-obb.pt').export(format='onnx', imgsz=1024, opset=20)"

# Or YOLO11-OBB
# python3 -c "from ultralytics import YOLO; YOLO('yolo11n-obb.pt').export(format='onnx', imgsz=1024, opset=20)"

cd ..
mkdir -p output

Then update configs/config_pgie_yolo_obb.txt with your exported ONNX filename.

3. Run the pipeline

docker run --rm --gpus all \
  -v "$PWD":/workspace -w /workspace/configs \
  -e LD_LIBRARY_PATH=/opt/nvidia/deepstream/deepstream/lib \
  nvcr.io/nvidia/deepstream:9.0-samples-multiarch \
  deepstream-app -c config_deepstream_app.txt

On the first run, TensorRT builds an optimized engine from the ONNX model (this takes a minute), then DeepStream processes the video and writes the result to output/.

Key config settings

The important bits live in config_pgie_yolo_obb.txt:

PropertyValuePurpose
net-scale-factor0.00392156971/255 pixel normalization
model-color-format0RGB input
num-detected-classes15DOTAv1 classes
network-mode2FP16 precision
maintain-aspect-ratio0Stretch to network input
cluster-mode4No clustering — parser does NMS
parse-bbox-func-nameNvDsInferParseCustomYoloV11OBBBuilt-in OBB parser

Running on your own videos

Drop a video into ./data/ and point the app config at it in configs/config_deepstream_app.txt:

[source0]
uri=file:///workspace/data/your_video.mp4

[streammux]
width=1920
height=1080

Then re-run the same Docker command.

Swapping model sizes

Speed vs. accuracy is a one-line change. Export a different size (n / s / m / l / x) with the same command and update the filename in the config:

  • yolov8n-obb / yolo11n-obb — fastest, lightest
  • yolov8x-obb / yolo11x-obb — most accurate

Where this fits

  • Aerial & satellite imagery analysis
  • Defense and surveillance (aircraft, ships, vehicles)
  • Drone / UAV video pipelines
  • Traffic and parking-lot monitoring from above
  • Any scene where objects appear at arbitrary angles
Takeaway: YOLO-OBB gives you rotated detections; DeepStream gives you a GPU-accelerated, config-driven video pipeline to run them at scale. Export to ONNX, point the config at your model and video, and DeepStream parses and draws the oriented boxes for you. Start with the n model, then scale up once you've hit your accuracy and speed targets.

Source code & full instructions: github.com/Vishnu-RM-2001/deepstream-obb — MIT licensed (YOLO weights need an Ultralytics commercial license for commercial use; DOTA demo imagery is academic-use only).