README.md

August 28, 2026 ยท View on GitHub

RiO-DETR: DETR for Real-time Oriented Object Detection

arXiv

RiO-DETR is a real-time DETR designed for oriented object detection, which solves foundamental issues in this area. It serves as a robust foundation for future research and applications in the field of real-time end-to-end oriented object detection.

Zhangchi Hu1, Yifan Zhao1, Yansong Peng1, Wenzhang Sun3, Xiangchen Yin1, Jie Chen1, Peixi Wu1, Hebei Li1โ€ , Xinghao Wang2, Dongsheng Jiang2, and Xiaoyan Sun1,4

1. University of Science and Technology of China
2. Huawei Technologies Co., Ltd.
3. Tsinghua University
4. Institute of Artificial Intelligence, Hefei Comprehensive National Science Center

๐Ÿ“ง Corresponding author: lihebei@mail.ustc.edu.cn

If you like our work, please give us a โญ!

screenshot-20260327-181717

๐Ÿ“ข A Note on the Release of RiO-DETR

Unfortunately, I am currently unable to release the complete research code.

I have always hoped to make the full implementation of RiO-DETR publicly available, and I began preparing the codebase for an open-source release at an early stage. However, due to intellectual property restrictions involving one of the collaborating institutions, I was not granted permission to release the parts of the codebase containing the specific technical improvements introduced in the paper.

This restriction does not reflect any change in my personal commitment to open research and reproducibility. I sincerely appreciate your understanding.

What Will Be Released

I will release a clean implementation of the core framework built upon RT-DETRv2. This release will include:

  • A baseline RT-DETR-OBB model;

  • A code architecture and supporting infrastructure that I have independently reorganized and optimized;

  • Pretrained weights, which will be uploaded progressively.

However, please note that this version will not include the paper-specific technical improvements affected by the intellectual property restrictions. As a result, there remains a performance gap between this foundational release and the full RiO-DETR implementation. I hope this foundational release can still provide the community with a useful starting point. I also warmly welcome the community to build upon this framework, independently reproduce the missing components, and share open implementations.

Good News: RiO-DETRv2 Is on the Way

We are excited to share that RiO-DETRv2 is already under development and will be published soon. This new version includes reworked architectural improvements and optimizations for bounding-box localization, and it will not be subject to the intellectual property restrictions mentioned above. Please stay tuned. ๐Ÿ”ฅ

๐Ÿš€ Updates

  • [2026.08.09] ๐ŸŽ‰ RiO-DETR is selected as an oral(spotlight) presentation!

  • [2026.07.31] We have released a clean implementation of the core RT-DETR-OBB framework, along with a selection of pretrained weights. More pretrained weights will be uploaded in the next few days.

  • [2026.06.20] ๐ŸŽ‰ RiO-DETR has been accepted to ECCV 2026!

  • [2026.03.10] Release paper on arxiv.

Model Zoo

DIOR-R

ModelmAPParamsConfigLogCheckpoint
RT-DETRv2-OBB-N62.743.97Mymlmetricsckpt
RT-DETRv2-OBB-S73.758.15Mymlmetricsckpt
RT-DETRv2-OBB-M75.6119.07Mymlmetricsckpt
RT-DETRv2-OBB-L75.6927.96Mymlmetricsckpt
RT-DETRv2-OBB-X76.5263.59Mymlmetricsckpt

Release metadata: manifest ยท metrics.

DOTA-v1.0 Single-Scale

The released checkpoints are selected by the highest completed VOC mAP (AP50) among the odd-epoch evaluations available through 2026-08-03. AP75 and COCO mAP below are reported for the same selected epoch.

ModelEpochAP50AP75COCO mAPParamsConfigLogsCheckpoint
RT-DETRv2-OBB-N15969.8235.2738.083.97Mymltrain ยท evalckpt
RT-DETRv2-OBB-S13978.1251.3648.638.15Mymltrain ยท evalckpt
RT-DETRv2-OBB-M10180.1254.2150.5719.06Mymltrain ยท evalckpt
RT-DETRv2-OBB-L9380.4854.9751.1827.95Mymltrain ยท evalckpt
RT-DETRv2-OBB-X6580.6356.7351.8563.57Mymltrain ยท evalckpt

Release metadata: manifest ยท metrics.

DOTA-v1.0 Multi-Scale

