rf-detr

roboflowApache-2.0活跃维护

RF-DETR 是 Roboflow 推出的实时目标检测与实例分割模型架构,在 COCO 上达到 SOTA,适合直接微调落地。

RF-DETR is a real-time object detection and segmentation model architecture developed by Roboflow, SOTA on COCO, designed for fine-tuning. [ICLR 2026]

1.12.0发布于 2026-11-06 14:07 UTC10,031star +30 / 7 天1,269fork同步于 2026-11-10 17:30 UTC

怎么上手

由 README 提炼,执行前请确认
pip install rfdetr
硬件要求按 README 说明

README 未说明显存要求;基准延迟在 NVIDIA T4 上用 TensorRT FP16、batch size 1 测得,未提及 CPU 或其他 GPU 厂商支持情况

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Roboflow 开源的实时目标检测/分割/关键点模型,基于 DINOv2,主打微调后精度与延迟的平衡

RF-DETR 是 Roboflow 推出的实时目标检测与实例分割模型架构,在 COCO 上达到 SOTA,适合直接微调落地。

核心能力

  • 基于 DINOv2 视觉 Transformer 骨干网络
  • 检测、实例分割、关键点检测共用一套 API
  • 提供 Nano 到 2XL 多档模型尺寸
  • 用 NAS 搜索架构,COCO 与 RF100-VL 上精度领先
  • Apache 2.0 授权,可直接商用闭源产品

容易踩的坑

