Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

RF-DETR: SOTA Real-Time Object Detection Model

version downloads python-version license

hf space colab roboflow discord

RF-DETR is a real-time, transformer-based object detection model architecture developed by Roboflow and released under the Apache 2.0 license.

RF-DETR is the first real-time model to exceed 60 AP on the Microsoft COCO benchmark alongside competitive performance at base sizes. It also achieves state-of-the-art performance on RF100-VL, an object detection benchmark that measures model domain adaptability to real world problems. RF-DETR is fastest and most accurate for its size when compared current real-time objection models.

RF-DETR is small enough to run on the edge using Inference, making it an ideal model for deployments that need both strong accuracy and real-time performance.

Read the documentation to get started training.

News

  • 2025/07/23: We release three new checkpoints for RF-DETR: Nano, Small, and Medium.
    • RF-DETR Base is now deprecated. We recommend using RF-DETR Medium which offers subtantially better accuracy at comparable latency.
  • 2025/03/20: We release RF-DETR real-time object detection model. Code and checkpoint for RF-DETR-large and RF-DETR-base are available.
  • 2025/04/03: We release early stopping, gradient checkpointing, metrics saving, training resume, TensorBoard and W&B logging support.
  • 2025/05/16: We release an 'optimize_for_inference' method which speeds up native PyTorch by up to 2x, depending on platform.
  • 2025/07/23: We release new SOTA model sizes: RF-DETR-Nano, RF-DETR-Small, RF-DETR-Medium.

Results

RF-DETR achieves state-of-the-art performance on both the Microsoft COCO and the RF100-VL benchmarks.

The table below shows the performance of RF-DETR medium, compared to comparable medium models:

rf-detr-coco-rf100-vl-9

family size coco_map50 coco_map50@95 rf100vl_map50 rv100vl_map50@95 latency
RF-DETR Nano 67.6 48.4 84.1 57.1 2.32
RF-DETR Small 72.1 53.0 85.9 59.6 3.52
RF-DETR Medium 73.6 54.7 86.6 60.6 4.52
YOLO11 n 52.0 37.4 81.4 55.3 2.49
YOLO11 s 59.7 44.4 82.3 56.2 3.16
YOLO11 m 64.1 48.6 82.5 56.5 5.13
YOLO11 l 65.3 50.2 x x 6.65
YOLO11 x 66.5 51.2 x x 11.92
LW-DETR Tiny 60.7 42.9 x x 1.91
LW-DETR Small 66.8 48.0 84.5 58.0 2.62
LW-DETR Medium 72.0 52.6 85.2 59.4 4.49
D-FINE Nano 60.2 42.7 83.6 57.7 2.12
D-FINE Small 67.6 50.7 84.5 59.9 3.55
D-FINE Medium 72.6 55.1 84.6 60.2 5.68

See our benchmark notes in the RF-DETR documentation.

We are actively working on RF-DETR Large and X-Large models using the same techniques we used to achieve the strong accuracy that RF-DETR Medium attains. This is why RF-DETR Large and X-Large is not yet reported on our pareto charts and why we haven't benchmarked other models at similar sizes. Check back in the next few weeks for the launch of new RF-DETR Large and X-Large models.

Installation

To install RF-DETR, install the rfdetr package in a Python>=3.9 environment with pip:

pip install rfdetr
Install from source

By installing RF-DETR from source, you can explore the most recent features and enhancements that have not yet been officially released. Please note that these updates are still in development and may not be as stable as the latest published release.

pip install git+https://github.com/roboflow/rf-detr.git

Inference

The easiest path to deployment is using Roboflow's Inference package.

The code below lets you run rfdetr-base on an image:

import os
import supervision as sv
from inference import get_model
from PIL import Image
from io import BytesIO
import requests

url = "https://media.roboflow.com/dog.jpeg"
image = Image.open(BytesIO(requests.get(url).content))

model = get_model("rfdetr-base")

predictions = model.infer(image, confidence=0.5)[0]

detections = sv.Detections.from_inference(predictions)

