RF-DETR

A detection transformer that predicts a fixed set of objects instead of a dense grid, so it needs no NMS at inference. LibreYOLO supports it for four tasks.

Tasks
detection, instance segmentation, pose, oriented boxes
Sizes
n, s, m, l for detection, pose and oriented boxes; n through xx for segmentation
Install
pip install "libreyolo[rfdetr]"
Support tier
Flagship, since v1.0.0. Features are designed and fully GPU-validated here first.
Upstream
RF-DETR by Roboflow, Apache-2.0. Paper, source
Licenses
Code MIT, weights Apache-2.0. Commercial use
LibreRFDETRs, detection on video at 512 px.

Install

RF-DETR needs its own extra, which pulls in transformers for the backbone.

bash
pip install "libreyolo[rfdetr]"

Predict

Weights download from Hugging Face on first use and are cached locally.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreRFDETRs.pt")result = model(SAMPLE_IMAGE, save=True) for box in result.boxes:    print(box.cls, box.conf, box.xyxy)
CLI
libreyolo predict model=LibreRFDETRs.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True
Video
from libreyolo import LibreYOLO model = LibreYOLO("LibreRFDETRs.pt") # Any source the library accepts: file, folder, URL, webcam index,# RTSP stream, or a .streams listfor result in model.predict("clip.mp4", stream=True, save=True):    print(len(result.boxes))

The returned Results object is the one every family returns, so swapping in a different detector is a one line change. conf and max_det filter the query selection; there is no NMS step to tune. See prediction for sources, streaming and result handling.

Variants

Four sizes, and four tasks that share one architecture: segmentation, pose and oriented boxes reuse the detection decoder with a different head, so they take the same arguments. The sizes carry similar parameter counts and differ mainly in input resolution.

CheckpointInput (px)mAP 50-95Params (M)
LibreRFDETRn38451.430.47
LibreRFDETRs51255.132.11
LibreRFDETRm57657.433.69
LibreRFDETRl70458.633.93

COCO val2017, 500 images. Measured by the LibreYOLO benchmark harness and published on Vision Analysis, where latency across hardware and runtimes is compared and the full run records live.

Train

Training starts from a published checkpoint, for all four tasks. RF-DETR lists pretrained among the arguments its native trainer ignores, so passing pretrained=False does not give you a randomly initialized model here.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreRFDETRs.pt")model.train(data="my-dataset.yaml", epochs=50, imgsz=512, batch=8, lr0=1e-4)
CLI
libreyolo train model=LibreRFDETRs.pt data=my-dataset.yaml \  epochs=50 imgsz=512 batch=8 lr0=1e-4
LoRA
from libreyolo import LibreYOLO model = LibreYOLO("LibreRFDETRs.pt")model.train(data="my-dataset.yaml", epochs=50, lora=True)
Multi-GPU
libreyolo train model=LibreRFDETRs.pt data=my-dataset.yaml \  epochs=50 device=0,1 batch=-1

Two arguments matter more here than on a CNN detector. Keep lr0 at or below 1e-4, since transformer detectors diverge at learning rates a YOLO model tolerates. Leave imgsz at the checkpoint's native resolution unless you have a reason to change it. The input must divide evenly by the backbone patch size times the window count; LibreYOLO checks this before the run starts and names the nearest valid sizes.

See training for datasets, augmentation, multi-GPU and loggers.

Validate

val() returns a dictionary of metrics/ keys covering precision, recall, mAP 50 and mAP 50-95, measured against any dataset in the format you trained on.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreRFDETRs.pt") # val() returns a plain dict, not an objectmetrics = model.val(data="my-dataset.yaml", imgsz=512) print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])print(metrics["metrics/precision"], metrics["metrics/recall"])
CLI
libreyolo val model=LibreRFDETRs.pt data=my-dataset.yaml imgsz=512
Against COCO
# The bundled COCO yaml carries an embedded download script, so it# needs explicit permission unless the dataset is already local.libreyolo val model=LibreRFDETRn.pt data=coco.yaml imgsz=384 \  allow_download_scripts=True

Export

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
DetectionDetection to ONNX: supported. Detection to TorchScript: supported. Detection to ExecuTorch: supported. Detection to TensorRT: supported. Runtime parity coverage lives in tests/e2e/test_tensorrt.py.Detection to OpenVINO: supported. Runtime parity coverage lives in tests/e2e/test_openvino.py.Detection to Paddle: not supportedDetection to MNN: supported. Detection to RKNN: not supportedDetection to ncnn: not supportedDetection to TFLite: not supportedDetection to CoreML: supported. Conversion is available, but runtime parity requires a macOS runner.Detection to Core AI: supported.
Instance segmentationInstance segmentation to ONNX: supported. Instance segmentation to TorchScript: supported. Instance segmentation to ExecuTorch: supported. Instance segmentation to TensorRT: supported. A published Apache-2.0 trained segmentation checkpoint exports and reloads, but public top-k class membership changes.Instance segmentation to OpenVINO: supported. After Hungarian query alignment, the converted-runtime element match rate is 69.0%, below the validation bar.Instance segmentation to Paddle: not supportedInstance segmentation to MNN: not supportedInstance segmentation to RKNN: not supportedInstance segmentation to ncnn: not supportedInstance segmentation to TFLite: not supportedInstance segmentation to CoreML: not supportedInstance segmentation to Core AI: not supported
PosePose to ONNX: supported. Pose to TorchScript: supported. Pose to ExecuTorch: supported. Pose to TensorRT: supported. A published Apache-2.0 trained pose checkpoint exports and reloads, but matched public boxes fall to 0.704 IoU with 41.4-pixel coordinate drift.Pose to OpenVINO: supported. After Hungarian query alignment, the converted-runtime element match rate is 72.75%, below the validation bar.Pose to Paddle: not supportedPose to MNN: not supportedPose to RKNN: not supportedPose to ncnn: not supportedPose to TFLite: not supportedPose to CoreML: not supportedPose to Core AI: not supported
Oriented boxesOriented boxes to ONNX: supported. Oriented boxes to TorchScript: supported. Oriented boxes to ExecuTorch: supported. Oriented boxes to TensorRT: supported. A deterministic synthetic OBB fixture exports and reloads, but public top-k class membership changes.Oriented boxes to OpenVINO: supported. After Hungarian query alignment, the converted-runtime element match rate is 91.25%, below the validation bar.Oriented boxes to Paddle: not supportedOriented boxes to MNN: not supportedOriented boxes to RKNN: not supportedOriented boxes to ncnn: not supportedOriented boxes to TFLite: not supportedOriented boxes to CoreML: not supportedOriented boxes to Core AI: not supported

