需要 Python>=3.10 环境;Atto/Femto/Pico/XL/2XL 检测模型需额外安装 rfdetr[plus],且商用自托管需 Enterprise 附加许可;从源码安装的是 develop 分支,稳定性不如正式发布版
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]
pip install rfdetrREADME 未说明显存要求;基准延迟在 NVIDIA T4 上用 TensorRT FP16、batch size 1 测得,未提及 CPU 或其他 GPU 厂商支持情况
Roboflow 开源的实时目标检测/分割/关键点模型,基于 DINOv2,主打微调后精度与延迟的平衡
RF-DETR 是 Roboflow 推出的实时目标检测与实例分割模型架构,在 COCO 上达到 SOTA,适合直接微调落地。
核心能力
- 基于 DINOv2 视觉 Transformer 骨干网络
- 检测、实例分割、关键点检测共用一套 API
- 提供 Nano 到 2XL 多档模型尺寸
- 用 NAS 搜索架构,COCO 与 RF100-VL 上精度领先
- Apache 2.0 授权,可直接商用闭源产品
容易踩的坑
- 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. Unknownpredict()keywords andTRTInferenceare deprecated.✨ Spotlights / highlights
One prediction API for native and exported models
RFDETRInferenceruns 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.streamsmanifests, andstream=Trueyields 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) throughRFDETRInferenceor theinference()snapshot. Compare within a row, not across machines.Hardware Fastest route Precision Latency [ms] FPS [img/s] NVIDIA L4 TensorRT .trtenginefp16 3.57 280 Apple M4 Max (40-core GPU) inference()inductorfp16 10.3 97.4 x86 CPU (Colab, 4 cores / 8 threads) OpenVINO IR fp32 373.7 2.7 On the L4 the
inference()CUDA graph in fp16 reaches 3.60 ms, level with the engine at batch 1. On the M4 Maxinference()inductor in fp16 runs 10.3 ms against 20.0 ms for eagerpredict(). 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"withcalibration_databuilds 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,RFDETRFemtoandRFDETRPicoship throughrfdetr_plus(pip install "rfdetr[plus]", Platform Model License 1.0: commercial use is included when deploying on Roboflow, and commercial self-ho - 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_nameslist that includes the Roboflow root category now errors instead of shifting every label. predict()takesframe[:, :, ::-1], so the docs' video, webcam and RTSP examples run as written.- YOLO
data.yamlfiles load consistently: class IDs sort numerically andimages/trainlayouts 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 importedREQUIRED_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(), andexport()'s restore step), and several threads could run that move at once. On a cold RF-DETR segmentation model, four threads callingpredict()together left 13 of 573state_dicttensors 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 savedFalseand 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_namesis now an errorRoboflow COCO exports list a top-level category first, such as
animalsabovecat,dogandhorse. 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 inpredict()output, with no warning.RFDETR.train()now comparesclass_nameswith the dataset before it writestraining_config.jsonor starts awandb/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 framesframe[:, :, ::-1], the BGR-to-RGB flip in the video file, webcam and RTSP examples ofdocs/learn/pretrained.md, is a negative-stride NumPy view, andtorch.from_numpyrejects those. The examples raisedValueError: At least one stride in the given numpy array is negativeon the first frame. Only arrays with a negative stride get copied now. (#1573)detections = model.predict(frame[:, :, ::-1])REQUIRED_DATA_SUBDIRSis goneis_valid_yolo_datasetfinds split directories through the YAML-aware resolver, and that resolver derives the labels directory from the resolved images path. Its only reader wasis_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 conventionaltrain/imagessymlink. (#1570)🔄 Migration guide
One removal, in
rfdetr.datasets.yolo:# 1.1 - 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=Truecheckpoints 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 callsclip_gradientsdirectly, or relies onsuper().clip_gradients(...)inside an override.Everything else is a bug fix or documentation update.
✨ Spotlights
backbone_lora=Truecheckpoints silently trained a random encoder — now fixedRFDETR.from_checkpoint(),RFDETRSmall(pretrain_weights=...), andtrain()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, andevaluate()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 modelMeasured: RF-DETR Large
@640, LoRA-tuned on 262 COCO person images. (#1543)last.ckptand 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/architectureFiles written by 1.11.0 and earlier can't be repaired in place —
from_checkpointnow raises a namedValueErrorpointing atcheckpoint_best_ema.pthandtraining_config.jsoninstead. (#1561)Val/test mAP now matches pycocotools on COCO crowd regions
Detections inside
iscrowd=1regions no longer count as false positives. Numbers shift on crowd-labelled data — Nano COCO val2017: 0.4802 → 0.4842 mAP. Training is unchanged. (#1532)TRTInferencerefuses 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_gradientsrenamed →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_gradientsitself now reverts to Lightning's base implementation. Narrower than it looks:configure_gradient_clipping's non-fused branch calls `self.clip_grad - LoRA backbone —
- 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 withtorch.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 oneExporterclass 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
Exporterclass per formatEach export format (
onnx,openvino,coreml,executorch,tflite,tensorrt,litert) is now written by a<Format>Exporterclass 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 OnnxExporterNew: 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.binopenvino_precisionaccepts"float32","float16", orNone. Install withpip 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.aimodelExperimental. Targets iOS, iPadOS and macOS 27+ via
coreai-torch, no ONNX step.coreai_precision="float16"halves asset size; the exporter runs the two-stagetopkin float32 even in a float16 graph because the Neural Engine returns corrupt float16topkindices. Install withpip 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
compileand FP8model = 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 tograd_accum_steps=1. Measured on an RTX PRO 6000 (Nano, batch 64, BF16):compile=Truealone is ~17% faster than eager;cuda_graphs=Truecombined withcompile=Trueis 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 thedataextra: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 forbatch_size; w - 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=Truenow actually reaches CUDA'storch.compilepath under the defaultmulti_scale=Truerecipe, 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=Truenow actually compiles on CUDA with the defaultmulti_scale=TrueThe 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=Truealready handles the varying input size. Settingcompile=Trueon 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_jitdirectly — not part of the public API, only reachable throughrfdetr.models.lwdetr's backward-compat re-exports — most NumPy scalar denominators now need casting tofloatfirst. See MIGRATION.md for details.📝 Notable changes
🔧 Fixed
compile=Truenow takes effect on CUDA with the defaultmulti_scale=True, instead of previously logging a notice and training eagerly. Also fixes the now-stalemulti_scale=Falseclaim 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_masksno longer syncs its normalizing denominator to the host, with a side effect thatdice_loss_jit/sigmoid_ce_loss_jit— reachable only throughlwdetr.py's backward-compat re-exports, not the public API — now reject most NumPy scalar denominators (#1428, issue #1058);build_trainernow selectsXLAStrategyfor multi-device XLA/TPU training whenstrategy="auto", previously a crash atTrainerconstruction, and changes the precision-plugin path for single-deviceaccelerator="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
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
RF-DETR: Real-Time SOTA Object Detection, Instance Segmentation, and Keypoint Detection
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
| Architecture | COCO AP50 | COCO AP50:95 | RF100VL AP50 | RF100VL AP50:95 | Latency (ms) | Params (M) | Resolution | License |
|---|---|---|---|---|---|---|---|---|
| RF-DETR-A △ | 49.4 | 30.5 | 78.2 | 48.3 | 1.0 | 7.4 | 380x380 | PML 1.0 |
| RF-DETR-F △ | 55.9 | 37.8 | 82.5 | 53.8 | 1.4 | 7.9 | 384x384 | PML 1.0 |
| RF-DETR-P △ | 60.2 | 41.6 | 84.1 | 56.0 | 1.7 | 8.4 | 560x560 | PML 1.0 |
| RF-DETR-N | 67.6 | 48.4 | 85.0 | 57.7 | 2.3 | 30.5 | 384x384 | Apache 2.0 |
| RF-DETR-S | 72.1 | 53.0 | 86.7 | 60.2 | 3.5 | 32.1 | 512x512 | Apache 2.0 |
| RF-DETR-M | 73.6 | 54.7 | 87.4 | 61.2 | 4.4 | 33.7 | 576x576 | Apache 2.0 |
| RF-DETR-L | 75.1 | 56.5 | 88.2 | 62.2 | 6.8 | 33.9 | 704x704 | Apache 2.0 |
| RF-DETR-XL △ | 77.4 | 58.6 | 88.5 | 62.9 | 11.5 | 126.4 | 700x700 | PML 1.0 |
| RF-DETR-2XL △ | 78.5 | 60.1 | 89.0 | 63.2 | 17.2 | 126.9 | 880x880 | PML 1.0 |
| YOLO11-N | 52.0 | 37.4 | 81.4 | 55.3 | 2.5 | 2.6 | 640x640 | AGPL-3.0 |
| YOLO11-S | 59.7 | 44.4 | 82.3 | 56.2 | 3.2 | 9.4 | 640x640 | AGPL-3.0 |
| YOLO11-M | 64.1 | 48.6 | 82.5 | 56.5 | 5.1 | 20.1 | 640x640 | AGPL-3.0 |
| YOLO11-L | 64.9 | 49.9 | 82.2 | 56.5 | 6.5 | 25.3 | 640x640 | AGPL-3.0 |
| YOLO11-X | 66.1 | 50.9 | 81.7 | 56.2 | 10.5 | 56.9 | 640x640 | AGPL-3.0 |
| YOLO26-N | 55.8 | 40.3 | 76.7 | 52.0 | 1.7 | 2.6 | 640x640 | AGPL-3.0 |
| YOLO26-S | 64.3 | 47.7 | 82.7 | 57.0 | 2.6 | 9.4 | 640x640 | AGPL-3.0 |
| YOLO26-M | 69.7 | 52.5 | 84.4 | 58.7 | 4.4 | 20.1 | 640x640 | AGPL-3.0 |
| YOLO26-L | 71.1 | 54.1 | 85.0 | 59.3 | 5.7 | 25.3 | 640x640 | AGPL-3.0 |
| YOLO26-X | 74.0 | 56.9 | 85.6 | 60.0 | 9.6 | 56.9 | 640x640 | AGPL-3.0 |
| LW-DETR-T | 60.7 | 42.9 | 84.7 | 57.1 | 1.9 | 12.1 | 640x640 | Apache 2.0 |
| LW-DETR-S | 66.8 | 48.0 | 85.0 | 57.4 | 2.6 | 14.6 | 640x640 | Apache 2.0 |
| LW-DETR-M | 72.0 | 52.6 | 86.8 | 59.8 | 4.4 | 28.2 | 640x640 | Apache 2.0 |
| LW-DETR-L | 74.6 | 56.1 | 87.4 | 61.5 | 6.9 | 46.8 | 640x640 | Apache 2.0 |
| LW-DETR-X | 76.9 | 58.3 | 87.9 | 62.1 | 13.0 | 118.0 | 640x640 | Apache 2.0 |
| D-FINE-N | 60.2 | 42.7 | 84.4 | 58.2 | 2.1 | 3.8 | 640x640 | Apache 2.0 |
| D-FINE-S | 67.6 | 50.6 | 85.3 | 60.3 | 3.5 | 10.2 | 640x640 | Apache 2.0 |
| D-FINE-M | 72.6 | 55.0 | 85.5 | 60.6 | 5.4 | 19.2 | 640x640 | Apache 2.0 |
| D-FINE-L | 74.9 | 57.2 | 86.4 | 61.6 | 7.5 | 31.0 | 640x640 | Apache 2.0 |
| D-FINE-X | 76.8 | 59.3 | 86.9 | 62.2 | 11.5 | 62.0 | 640x640 | Apache 2.0 |
| SAM 3 † | — | — | — | 61.6 | — | ~850 | 1008x1008 | N/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
| Architecture | COCO AP50 | COCO AP50:95 | Latency (ms) | Params (M) | Resolution | License |
|---|---|---|---|---|---|---|
| RF-DETR-Seg-N | 63.0 | 40.3 | 3.4 | 33.6 | 312x312 | Apache 2.0 |
| RF-DETR-Seg-S | 66.2 | 43.1 | 4.4 | 33.7 | 384x384 | Apache 2.0 |
| RF-DETR-Seg-M | 68.4 | 45.3 | 5.9 | 35.7 | 432x432 | Apache 2.0 |
| RF-DETR-Seg-L | 70.5 | 47.1 | 8.8 | 36.2 | 504x504 | Apache 2.0 |
| RF-DETR-Seg-XL | 72.2 | 48.8 | 13.5 | 38.1 | 624x624 | Apache 2.0 |
| RF-DETR-Seg-2XL | 73.1 | 49.9 | 21.8 | 38.6 | 768x768 | Apache 2.0 |
| YOLOv8-N-Seg | 45.6 | 28.3 | 3.5 | 3.4 | 640x640 | AGPL-3.0 |
| YOLOv8-S-Seg | 53.8 | 34.0 | 4.2 | 11.8 | 640x640 | AGPL-3.0 |
| YOLOv8-M-Seg | 58.2 | 37.3 | 7.0 | 27.3 | 640x640 | AGPL-3.0 |
| YOLOv8-L-Seg | 60.5 | 39.0 | 9.7 | 46.0 | 640x640 | AGPL-3.0 |
| YOLOv8-XL-Seg | 61.3 | 39.5 | 14.0 | 71.8 | 640x640 | AGPL-3.0 |
| YOLOv11-N-Seg | 47.8 | 30.0 | 3.6 | 2.9 | 640x640 | AGPL-3.0 |
| YOLOv11-S-Seg | 55.4 | 35.0 | 4.6 | 10.1 | 640x640 | AGPL-3.0 |
| YOLOv11-M-Seg | 60.0 | 38.5 | 6.9 | 22.4 | 640x640 | AGPL-3.0 |
| YOLOv11-L-Seg | 61.5 | 39.5 | 8.3 | 27.6 | 640x640 | AGPL-3.0 |
| YOLOv11-XL-Seg | 62.4 | 40.1 | 13.7 | 62.1 | 640x640 | AGPL-3.0 |
| YOLO26-N-Seg | 54.3 | 34.7 | 2.31 | 2.7 | 640x640 | AGPL-3.0 |
| YOLO26-S-Seg | 62.4 | 40.2 | 3.47 | 10.4 | 640x640 | AGPL-3.0 |
| YOLO26-M-Seg | 67.8 | 44.0 | 6.32 | 23.6 | 640x640 | AGPL-3.0 |
| YOLO26-L-Seg | 69.8 | 45.5 | 7.58 | 28.0 | 640x640 | AGPL-3.0 |
| YOLO26-X-Seg | 71.6 | 46.8 | 12.92 | 62.8 | 640x640 | AGPL-3.0 |
Keypoints
| Architecture | COCO AP50:95 | Latency (ms) | Params (M) | License |
|---|---|---|---|---|
| RF-DETR Keypoint (Preview) | 71.8 | 9.7 | 40.7 | Apache 2.0 |
| YOLO11-pose N | 48.9 | 3.2 | 2.9 | AGPL-3.0 |
| YOLO11-pose S | 57.5 | 3.4 | 9.9 | AGPL-3.0 |
| YOLO11-pose M | 64.2 | 5.2 | 20.9 | AGPL-3.0 |
| YOLO11-pose L | 65.2 | 6.6 | 26.2 | AGPL-3.0 |
| YOLO11-pose X | 68.6 | 10.6 | 58.8 | AGPL-3.0 |
| YOLO26-pose N | 55.9 | 1.9 | 2.9 | AGPL-3.0 |
| YOLO26-pose S | 62.0 | 2.7 | 10.4 | AGPL-3.0 |
| YOLO26-pose M | 68.0 | 4.6 | 21.5 | AGPL-3.0 |
| YOLO26-pose L | 69.2 | 5.9 | 25.9 | AGPL-3.0 |
| YOLO26-pose X | 71.0 | 9.8 | 57.6 | AGPL-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_CLASSESworks for COCO-pretrained models. For fine-tuned models, usedetections.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)
| Size | RF-DETR package class | Inference package alias | COCO AP50 | COCO AP50:95 | Latency (ms) | Params (M) | Resolution | License |
|---|---|---|---|---|---|---|---|---|
| A | RFDETRAtto △ | rfdetr-atto | 49.4 | 30.5 | 1.0 | 7.4 | 380x380 | PML 1.0 |
| F | RFDETRFemto △ | rfdetr-femto | 55.9 | 37.8 | 1.4 | 7.9 | 384x384 | PML 1.0 |
| P | RFDETRPico △ | rfdetr-pico | 60.2 | 41.6 | 1.7 | 8.4 | 560x560 | PML 1.0 |
| N | RFDETRNano | rfdetr-nano | 67.6 | 48.4 | 2.3 | 30.5 | 384x384 | Apache 2.0 |
| S | RFDETRSmall | rfdetr-small | 72.1 | 53.0 | 3.5 | 32.1 | 512x512 | Apache 2.0 |
| M | RFDETRMedium | rfdetr-medium | 73.6 | 54.7 | 4.4 | 33.7 | 576x576 | Apache 2.0 |
| L | RFDETRLarge | rfdetr-large | 75.1 | 56.5 | 6.8 | 33.9 | 704x704 | Apache 2.0 |
| XL | RFDETRXLarge △ | rfdetr-xlarge | 77.4 | 58.6 | 11.5 | 126.4 | 700x700 | PML 1.0 |
| 2XL | RFDETR2XLarge △ | rfdetr-2xlarge | 78.5 | 60.1 | 17.2 | 126.9 | 880x880 | PML 1.0 |
△ Requires the
rfdetr_plusextension: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)
| Size | RF-DETR package class | Inference package alias | COCO AP50 | COCO AP50:95 | Latency (ms) | Params (M) | Resolution | License |
|---|---|---|---|---|---|---|---|---|
| N | RFDETRSegNano | rfdetr-seg-nano | 63.0 | 40.3 | 3.4 | 33.6 | 312x312 | Apache 2.0 |
| S | RFDETRSegSmall | rfdetr-seg-small | 66.2 | 43.1 | 4.4 | 33.7 | 384x384 | Apache 2.0 |
| M | RFDETRSegMedium | rfdetr-seg-medium | 68.4 | 45.3 | 5.9 | 35.7 | 432x432 | Apache 2.0 |
| L | RFDETRSegLarge | rfdetr-seg-large | 70.5 | 47.1 | 8.8 | 36.2 | 504x504 | Apache 2.0 |
| XL | RFDETRSegXLarge | rfdetr-seg-xlarge | 72.2 | 48.8 | 13.5 | 38.1 | 624x624 | Apache 2.0 |
| 2XL | RFDETRSeg2XLarge | rfdetr-seg-2xlarge | 73.1 | 49.9 | 21.8 | 38.6 | 768x768 | Apache 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)
| Size | RF-DETR package class | COCO AP50:95 | Latency (ms) | Params (M) | Resolution | License |
|---|---|---|---|---|---|---|
| Keypoint (Preview) | RFDETRKeypointPreview | 71.8 | 9.7 | 40.7 | 576x576 | Apache 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.
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:
| Component | License | What it means in practice |
|---|---|---|
rfdetr package (training, inference and export code) | Apache 2.0 | Commercially 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 detection | Apache 2.0 | Same as above. |
| RF-DETR-Seg, every size (Nano through 2XLarge) | Apache 2.0 | Same as above. |
| RF-DETR Keypoint (Preview) | Apache 2.0 | Same as above. |
RF-DETR Atto, Femto, Pico, XL and 2XL detection (rfdetr[plus]), and RF-DETR NAS models | Roboflow 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.