需要 Python>=3.10 环境;Atto/Femto/Pico/XL/2XL 检测模型需额外安装 rfdetr[plus],且商用自托管需 Enterprise 附加许可;从源码安装的是 develop 分支,稳定性不如正式发布版

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本1.12.0
  1. 1.12.0v1.12.0: One prediction API and INT8 exports最新正式版2026-11-06 · 2026-11-06 14:07 UTC

    RF-DETR 1.12.0 gives native and exported models one prediction API, adds INT8 exports, and speeds up inference on CUDA and Apple Silicon.

    • Predict from images, folders, video files, cameras, and RTSP streams through one RFDETRInference API for native and exported models.
    • Export INT8 engines for TensorRT, ONNX, and OpenVINO with quantization="int8".
    • Get faster default inference: CUDA graphs on CUDA, inductor on Apple silicon, and batches prepared while the last one runs.
    • Set a confidence threshold per class with ClassThresholds.

    Eight behavior changes need a look, mostly RFDETR.inference() returning a predictor and stricter Kornia training settings; see the Migration guide. Unknown predict() keywords and TRTInference are deprecated.

    ✨ Spotlights / highlights

    One prediction API for native and exported models

    RFDETRInference runs a live model, a native checkpoint or any supported export through the same preprocessing and decoding, and returns Supervision detections. It reads directories, globs, video files, cameras, RTSP and .streams manifests, and stream=True yields results as they arrive. (#1563, #1577)

    from rfdetr import RFDETRInference, RFDETRSmall
    
    predictor = RFDETRSmall().inference()  # independent, compiled snapshot
    detections = predictor.predict("image.jpg")
    
    onnx = RFDETRInference("output/inference_model.onnx")
    for result in onnx.predict("video.mp4", stream=True):
        ...
    

    Performance per hardware

    RFDETRSmall, batch 1, end to end (preprocessing, forward, postprocessing) through RFDETRInference or the inference() snapshot. Compare within a row, not across machines.

    HardwareFastest routePrecisionLatency [ms]FPS [img/s]
    NVIDIA L4TensorRT .trt enginefp163.57280
    Apple M4 Max (40-core GPU)inference() inductorfp1610.397.4
    x86 CPU (Colab, 4 cores / 8 threads)OpenVINO IRfp32373.72.7

    On the L4 the inference() CUDA graph in fp16 reaches 3.60 ms, level with the engine at batch 1. On the M4 Max inference() inductor in fp16 runs 10.3 ms against 20.0 ms for eager predict(). On x86 the run-to-run spread is 10 to 17% of the mean, so gaps under about 100 ms are noise. Results for NVIDIA T4, A100 and RTX PRO 6000 and for all four model sizes are in the "Measured Performance by Hardware" section of the export docs index; the mobile and edge CPU tables are pending a rerun.

    INT8 exports for TensorRT, ONNX and OpenVINO

    quantization="int8" with calibration_data builds INT8 TensorRT engines for detection, segmentation and keypoint models, and static INT8 for ONNX and OpenVINO. On an RTX 5070 and a Tesla T4, TensorRT INT8 ran 1.08× to 1.41× faster than FP16 and was 25% to 39% smaller, at a cost of 0.27 to 1.01 AP points at batch 1. (#1595, #1627, #1560)

    model.export(format="tensorrt", quantization="int8", calibration_data="path/to/images", batch_size=8)
    

    Faster default inference

    RFDETR.inference() now captures a CUDA graph on CUDA and compiles with inductor on MPS. CUDA prediction prepares the next batch while the current one runs and decodes baseline JPEG batches with nvjpeg. In one benchmark (L4, RF-DETR Nano, FP16, batch 1), CUDA graph replay cut median end-to-end latency from 9.719 ms to 3.884 ms with identical COCO AP. (#1547, #1668, #1670, #1672)

    Per-class confidence thresholds

    Name the classes that need their own bar and give the rest a default. (#1635)

    from rfdetr import ClassThresholds
    
    detections = model.predict(image, threshold=ClassThresholds({"person": 0.35, "traffic light": 0.6}, default=0.5))
    

    Smaller Plus models and a backbone registry

    RFDETRAtto, RFDETRFemto and RFDETRPico ship through rfdetr_plus (pip install "rfdetr[plus]", Platform Model License 1.0: commercial use is included when deploying on Roboflow, and commercial self-ho

  2. 1.11.2v1.11.2: Safer Threaded Inference and Training Inputs2026-10-04 · 2026-10-04 11:22 UTC
    查看更新说明

    1.11.2 hardens threaded inference, turns a silent class-name shift into an error, and fixes predict() on flipped frames.

    • Threads sharing one model no longer corrupt its weights or switch off cuDNN for the whole process.
    • A class_names list that includes the Roboflow root category now errors instead of shifting every label.
    • predict() takes frame[:, :, ::-1], so the docs' video, webcam and RTSP examples run as written.
    • YOLO data.yaml files load consistently: class IDs sort numerically and images/train layouts work.
    • ONNX exports run faster through Apple's CoreML: Nano drops from 9.3 to 8.3 ms on an M4 Max with ONNX Runtime 1.30.

    Upgrading from 1.11.1 means one removed constant: inline ["images", "labels"] if you imported REQUIRED_DATA_SUBDIRS. Four behaviour changes are worth a skim in the Migration guide.

    ✨ Spotlights

    Threads sharing a model could corrupt its weights

    A cold model's weights move from CPU to the accelerator on first use (predict(), inference(), and export()'s restore step), and several threads could run that move at once. On a cold RF-DETR segmentation model, four threads calling predict() together left 13 of 573 state_dict tensors corrupted. Nothing raised, and every frame came back with no detections. The check and the move now happen under a per-model lock, so a thread that arrives mid-move waits for it. (#1564)

    from concurrent.futures import ThreadPoolExecutor
    
    model = RFDETRSegNano()  # cold: weights still on CPU
    with ThreadPoolExecutor(max_workers=4) as pool:
        detections = list(pool.map(model.predict, frames))
    

    Segmentation threads no longer disable cuDNN for everyone

    The segmentation head wraps its depthwise convolution in torch.backends.cudnn.flags(enabled=False). That flag is process-global and not thread-safe: a second thread entering mid-scope saved False and restored it last, so every later convolution in the process quietly skipped cuDNN. Detections near the score threshold changed (25 instead of 24 on one real frame). Forward and backward scopes now share a lock, and a CPU input skips them entirely. No code change on your side. (#1565)

    A root category in class_names is now an error

    Roboflow COCO exports list a top-level category first, such as animals above cat, dog and horse. Since 1.9.2 it isn't one of the model's classes, so a list built from every category gave each class its neighbour's name, in checkpoints and in predict() output, with no warning. RFDETR.train() now compares class_names with the dataset before it writes training_config.json or starts a wandb/MLflow run. (#1572)

    # 1.11.1 trained, with every name shifted by one
    model.train(dataset_dir=ds, class_names=["animals", "cat", "dog", "horse"])
    
    # 1.11.2 raises ValueError naming the extra entry; pass the real classes
    model.train(dataset_dir=ds, class_names=["cat", "dog", "horse"])
    

    predict() accepts flipped frames

    frame[:, :, ::-1], the BGR-to-RGB flip in the video file, webcam and RTSP examples of docs/learn/pretrained.md, is a negative-stride NumPy view, and torch.from_numpy rejects those. The examples raised ValueError: At least one stride in the given numpy array is negative on the first frame. Only arrays with a negative stride get copied now. (#1573)

    detections = model.predict(frame[:, :, ::-1])
    

    REQUIRED_DATA_SUBDIRS is gone

    is_valid_yolo_dataset finds split directories through the YAML-aware resolver, and that resolver derives the labels directory from the resolved images path. Its only reader was is_valid_yolo_dataset, rewritten in this release, so nothing reads the ["images", "labels"] constant any more. A split directory that resolves outside the dataset root is refused too, even through a conventional train/images symlink. (#1570)

    🔄 Migration guide

    One removal, in rfdetr.datasets.yolo:

    # 1.1
    
  3. 1.11.1v1.11.1: Correctness Fixes for LoRA, TensorRT & Crowd mAP2026-09-30 · 2026-09-30 11:17 UTC
    查看更新说明

    RF-DETR 1.11.1 is a correctness patch. It turns silent wrong results into loud, correct ones:

    • LoRA backbone — backbone_lora=True checkpoints trained on a random encoder, no error. Now loads correctly.
    • TensorRT inference — wrong-device/dtype/non-contiguous inputs returned wrong detections, no error. Now refused.
    • Crowd-region mAP — val/test mAP overcounted false positives on COCO crowd regions. Now matches pycocotools.

    Most users need no action. 4 of the 5 "breaking" changes only affect code that was already getting a wrong result or an uncaught KeyError — this release just stops hiding it. See the Migration guide for exact before/after code.

    The one real API change: RFDETRModelModule.clip_gradients → configure_gradient_clipping. Only affects code that calls clip_gradients directly, or relies on super().clip_gradients(...) inside an override.

    Everything else is a bug fix or documentation update.

    ✨ Spotlights

    backbone_lora=True checkpoints silently trained a random encoder — now fixed

    RFDETR.from_checkpoint(), RFDETRSmall(pretrain_weights=...), and train() all loaded a LoRA checkpoint before wrapping the encoder with LoRA, so none of the stored PEFT-named weights matched — the encoder silently stayed at random initialization, and evaluate() scored near zero with no error.

    # Before (1.11.0): silent — encoder never actually reloads
    model = RFDETRLarge(pretrain_weights="checkpoint_best_total.pth", backbone_lora=True)
    model.evaluate()  # mAP50:95 ≈ 0.0001 — looks broken, no exception
    
    # After (1.11.1): encoder is wrapped before load, weights match
    model = RFDETRLarge(pretrain_weights="checkpoint_best_total.pth", backbone_lora=True)
    model.evaluate()  # mAP50:95 ≈ 0.6221 — same as the in-memory trained model
    

    Measured: RF-DETR Large @640, LoRA-tuned on 262 COCO person images. (#1543)

    last.ckpt and interval checkpoints now carry enough to reload

    # Before (1.11.0)
    RFDETR.from_checkpoint("output/last.ckpt")  # KeyError: 'args'
    
    # After (1.11.1)
    model = RFDETR.from_checkpoint("output/last.ckpt")  # rebuilds trained resolution/architecture
    

    Files written by 1.11.0 and earlier can't be repaired in place — from_checkpoint now raises a named ValueError pointing at checkpoint_best_ema.pth and training_config.json instead. (#1561)

    Val/test mAP now matches pycocotools on COCO crowd regions

    Detections inside iscrowd=1 regions no longer count as false positives. Numbers shift on crowd-labelled data — Nano COCO val2017: 0.4802 → 0.4842 mAP. Training is unchanged. (#1532)

    TRTInference refuses inputs TensorRT would misread

    # Before (1.11.0): silent wrong output
    trt_model(image_tensor.to(memory_format=torch.channels_last))  # 13 detections → 0, no error
    
    # After (1.11.1): explicit refusal
    trt_model(image_tensor.to(memory_format=torch.channels_last))
    # ValueError: Input 'input' is not contiguous (strides (...)), and TensorRT reads it as dense
    # row-major memory. Pass tensor.contiguous().
    

    (#1546)

    RFDETRModelModule.clip_gradients renamed → configure_gradient_clipping (Breaking)

    # Before (1.11.0)
    class MyModule(RFDETRModelModule):
        def clip_gradients(self, optimizer, gradient_clip_val=None, gradient_clip_algorithm=None): ...
    
    
    # After (1.11.1)
    class MyModule(RFDETRModelModule):
        def configure_gradient_clipping(self, optimizer, gradient_clip_val=None, gradient_clip_algorithm=None): ...
    

    Moves the keypoint fp16 clipping fix onto the Lightning hook meant for it — clip_gradients itself now reverts to Lightning's base implementation. Narrower than it looks: configure_gradient_clipping's non-fused branch calls `self.clip_grad

  4. 1.11.0v1.11.0: Wider export surface, faster training2026-09-24 · 2026-09-24 17:13 UTC
    查看更新说明

    RF-DETR 1.11.0 widens the export surface and speeds up training. Three new export formats land — OpenVINO IR (with configurable precision), LiteRT via litert-torch, and Apple Core AI (.aimodel, for iOS/iPadOS/macOS 27+) — alongside dynamic-batch TensorRT engines built through a single optimization profile, so one engine now serves a batch range instead of one fixed size. Training gains opt-in CUDA-graph replay (combinable with torch.compile, plus a Transformer Engine FP8 capture route on supported hardware) and a WebDataset streaming reader for tar-shard training input at scale.

    This release also completes a deprecation cycle from 1.9.0: RFDETR.optimize_for_inference(), TrainConfig.lr_drop/lr_min_factor, and the standalone synthetic-dataset generator are removed, and export internals were restructured into one Exporter class per format behind a registry. RFDETR.export()'s own signature is unchanged, but code importing the old converter functions directly needs updated imports. See the Migration guide below for exact before/after code.

    ✨ Spotlights / highlights

    Breaking: export internals restructured into one Exporter class per format

    Each export format (onnx, openvino, coreml, executorch, tflite, tensorrt, litert) is now written by a <Format>Exporter class built from that format's own frozen config dataclass, reached through a registry. RFDETR.export()'s own signature and return value are unchanged — this only breaks code that imported the old converter functions directly. (#1448)

    # Before (removed)
    from rfdetr.export._onnx.exporter import export_onnx
    
    # After
    from rfdetr.export._onnx.exporter import OnnxExporter
    

    New: OpenVINO IR export

    from rfdetr import RFDETRNano
    
    model = RFDETRNano()
    model.export(format="openvino", openvino_precision="float32", output_dir="output")
    # -> output/rfdetr-nano.xml + output/rfdetr-nano.bin
    

    openvino_precision accepts "float32", "float16", or None. Install with pip install "rfdetr[openvino]". (#1238)

    New: Apple Core AI export

    from rfdetr import RFDETRNano
    
    model = RFDETRNano(pretrain_weights="<path/to/checkpoint.pth>")
    model.export(format="coreai")
    # -> output/rfdetr-nano_fp32.aimodel
    

    Experimental. Targets iOS, iPadOS and macOS 27+ via coreai-torch, no ONNX step. coreai_precision="float16" halves asset size; the exporter runs the two-stage topk in float32 even in a float16 graph because the Neural Engine returns corrupt float16 topk indices. Install with pip install "rfdetr[coreai]" (Python 3.11-3.13, macOS Apple silicon or Linux x86-64 to build the asset). (#1521)

    New: opt-in CUDA graph training replay, combinable with compile and FP8

    model = RFDETRNano(cuda_graphs=True)
    # or, delegated to Inductor's own CUDA graph trees:
    model = RFDETRNano(cuda_graphs=True, compile=True)
    

    Single-GPU detection training only. BF16/eager route supports gradient accumulation; a separate FP8 route through Transformer Engine (amp_dtype="fp8", compile=False) is limited to grad_accum_steps=1. Measured on an RTX PRO 6000 (Nano, batch 64, BF16): compile=True alone is ~17% faster than eager; cuda_graphs=True combined with compile=True is fastest at large batch. (#1468, #1479, #1481)

    New: stream training input directly from WebDataset tar shards

    from rfdetr.config import TrainConfig
    
    config = TrainConfig(dataset_file="webdataset", dataset_dir="path/to/shards")
    

    Pack shards with python -m rfdetr.cli.webdataset. Requires the data extra: pip install "rfdetr[data]" (not [webdataset] — that extra never existed). (#1396)

    New: dynamic-batch TensorRT engines through a single optimization profile

    model.export(format="tensorrt", dynamic_batch=True, batch_size=4, max_batch_size=16)
    

    One engine now accepts any batch from 1 to max_batch_size, tuned for batch_size; w

  5. 1.10.1v1.10.1: CUDA Compile Fixes & Memory Reduction2026-09-07 · 2026-09-07 11:50 UTC
    查看更新说明

    RF-DETR 1.10.1 is a patch release: compile=True now actually reaches CUDA's torch.compile path under the default multi_scale=True recipe, and peak CUDA memory in segmentation loss drops by sampling ground-truth masks one image at a time. It also carries several device-sync and strategy-selection fixes for the still-experimental, undocumented TPU/XLA training path (tracked under issue #1058) — see Notable Changes below. No breaking changes in this release.

    ✨ Spotlights

    ⚡ compile=True now actually compiles on CUDA with the default multi_scale=True

    The compile gate previously excluded multi-scale training, but the exclusion sat behind checks that already required a CUDA device and CUDA accelerator — so it only ever blocked the CUDA path, where dynamic=True already handles the varying input size. Setting compile=True on a default recipe previously logged a notice and trained eagerly instead. ([#1436]; [#1411], shipped in 1.10.0, made compilation reachable in the first place)

    from rfdetr import RFDETRSmall
    
    model = RFDETRSmall()
    model.train(dataset_dir="...", compile=True)  # multi_scale=True by default — now actually compiles on CUDA
    

    💾 Reduced peak CUDA memory in segmentation loss

    For multi-image CUDA batches with boolean ground-truth masks, sampling now happens one image at a time, releasing each image's float masks before the next, instead of concatenating a batch-wide float mask tensor. Narrower inputs (single-image batches, non-CUDA, non-bool masks) keep the prior concat path unchanged. ([#1437])

    🔄 Migration guide

    No breaking changes in this release. One thing to know: if you call dice_loss_jit / sigmoid_ce_loss_jit directly — not part of the public API, only reachable through rfdetr.models.lwdetr's backward-compat re-exports — most NumPy scalar denominators now need casting to float first. See MIGRATION.md for details.

    📝 Notable changes

    🔧 Fixed

    • compile=True now takes effect on CUDA with the default multi_scale=True, instead of previously logging a notice and training eagerly. Also fixes the now-stale multi_scale=False claim in the COCO2017 training cookbook. (#1436; #1411, shipped in 1.10.0, made compilation reachable in the first place)
    • Reduced peak CUDA memory in segmentation loss by sampling matched ground-truth masks one image at a time, for multi-image CUDA batches with boolean masks. (#1437)
    • Docs site: the version banner no longer flags the current release as outdated. (#1429)
    • TPU/XLA training (experimental, undocumented): point_sample(mode="nearest") no longer leaves the device on MPS/XLA (#1432, issue #1058); SetCriterion.loss_masks no longer syncs its normalizing denominator to the host, with a side effect that dice_loss_jit/sigmoid_ce_loss_jit — reachable only through lwdetr.py's backward-compat re-exports, not the public API — now reject most NumPy scalar denominators (#1428, issue #1058); build_trainer now selects XLAStrategy for multi-device XLA/TPU training when strategy="auto", previously a crash at Trainer construction, and changes the precision-plugin path for single-device accelerator="auto" XLA runs too (#1427, issue #1058); XLA-marked tests pass on real TPU silicon (#1426, issue #1058).

    🏆 Contributors

    • Jesús Royeth (@JESUSROYETH): all six code/test fixes in this release — the compile=True/CUDA multi-scale fix, reduced peak CUDA memory in segmentation loss, and the experimental TPU/XLA device-sync, strategy-selection, and test-suite fixes.
    • Jirka Borovec (@Borda, LinkedIn): fixed the docs-site version banner falsely flagging the current release as outdated, and this release's own prep.

    Full changelog: https://github.com/roboflow/rf-detr/compare/1.10.0...1.10.1 *Co-authored with [/oss:release](https://bord

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    RF-DETR: Real-Time SOTA Object Detection, Instance Segmentation, and Keypoint Detection

    version downloads codecov python-version license

    arXiv hf space colab roboflow discord

    Papers with Code leaderboard


    RF-DETR is a real-time transformer architecture for object detection, instance segmentation, and keypoint detection (preview) developed by Roboflow. Built on a DINOv2 vision transformer backbone (a PE-Core-T backbone for Atto, Femto and Pico), RF-DETR delivers state-of-the-art accuracy and latency trade-offs on Microsoft COCO and RF100-VL.

    RF-DETR supports object detection, instance segmentation, and keypoint detection (preview) in a single, consistent API.

    Commercially usable under Apache 2.0. The rfdetr package, RF-DETR Nano, Small, Medium and Large detection, every RF-DETR-Seg size (Nano through 2XLarge), and RF-DETR Keypoint are released under the Apache 2.0 license, so they're commercially usable out of the box: you can ship them in closed-source, commercial products, including self-hosted deployments, without paying a license fee or open-sourcing your code. RF-DETR Atto, Femto, Pico, XL and 2XL detection ship in the optional rfdetr[plus] extension under the Roboflow Platform Model License (PML 1.0): commercial use is included when you deploy on Roboflow, and commercial self-hosting requires the Enterprise add-on. See License.

    The published RF-DETR sizes were created with neural architecture search (NAS) — and the same NAS method is now available on the Roboflow platform, so you can discover the best architecture for your own dataset. Learn more in the NAS docs.

    https://github.com/user-attachments/assets/add23fd1-266f-4538-8809-d7dd5767e8e6

    Install

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

    pip install rfdetr
    

    pip install rfdetr gives you only Apache 2.0 RF-DETR code and models, so it's commercially usable out of the box. pip install "rfdetr[plus]" adds the Atto, Femto, Pico, XL and 2XL detection models under PML 1.0 (commercial use included on Roboflow; commercial self-hosting requires the Enterprise add-on). See License.

    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 https://github.com/roboflow/rf-detr/archive/refs/heads/develop.zip
    

    Benchmarks

    RF-DETR achieves state-of-the-art results in both object detection and instance segmentation, with benchmarks reported on Microsoft COCO and RF100-VL (RF100-VL for detection only). The charts and tables below compare RF-DETR against other top real-time models across accuracy and latency for detection and segmentation. All COCO accuracy numbers are measured in-house for every model shown, computed with pycocotools in SAB over the full 5,000-image val2017 split, so every row is directly comparable and may differ from vendor-reported figures. The sole exception is rows marked †, which are quoted from the original authors' paper and were not measured in SAB. All latency numbers were measured on an NVIDIA T4 using TensorRT, FP16, and batch size 1. Parameter counts are deployment (fused) nn.Module parameter counts (model.parameters(), not the raw tensor count of the saved checkpoint), except rows marked †, which are the authors' reported counts. For full benchmarking methodology and reproducibility details, see roboflow/sab.

    License note: YOLOv8, YOLO11 and YOLO26 are released under AGPL-3.0. In practice, using them in a commercial product or service, including one users reach over a network, means open-sourcing your application code under AGPL-3.0 or buying a commercial license. Deploying on Roboflow includes a commercial license for these models for every user; commercial self-hosting is an Enterprise add-on (details). RF-DETR rows marked Apache 2.0 are commercially usable out of the box; rows marked PML 1.0 include commercial use on Roboflow, and commercial self-hosting requires the Enterprise add-on. LW-DETR and D-FINE are Apache 2.0.

    Detection

    ArchitectureCOCO AP50COCO AP50:95RF100VL AP50RF100VL AP50:95Latency (ms)Params (M)ResolutionLicense
    RF-DETR-A △49.430.578.248.31.07.4380x380PML 1.0
    RF-DETR-F △55.937.882.553.81.47.9384x384PML 1.0
    RF-DETR-P △60.241.684.156.01.78.4560x560PML 1.0
    RF-DETR-N67.648.485.057.72.330.5384x384Apache 2.0
    RF-DETR-S72.153.086.760.23.532.1512x512Apache 2.0
    RF-DETR-M73.654.787.461.24.433.7576x576Apache 2.0
    RF-DETR-L75.156.588.262.26.833.9704x704Apache 2.0
    RF-DETR-XL △77.458.688.562.911.5126.4700x700PML 1.0
    RF-DETR-2XL △78.560.189.063.217.2126.9880x880PML 1.0
    YOLO11-N52.037.481.455.32.52.6640x640AGPL-3.0
    YOLO11-S59.744.482.356.23.29.4640x640AGPL-3.0
    YOLO11-M64.148.682.556.55.120.1640x640AGPL-3.0
    YOLO11-L64.949.982.256.56.525.3640x640AGPL-3.0
    YOLO11-X66.150.981.756.210.556.9640x640AGPL-3.0
    YOLO26-N55.840.376.752.01.72.6640x640AGPL-3.0
    YOLO26-S64.347.782.757.02.69.4640x640AGPL-3.0
    YOLO26-M69.752.584.458.74.420.1640x640AGPL-3.0
    YOLO26-L71.154.185.059.35.725.3640x640AGPL-3.0
    YOLO26-X74.056.985.660.09.656.9640x640AGPL-3.0
    LW-DETR-T60.742.984.757.11.912.1640x640Apache 2.0
    LW-DETR-S66.848.085.057.42.614.6640x640Apache 2.0
    LW-DETR-M72.052.686.859.84.428.2640x640Apache 2.0
    LW-DETR-L74.656.187.461.56.946.8640x640Apache 2.0
    LW-DETR-X76.958.387.962.113.0118.0640x640Apache 2.0
    D-FINE-N60.242.784.458.22.13.8640x640Apache 2.0
    D-FINE-S67.650.685.360.33.510.2640x640Apache 2.0
    D-FINE-M72.655.085.560.65.419.2640x640Apache 2.0
    D-FINE-L74.957.286.461.67.531.0640x640Apache 2.0
    D-FINE-X76.859.386.962.211.562.0640x640Apache 2.0
    SAM 3 †———61.6—~8501008x1008N/A

    † Reported by the SAM 3 authors (arXiv:2511.16719, Table 36), not measured by us in SAB. The value is SAM 3 fine-tuned on the full RF100-VL training set, which is the same setting as the RF100VL columns above — SAM 3's paper reports LW-DETR-m at 59.8 on this benchmark, matching our own measurement, so the numbers line up. Dashes mark results SAM 3 does not report under this protocol. Parameter count is the paper's stated ~850 M (~450 M vision + ~300 M text encoders + ~100 M detector/tracker).

    Segmentation

    ArchitectureCOCO AP50COCO AP50:95Latency (ms)Params (M)ResolutionLicense
    RF-DETR-Seg-N63.040.33.433.6312x312Apache 2.0
    RF-DETR-Seg-S66.243.14.433.7384x384Apache 2.0
    RF-DETR-Seg-M68.445.35.935.7432x432Apache 2.0
    RF-DETR-Seg-L70.547.18.836.2504x504Apache 2.0
    RF-DETR-Seg-XL72.248.813.538.1624x624Apache 2.0
    RF-DETR-Seg-2XL73.149.921.838.6768x768Apache 2.0
    YOLOv8-N-Seg45.628.33.53.4640x640AGPL-3.0
    YOLOv8-S-Seg53.834.04.211.8640x640AGPL-3.0
    YOLOv8-M-Seg58.237.37.027.3640x640AGPL-3.0
    YOLOv8-L-Seg60.539.09.746.0640x640AGPL-3.0
    YOLOv8-XL-Seg61.339.514.071.8640x640AGPL-3.0
    YOLOv11-N-Seg47.830.03.62.9640x640AGPL-3.0
    YOLOv11-S-Seg55.435.04.610.1640x640AGPL-3.0
    YOLOv11-M-Seg60.038.56.922.4640x640AGPL-3.0
    YOLOv11-L-Seg61.539.58.327.6640x640AGPL-3.0
    YOLOv11-XL-Seg62.440.113.762.1640x640AGPL-3.0
    YOLO26-N-Seg54.334.72.312.7640x640AGPL-3.0
    YOLO26-S-Seg62.440.23.4710.4640x640AGPL-3.0
    YOLO26-M-Seg67.844.06.3223.6640x640AGPL-3.0
    YOLO26-L-Seg69.845.57.5828.0640x640AGPL-3.0
    YOLO26-X-Seg71.646.812.9262.8640x640AGPL-3.0

    Keypoints

    ArchitectureCOCO AP50:95Latency (ms)Params (M)License
    RF-DETR Keypoint (Preview)71.89.740.7Apache 2.0
    YOLO11-pose N48.93.22.9AGPL-3.0
    YOLO11-pose S57.53.49.9AGPL-3.0
    YOLO11-pose M64.25.220.9AGPL-3.0
    YOLO11-pose L65.26.626.2AGPL-3.0
    YOLO11-pose X68.610.658.8AGPL-3.0
    YOLO26-pose N55.91.92.9AGPL-3.0
    YOLO26-pose S62.02.710.4AGPL-3.0
    YOLO26-pose M68.04.621.5AGPL-3.0
    YOLO26-pose L69.25.925.9AGPL-3.0
    YOLO26-pose X71.09.857.6AGPL-3.0

    Keypoint benchmarks report AP50:95 (OKS-based); this is the standard COCO keypoint comparison metric.

    NAS on the Roboflow Platform

    Since the paper release, we have improved RF-DETR NAS training on the Roboflow platform even further. A single training run gives you every model size, with results that beat not only the open-source checkpoints but also our own paper NAS results. Try it now!

    Run Models

    Detection

    RF-DETR provides multiple model sizes, ranging from Nano to 2XLarge. To use a different model size, replace the class name in the code snippet below with another class from the table.

    import supervision as sv
    from rfdetr import RFDETRMedium
    from rfdetr.assets.coco_classes import COCO_CLASSES
    
    model = RFDETRMedium()
    
    detections = model.predict("https://media.roboflow.com/dog.jpg", threshold=0.5)
    
    labels = [f"{COCO_CLASSES[class_id]}" for class_id in detections.class_id]
    
    annotated_image = sv.BoxAnnotator().annotate(detections.metadata["source_image"], detections)
    annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections, labels)
    

    Note: COCO_CLASSES works for COCO-pretrained models. For fine-tuned models, use detections.data["class_name"] instead — it resolves class names from the checkpoint and works for both COCO and custom datasets.

    You can also run RF-DETR models using the Inference library. To switch model size, select the appropriate inference package alias from the table below.

    import requests
    import supervision as sv
    from PIL import Image
    from inference import get_model
    
    model = get_model("rfdetr-medium")
    
    image = Image.open(requests.get("https://media.roboflow.com/dog.jpg", stream=True).raw)
    predictions = model.infer(image, confidence=0.5)[0]
    detections = sv.Detections.from_inference(predictions)
    
    annotated_image = sv.BoxAnnotator().annotate(image, detections)
    annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections)
    
    SizeRF-DETR package classInference package aliasCOCO AP50COCO AP50:95Latency (ms)Params (M)ResolutionLicense
    ARFDETRAtto △rfdetr-atto49.430.51.07.4380x380PML 1.0
    FRFDETRFemto △rfdetr-femto55.937.81.47.9384x384PML 1.0
    PRFDETRPico △rfdetr-pico60.241.61.78.4560x560PML 1.0
    NRFDETRNanorfdetr-nano67.648.42.330.5384x384Apache 2.0
    SRFDETRSmallrfdetr-small72.153.03.532.1512x512Apache 2.0
    MRFDETRMediumrfdetr-medium73.654.74.433.7576x576Apache 2.0
    LRFDETRLargerfdetr-large75.156.56.833.9704x704Apache 2.0
    XLRFDETRXLarge △rfdetr-xlarge77.458.611.5126.4700x700PML 1.0
    2XLRFDETR2XLarge △rfdetr-2xlarge78.560.117.2126.9880x880PML 1.0

    △ Requires the rfdetr_plus extension: pip install rfdetr[plus]. See License for details.

    Segmentation

    RF-DETR supports instance segmentation with model sizes from Nano to 2XLarge. To use a different model size, replace the class name in the code snippet below with another class from the table.

    import supervision as sv
    from rfdetr import RFDETRSegMedium
    from rfdetr.assets.coco_classes import COCO_CLASSES
    
    model = RFDETRSegMedium()
    
    detections = model.predict("https://media.roboflow.com/dog.jpg", threshold=0.5)
    
    labels = [f"{COCO_CLASSES[class_id]}" for class_id in detections.class_id]
    
    annotated_image = sv.MaskAnnotator().annotate(detections.metadata["source_image"], detections)
    annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections, labels)
    

    You can also run RF-DETR-Seg models using the Inference library. To switch model size, select the appropriate inference package alias from the table below.

    import requests
    import supervision as sv
    from PIL import Image
    from inference import get_model
    
    model = get_model("rfdetr-seg-medium")
    
    image = Image.open(requests.get("https://media.roboflow.com/dog.jpg", stream=True).raw)
    predictions = model.infer(image, confidence=0.5)[0]
    detections = sv.Detections.from_inference(predictions)
    
    annotated_image = sv.MaskAnnotator().annotate(image, detections)
    annotated_image = sv.LabelAnnotator().annotate(annotated_image, detections)
    
    SizeRF-DETR package classInference package aliasCOCO AP50COCO AP50:95Latency (ms)Params (M)ResolutionLicense
    NRFDETRSegNanorfdetr-seg-nano63.040.33.433.6312x312Apache 2.0
    SRFDETRSegSmallrfdetr-seg-small66.243.14.433.7384x384Apache 2.0
    MRFDETRSegMediumrfdetr-seg-medium68.445.35.935.7432x432Apache 2.0
    LRFDETRSegLargerfdetr-seg-large70.547.18.836.2504x504Apache 2.0
    XLRFDETRSegXLargerfdetr-seg-xlarge72.248.813.538.1624x624Apache 2.0
    2XLRFDETRSeg2XLargerfdetr-seg-2xlarge73.149.921.838.6768x768Apache 2.0

    Keypoints

    RF-DETR supports keypoint detection (preview) with RFDETRKeypointPreview, pretrained on COCO person keypoints.

    from rfdetr import RFDETRKeypointPreview
    
    model = RFDETRKeypointPreview()
    key_points = model.predict("image.jpg", threshold=0.5)
    
    SizeRF-DETR package classCOCO AP50:95Latency (ms)Params (M)ResolutionLicense
    Keypoint (Preview)RFDETRKeypointPreview71.89.740.7576x576Apache 2.0

    Train Models

    RF-DETR supports training for object detection, instance segmentation, and keypoint detection (preview). You can train models in Google Colab or directly on the Roboflow platform. Below you will find a step-by-step video fine-tuning tutorial.

    rf-detr-tutorial-banner

    Documentation

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

    License

    RF-DETR is commercially usable. Licensing is split by component:

    ComponentLicenseWhat it means in practice
    rfdetr package (training, inference and export code)Apache 2.0Commercially usable out of the box: you can ship it in closed-source, commercial products, including self-hosted deployments, without paying a license fee or open-sourcing your code.
    RF-DETR Nano, Small, Medium and Large detectionApache 2.0Same as above.
    RF-DETR-Seg, every size (Nano through 2XLarge)Apache 2.0Same as above.
    RF-DETR Keypoint (Preview)Apache 2.0Same as above.
    RF-DETR Atto, Femto, Pico, XL and 2XL detection (rfdetr[plus]), and RF-DETR NAS modelsRoboflow Platform Model License (PML 1.0)Commercial use is included when you deploy on Roboflow; commercial self-hosting requires the Enterprise add-on (details).

    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.

    @inproceedings{robinson2026rfdetr,
      title     = {RF-DETR: Real-Time Detection Transformer},
      author    = {Robinson, Isaac and Robicheaux, Peter and Popov, Matvei and Ramanan, Deva and Peri, Neehar},
      booktitle = {International Conference on Learning Representations (ICLR)},
      year      = {2026},
      url       = {https://arxiv.org/abs/2511.09554}
    }
    

    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.

    Project Activity

    PyPI downloads cover completed Monday-to-Sunday periods and exclude known mirrors. New stars are calculated from consecutive scheduled GitHub snapshots.