Skip to main content
RF-DETR provides pretrained weights for both object detection and instance segmentation, trained on Microsoft COCO. All latency numbers were measured on an NVIDIA T4 using TensorRT, FP16, and batch size 1.

Detection models

SizePython classInference aliasCOCO AP50COCO AP50:95Latency (ms)Params (M)ResolutionLicense
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
XL △RFDETRXLargerfdetr-xlarge77.458.611.5126.4700x700PML 1.0
2XL △RFDETR2XLargerfdetr-2xlarge78.560.117.2126.9880x880PML 1.0
△ The XLarge and 2XLarge detection models are part of the rfdetr_plus extension, licensed under PML 1.0. Install with pip install rfdetr[plus]. These models require a Roboflow account.

Segmentation models

SizePython classInference 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
All segmentation model sizes are licensed under Apache 2.0.

Choosing a model size

The right model size depends on your latency and accuracy constraints:
  • Nano / Small — best for edge devices, real-time applications, or when GPU resources are limited. Nano runs at 2.3 ms latency with 30.5 M parameters.
  • Medium — a balanced starting point for most use cases. Medium achieves 54.7 AP50:95 at 4.4 ms latency.
  • Large — higher accuracy at moderate cost. Large reaches 56.5 AP50:95 at 6.8 ms.
  • XLarge / 2XLarge — maximum accuracy for detection tasks where latency is less critical. These models require pip install rfdetr[plus].
Start with RFDETRMedium or RFDETRSegMedium and adjust up or down based on your performance requirements.

Load a model by class name

Import the class for your chosen size and instantiate it. The pretrained COCO weights are downloaded automatically on first use.
from rfdetr import RFDETRMedium

model = RFDETRMedium()
detections = model.predict("https://media.roboflow.com/dog.jpg", threshold=0.5)
To use a different size, replace the class name:
from rfdetr import RFDETRNano, RFDETRSmall, RFDETRLarge
from rfdetr import RFDETRSegNano, RFDETRSegSmall, RFDETRSegMedium, RFDETRSegLarge, RFDETRSegXLarge, RFDETRSeg2XLarge

Load a custom checkpoint

Use pretrain_weights to load a fine-tuned or custom checkpoint instead of the default COCO weights.
from rfdetr import RFDETRMedium

model = RFDETRMedium(pretrain_weights="path/to/checkpoint_best_total.pth")
detections = model.predict("image.jpg", threshold=0.5)
You can also use RFDETR.from_checkpoint() to automatically infer the model class from the checkpoint:
from rfdetr.detr import RFDETR

model = RFDETR.from_checkpoint("path/to/checkpoint_best_total.pth")
detections = model.predict("image.jpg", threshold=0.5)

Object detection

Run RF-DETR detection models on images, video, and streams.

Instance segmentation

Run RF-DETR segmentation models for pixel-level masks.

Benchmarks

Full benchmark comparison tables across all model sizes.

Train a model

Fine-tune RF-DETR on your own dataset.

Build docs developers (and LLMs) love