An exported artifact loads back through LibreYOLO() on its file suffix, so a .onnx or .engine file behaves like a checkpoint and returns the same Results. Running the graph in a bare runtime, with no LibreYOLO installed, is also supported, but then preprocessing and postprocessing are yours to write.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreRFDETRs.pt")model.export(format="onnx", imgsz=512)model.export(format="tensorrt", imgsz=512, half=True) # Arguments accepted for every format:##   format    "onnx" | "torchscript" | "executorch" | "tensorrt"#             | "openvino" | "paddle" | "mnn" | "rknn" | "ncnn"#             | "tflite" | "coreml" | "coreai".#             "engine" is an alias for tensorrt, "litert" for tflite.#   imgsz     int, or (height, width). Defaults to the checkpoint's#             native resolution.#   batch     int, default 1.#   half      bool, export in FP16. Default False.#   int8      bool, export in INT8. Default False. Needs `data`.#   data      path to a dataset YAML, used to calibrate int8.#   fraction  float, share of that calibration set to use. Default 1.0.#   dynamic   bool, dynamic axes. Default True.#   simplify  bool, run ONNX graph simplification. Default True.#   opset     int, ONNX opset. Chosen per family when not given.#   device    str, device to trace on. Defaults to the model's device.#   output_path  str, defaults to a name derived from the checkpoint.#   verbose   bool, default False.#   allow_download_scripts  bool, default False. Permits embedded#             Python in a dataset YAML that has to be downloaded.## A few formats take extra arguments of their own, such as an RKNN# target platform. Those are documented on each format's page.
CLI
libreyolo export model=LibreRFDETRs.pt format=onnx imgsz=512libreyolo export model=LibreRFDETRs.pt format=tensorrt imgsz=512 half=True
Use the exported file
from libreyolo import LibreYOLO # The factory routes on the file suffix, so an exported artifact loads# like any checkpoint and returns the same Results object.model = LibreYOLO("LibreRFDETRs.onnx")result = model(SAMPLE_IMAGE) print(result.boxes.xyxy)
Without LibreYOLO
import numpy as npimport onnxruntime as ort # Running the graph directly means doing your own preprocessing and# postprocessing. Inspect the signature before wiring anything up.session = ort.InferenceSession("LibreRFDETRs.onnx")name = session.get_inputs()[0].nameoutputs = session.run(None, {name: np.zeros((1, 3, 512, 512), dtype=np.float32)}) for meta, array in zip(session.get_outputs(), outputs):    print(meta.name, array.shape)

Checkpoints

Every published weight file for this family.

FileInput (px)Weights license
Detection
LibreRFDETRl.pt704apache-2.0
LibreRFDETRm.pt576apache-2.0
LibreRFDETRn.pt384apache-2.0
LibreRFDETRs.pt512apache-2.0
Instance segmentation
LibreRFDETRn-seg.pt312apache-2.0
LibreRFDETRs-seg.pt384apache-2.0
LibreRFDETRm-seg.pt432apache-2.0
LibreRFDETRl-seg.pt504apache-2.0
LibreRFDETRx-seg.pt624apache-2.0
LibreRFDETRxx-seg.pt768apache-2.0
Pose
LibreRFDETRn-pose.ptapache-2.0
LibreRFDETRs-pose.ptapache-2.0
LibreRFDETRm-pose.ptapache-2.0
LibreRFDETRl-pose.ptapache-2.0
LibreRFDETRx-pose.pt576apache-2.0
Oriented boxes
LibreRFDETRn-obb.pt384cc-by-4.0
LibreRFDETRs-obb.pt512cc-by-4.0
LibreRFDETRm-obb.pt576cc-by-4.0
LibreRFDETRl-obb.pt704cc-by-4.0

Every file above exists in the LibreYOLO org today and downloads on first use.

Licensing

Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.

This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.

Original work
RF-DETR, Roboflow
Upstream license
Apache-2.0
LibreYOLO code
MIT
Weights
Apache-2.0, republished at huggingface.co/LibreYOLO
Interpretation
Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code, and weights you train yourself on your own data are yours.

Citation

@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}
}

Copied from the authors' citation block at github.com/roboflow/rf-detr#citation.

Verified against LibreYOLO v1.5.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.