The released checkpoints are selected by the highest completed VOC mAP (AP50) among the submitted odd-epoch evaluations available through 2026-08-24. AP75 and COCO mAP below are reported for the same selected epoch.

ModelEpochAP50AP75COCO mAPParamsConfigLogsCheckpoint
RT-DETRv2-OBB-M4380.1554.6250.9419.06Mymltrain ยท evalckpt
RT-DETRv2-OBB-X3380.7254.6150.8663.57Mymltrain ยท evalckpt

Release metadata: manifest ยท metrics.

Original RiO-DETR Training and Evaluation Logs

For reference, we provide the console logs from the original RiO-DETR experiments. DOTA-v1.0 SS entries also include CSV evaluation metric tables. Machine-specific storage paths, user names, host names, and network addresses have been redacted from the published logs.

DatasetNSMLX
DIOR-Rlogloglogloglog
DOTA-v1.0 SStrain ยท evaltrain ยท evaltrain ยท evaltrain ยท evaltrain ยท eval
FAIR1M-2.0 MSโ€”โ€”logโ€”log

Getting Started

Installation

Create a Python environment, install a CUDA-compatible build of PyTorch and torchvision, and then install the remaining dependencies:

conda create -n rio-detr python=3.10 -y
conda activate rio-detr

# Install PyTorch and torchvision for your CUDA version first.
pip install -r requirements.txt

The HGNetV2 ImageNet-pretrained backbone weights are downloaded automatically on first use and cached under pretrain/hgnetv2/. If automatic downloading is unavailable, follow the URL printed by the program and place the downloaded file in that directory.

Data Preparation

DOTA-v1.0

Split the original DOTA images and polygon annotations into 1024 ร— 1024 patches using the standard DOTA patch naming convention. Both single-scale (SS) and multi-scale (MS) configurations are provided. Arrange the processed data as follows:

DOTA-v1.0/
โ”œโ”€โ”€ split_ss_dota/
โ”‚   โ”œโ”€โ”€ trainval/
โ”‚   โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”‚   โ””โ”€โ”€ annfiles/
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ”œโ”€โ”€ images/
โ”‚       โ””โ”€โ”€ annfiles/
โ””โ”€โ”€ split_ms_dota/
    โ”œโ”€โ”€ trainval/
    โ”‚   โ”œโ”€โ”€ images/
    โ”‚   โ””โ”€โ”€ annfiles/
    โ””โ”€โ”€ test/
        โ”œโ”€โ”€ images/
        โ””โ”€โ”€ annfiles/

Each annotation is a DOTA-format text file with one object per line:

x1 y1 x2 y2 x3 y3 x4 y4 class_name difficulty

Keep an empty matching annotation file for each unlabeled test image. Update the /path/to/DOTA-v1.0/... placeholders in:

  • configs/dataset/dota_1_ss_detection_offline.yml
  • configs/dataset/dota_1_ms_detection_offline.yml

The released training configurations use the offline evaluator. It merges patch predictions and writes a DOTA submission archive.

For automated checkpoint submission and evaluation on DOTA, we recommend DOTA-Auto-Eval. This companion repository streamlines submitting checkpoints during training.

DIOR-R

The released DIOR-R configurations expect the original images, oriented XML annotations, and train/validation/test split files:

DIOR/
โ”œโ”€โ”€ JPEGImages-trainval/
โ”œโ”€โ”€ JPEGImages-test/
โ”œโ”€โ”€ Annotations/
โ”‚   โ””โ”€โ”€ Oriented Bounding Boxes/
โ””โ”€โ”€ ImageSets/
    โ””โ”€โ”€ Main/
        โ”œโ”€โ”€ train.txt
        โ”œโ”€โ”€ val.txt
        โ””โ”€โ”€ test.txt

Update the img_folder, ann_folder, and ann_file entries in configs/dataset/dior_detection.yml to match your local dataset location. The checked-in paths use /path/to/DIOR/... placeholders and must be changed before training.

FAIR1M-2.0

Convert the FAIR1M oriented annotations to DOTA-style text files, split the large images into 1024 ร— 1024 patches, and use the FAIR1M-2.0 class names defined in engine/data/dataset/fair1m_dataset.py:

FAIR1M-2.0/
โ””โ”€โ”€ fair1m_split/
    โ”œโ”€โ”€ train/
    โ”‚   โ”œโ”€โ”€ images/
    โ”‚   โ””โ”€โ”€ annfiles/
    โ””โ”€โ”€ validation/
        โ”œโ”€โ”€ images/
        โ””โ”€โ”€ annfiles/

