RT-DETR R101 Hits 875K Monthly Downloads Beating YOLO Without NMS
Peking University's Hugging Face release makes the strongest RT-DETR checkpoint a one-line load in Transformers, hitting 56.2 AP on COCO.
Takeaways
- Peking University published the RT-DETR R101-vd checkpoint pretrained on Objects365 and finetuned on COCO to Hugging Face.
- The model reaches 56.2 AP on COCO val2017 at 74 FPS with 76M parameters, beating comparable YOLO variants.
- Fully end-to-end detector, no NMS post-processing, based on the CVPR 2024 DETRs Beat YOLOs paper.
- Key design: hybrid encoder splitting intra-scale attention from CNN-based cross-scale fusion, plus uncertainty-minimal query selection.
- Supports runtime speed tuning by dropping decoder layers without any retraining.
- Apache-2.0 license, native Transformers integration, and already 875k downloads with 11 finetunes on the Hub.
At publication, Hugging Face’s R101 checkpoint had recorded more than 875,000 downloads in the Hub’s displayed monthly counter. Hugging Face derives that metric from eligible model-file requests, so repeated pulls from the same client can contribute more than once.
The checkpoint combines the largest ResNet backbone in the original RT-DETR lineup with Objects365 pretraining, COCO fine-tuning, safetensors weights, and built-in transformers support. Developers evaluating YOLO-style detectors get a high-accuracy, end-to-end alternative that removes non-maximum suppression from the inference pipeline.
The model behind the counter
RT-DETR, introduced in the RT-DETR paper and published at CVPR 2024, applies DETR’s set-prediction approach to real-time object detection. One-to-one matching assigns ground-truth objects to predictions during training. At inference, the decoder emits a fixed set of boxes and class scores, allowing score filtering without a separate NMS stage.
The r101vd name identifies a ResNet-101 backbone with ResNet-D-style stem and downsampling changes. The checkpoint contains about 76.8 million parameters, requires roughly 259 GFLOPs at the paper’s 640 by 640 benchmark resolution, and stores its weights in safetensors under the Apache 2.0 license.
The coco_o365 suffix records the training sequence: pretraining on Objects365 followed by fine-tuning on COCO. Objects365 supplies a broader detection corpus, while the final COCO stage produces a head for COCO’s 80 object categories.
Accuracy, with a hardware footnote
The paper reports the following COCO val2017 results across the original ResNet-based RT-DETR family. COCO AP averages precision across intersection-over-union thresholds from 0.50 through 0.95.
| Model | Pretraining | Parameters | GFLOPs | FPS | AP |
|---|---|---|---|---|---|
| RT-DETR-R18 | COCO | 20M | 60 | 217 | 46.5 |
| RT-DETR-R50 | COCO | 42M | 136 | 108 | 53.1 |
| RT-DETR-R101 | COCO | 76M | 259 | 74 | 54.3 |
| RT-DETR-R50 | Objects365, then COCO | 42M | 136 | 108 | 55.3 |
| RT-DETR-R101 | Objects365, then COCO | 76M | 259 | 74 | 56.2 |
Objects365 pretraining raises the reported R101 result from 54.3 to 56.2 AP, a gain of 1.9 points. The R101 Objects365 row corresponds to this Hugging Face checkpoint. In the same benchmark suite, the paper reports that RT-DETR-R50 exceeded DINO-Deformable-R50-5scale by 2.2 AP and ran about 21 times faster.
The FPS figures describe an optimized TensorRT FP16 path on specific hardware. The transformers example below uses PyTorch eager execution by default, where latency depends on precision, batch size, image transfer, compiler settings, and GPU architecture. Production estimates require benchmarks against the intended runtime.
The speed comes from selective attention
RT-DETR’s hybrid encoder limits expensive attention to the lowest-resolution, highest-level feature map. Its Attention-based Intra-scale Feature Interaction module, called AIFI, processes that map, while the CNN-based Cross-scale Feature Fusion module, called CCFF, combines information across feature levels at lower computational cost.
The decoder begins with encoder features selected by an uncertainty-minimal query mechanism. The selector considers classification and localization quality together, giving the decoder stronger initial object queries and improving box refinement without NMS.
The checkpoint ships with six decoder layers, and the paper evaluates inference with fewer active layers to exchange some AP for lower latency without retraining. Teams using this technique should persist the selected layer count as part of the model artifact and benchmark each configuration separately.
Run it through Transformers
The architecture is integrated into the Transformers documentation, so loading uses built-in classes and leaves remote code disabled. Install a PyTorch build for the target hardware, then add the remaining dependencies:
python -m pip install -U transformers pillow requests
from io import BytesIO
import requests
import torch
from PIL import Image
from transformers import RTDetrForObjectDetection, RTDetrImageProcessor
checkpoint = "PekingU/rtdetr_r101vd_coco_o365"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
processor = RTDetrImageProcessor.from_pretrained(checkpoint)
model = RTDetrForObjectDetection.from_pretrained(checkpoint)
model = model.to(device).eval()
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
response = requests.get(url, timeout=30)
response.raise_for_status()
image = Image.open(BytesIO(response.content)).convert("RGB")
inputs = processor(images=image, return_tensors="pt").to(device)
with torch.inference_mode():
outputs = model(**inputs)
target_sizes = torch.tensor(
[[image.height, image.width]],
device=device,
)
result = processor.post_process_object_detection(
outputs,
target_sizes=target_sizes,
threshold=0.3,
)[0]
for score, label, box in zip(
result["scores"],
result["labels"],
result["boxes"],
):
name = model.config.id2label[label.item()]
coordinates = [round(value, 2) for value in box.tolist()]
print(f"{name}: {score.item():.3f} {coordinates}")
The post-processing call converts predicted boxes back to coordinates in the original image. Its threshold removes low-confidence detections while preserving the model’s set predictions; NMS remains absent. The checkpoint’s processor configuration resizes inputs to 640 by 640 before inference.
Production deployments should pin a Hub commit through the revision argument for both the processor and model. Recording the transformers, PyTorch, CUDA, and export-tool versions also prevents silent runtime changes during rebuilds.
Where R101 earns its footprint
- Server-side COCO inference: The checkpoint provides strong reported AP across the standard 80 COCO categories and removes NMS configuration from the serving path.
- Custom-class fine-tuning: Load the checkpoint with new
id2label,label2id, andnum_labelsvalues plusignore_mismatched_sizes=True. The classification heads are reinitialized while compatible backbone, encoder, and decoder weights are retained. - Multiple latency tiers: The decoder-layer technique can produce several speed profiles from one set of trained weights, provided each profile is versioned and evaluated independently.
- Memory-constrained hardware: The 76.8 million parameters occupy roughly 307 MB as raw FP32 weights before activations and runtime buffers. Compatible FP16 execution cuts the raw weight footprint roughly in half. Edge deployments can start with smaller PekingU checkpoints, including the R18 and R34 variants.
- Small or dense objects: The default 640 by 640 resize can erase fine detail, and the model’s 300-query budget caps the number of candidate detections. Larger configured inputs or tiled inference can help, with additional compute and task-specific evaluation.
The R101 Objects365 checkpoint is suited to server-class inference and transfer learning where its 56.2 reported COCO AP justifies the parameter count. Projects governed by edge latency, memory limits, or extreme image resolution should begin with a lighter backbone or a tiled inference design.