labels = [prediction.class_name for prediction in predictions.predictions]

annotated_image = image.copy()
annotated_image = sv.BoxAnnotator(color=sv.ColorPalette.ROBOFLOW).annotate(annotated_image, detections)
annotated_image = sv.LabelAnnotator(color=sv.ColorPalette.ROBOFLOW).annotate(annotated_image, detections, labels)

Predict

You can also use the .predict method to perform inference during local development. The .predict() method accepts various input formats, including file paths, PIL images, NumPy arrays, and torch tensors. Please ensure inputs use RGB channel order. For torch.Tensor inputs specifically, they must have a shape of (3, H, W) with values normalized to the [0..1) range. If you don't plan to modify the image or batch size dynamically at runtime, you can also use .optimize_for_inference() to get up to 2x end-to-end speedup, depending on platform.

import io
import requests
import supervision as sv
from PIL import Image
from rfdetr import RFDETRBase
from rfdetr.util.coco_classes import COCO_CLASSES

model = RFDETRBase()

model = model.optimize_for_inference()

url = "https://media.roboflow.com/notebooks/examples/dog-2.jpeg"

image = Image.open(io.BytesIO(requests.get(url).content))
detections = model.predict(image, threshold=0.5)

labels = [
    f"{COCO_CLASSES[class_id]} {confidence:.2f}"
    for class_id, confidence
    in zip(detections.class_id, detections.confidence)
]

annotated_image = image.copy()
annotated_image = sv.BoxAnnotator().annotate(annotated_image, detections)
annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections, labels)

sv.plot_image(annotated_image)

Train a Model

You can fine-tune an RF-DETR Nano, Small, Medium, and Base model with a custom dataset using the rfdetr Python package.

Read our training tutorial to get started

Documentation

Visit our documentation website to learn more about how to use RF-DETR.

License

Both the code and the weights pretrained on the COCO dataset are released under the Apache 2.0 license.

Acknowledgements

Our work is built upon LW-DETR, DINOv2, and Deformable DETR. Thanks to their authors for their excellent work!

Citation

If you find our work helpful for your research, please consider citing the following BibTeX entry.

@software{rf-detr,
  author = {Robinson, Isaac and Robicheaux, Peter and Popov, Matvei},
  license = {Apache-2.0},
  title = {RF-DETR},
  howpublished = {\url{https://github.com/roboflow/rf-detr}},
  year = {2025},
  note = {SOTA Real-Time Object Detection Model}
}

Contribute

We welcome and appreciate all contributions! If you notice any issues or bugs, have questions, or would like to suggest new features, please open an issue or pull request. By sharing your ideas and improvements, you help make RF-DETR better for everyone.

Metadata

Release files for rfdetr 1.2.0rc0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rfdetr 1.2.0rc0
File Size Uploaded
rfdetr-1.2.0rc0.tar.gz 114.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rfdetr 1.2.0rc0
File Interpreter ABI Platform
rfdetr-1.2.0rc0-py3-none-any.whl Python 3 none any Details

Total release size: 245.4 kB

Release files / rfdetr-1.2.0rc0.tar.gz

Download URL rfdetr-1.2.0rc0.tar.gz
Size 114.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1f33c6a9b82eeb89d768e044c05ea339babe2c1a9757da05434013b05ec0e5a1
BLAKE2b-256 checksum
How to use checksums
4c8e92964d0b546866f3c5e4ddd7468cad8ad4d432fb1085379daa298aa4a5b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2025.

Transparency log

Release files / rfdetr-1.2.0rc0-py3-none-any.whl

Download URL rfdetr-1.2.0rc0-py3-none-any.whl
Size 131.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6120625e424a8b795e31ac95c5dceb27e082b450b6a60f690cbf028adc5879d0
BLAKE2b-256 checksum
How to use checksums
db29322b25b2ff7220d34a25ba6e4e97c413f67d01e4fd34499f3a9ca0892fbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2025.

Transparency log

Release history Release notifications | RSS feed

1.11.1

2 release files

1.11.0

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

This release

1.2.0rc0 This release

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page