Update the /path/to/FAIR1M-2.0/... placeholders in configs/dataset/fair1m_2_ms_detection.yml. The FAIR1M configurations use the labeled validation split for local mAP evaluation.

Usage

Available Configurations

DatasetVariantsConfiguration
DIOR-RN, S, M, L, Xconfigs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{n,s,m,l,x}_diorr.yml
DOTA-v1.0 SSN, S, M, L, Xconfigs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{n,s,m,l,x}_dota_1_ss.yml
DOTA-v1.0 MSM, Xconfigs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{m,x}_dota_1_ms.yml
FAIR1M-2.0 MSM, Xconfigs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{m,x}_fair1m_2_ms.yml

Training

To train it on one GPU:

CUDA_VISIBLE_DEVICES=0 torchrun \
  --master_port=7001 \
  --nproc_per_node=1 \
  train.py \
  -c configs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{}.yml \
  --use-amp \
  --seed=0

For multi-GPU training, expose the desired devices and set --nproc_per_node to the number of GPUs. The total_batch_size in the YAML configuration is divided across all processes:

CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun \
  --master_port=7001 \
  --nproc_per_node=4 \
  train.py \
  -c configs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{}.yml \
  --use-amp \
  --seed=0

To resume an interrupted run:

CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun \
  --master_port=7001 \
  --nproc_per_node=4 \
  train.py \
  -c configs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{}.yml \
  --use-amp \
  --seed=0 \
  -r outputs/rtdetrv2_obb_hgnetv2_{}/last.pth

Checkpoints and training logs are written to the output_dir declared in the selected configuration. You can override it with --output-dir.

Evaluation

Evaluate a checkpoint on the validation/test split with:

CUDA_VISIBLE_DEVICES=0 torchrun \
  --master_port=7001 \
  --nproc_per_node=1 \
  train.py \
  -c configs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{}.yml \
  --test-only \
  -r /path/to/checkpoint.pth

The equivalent convenience command is:

bash test.sh /path/to/checkpoint.pth \
  configs/rtdetrv2_obb/rtdetrv2_obb_hgnetv2_{}.yml

For DOTA-v1.0, the offline evaluator stores merged submission archives under <output_dir>/dota_results/. DIOR-R and FAIR1M-2.0 report local mAP when ground-truth annotations are available.

TensorRT FP16 Latency Benchmark

tools/deployment/benchmark_tensorrt_latency.py reproduces the latency measurement used for RiO-DETR on Tesla T4. It uses GPU-resident input/output buffers and CUDA events, so the reported latency covers TensorRT execution only; preprocessing, host/device copies, NMS, and host-side postprocessing are excluded.

Install the deployment dependencies and benchmark one or more TensorRT 10 engines. Repeat --engine to compare multiple model variants:

pip install -r tools/benchmark/requirements.txt

CUDA_VISIBLE_DEVICES=0 python tools/deployment/benchmark_tensorrt_latency.py \
  --engine RT-DETRv2-OBB-S=/path/to/model_s_fp16.engine \
  --engine RT-DETRv2-OBB-M=/path/to/model_m_fp16.engine \
  --require-fp16-io \
  --warmup 100 \
  --runs 300 \
  --trials 5 \
  --json-out outputs/tensorrt_latency.json

Use --cuda-graph to benchmark CUDA Graph replay. The optional --require-fp16-io check rejects engines whose floating-point bindings are not FP16.

Citation

If you use RiO-DETR or its methods in your work, please cite the following BibTeX entries:

bibtex
@article{hu2026rio,
  title={RiO-DETR: DETR for Real-time Oriented Object Detection},
  author={Hu, Zhangchi and Zhao, Yifan and Peng, Yansong and Sun, Wenzhang and Yin, Xiangchen and Chen, Jie and Wu, Peixi and Li, Hebei and Wang, Xinghao and Jiang, Dongsheng and others},
  journal={arXiv preprint arXiv:2603.09411},
  year={2026}
}

Acknowledgement

Our work is built upon RT-DETRv4. Thanks to the inspirations from RT-DETRv4, D-FINE, DEIMv2, and RHINO.

โœจ Feel free to contribute and reach out if you have any questions! โœจ