Downloads · 30 days
68
5% of all-time downloads
stevenbucaille/rf-detr-nano
rf-detr-nano is a object detection model from stevenbucaille. Use it when you need objects located in an image. It is set up for transformers. The card lists the license as apache-2.0.
RF-DETR is a real-time detection transformer family introduced in RF-DETR: Neural Architecture Search for Real-Time Detection Transformers by Robinson et al. and integrated in 🤗 Transformers via PR 36895. Disclaimer:…
Downloads · 30 days
68
5% of all-time downloads
All-time downloads
1.3K
Public
Parameters
30.5M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors122 MB · 100%
From the Hugging Face model README
RF-DETR is a real-time detection transformer family introduced in RF-DETR: Neural Architecture Search for Real-Time Detection Transformers by Robinson et al. and integrated in 🤗 Transformers via PR #36895. Disclaimer: This model was originally contributed by stevenbucaille in 🤗 transformers.
RF-DETR is an end-to-end object detection model that combines ideas from LW-DETR and Deformable DETR: a DINOv2-with-registers style ViT backbone (with an RF-DETR windowing pattern for efficient attention), a multi-scale projector between encoder and decoder, and a multi-scale deformable DETR decoder for fast convergence and strong accuracy–latency tradeoffs.
Key Architectural Details:
Training Details:
You can use the raw model for object detection. See the model hub to look for all available RF-DETR models.
Here is how to use this model:
from transformers import AutoImageProcessor, RfDetrForObjectDetection
import torch
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = AutoImageProcessor.from_pretrained("stevenbucaille/rf-detr-nano")
model = RfDetrForObjectDetection.from_pretrained("stevenbucaille/rf-detr-nano")
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
# convert outputs (bounding boxes and class logits) to COCO API
# let's only keep detections with score > 0.35
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.35)[0]
for score, label, box in list(zip(results["scores"], results["labels"], results["boxes"]))[:8]:
box = [round(i, 2) for i in box.tolist()]
print(
f"Detected {model.config.id2label[label.item()]} with confidence "
f"{round(score.item(), 3)} at location {box}"
)
This should output:
Detected cat with confidence 0.994 at location [14.23, 54.15, 316.36, 473.81]
Detected remote with confidence 0.989 at location [334.14, 76.85, 371.13, 188.12]
Detected cat with confidence 0.956 at location [347.04, 26.2, 639.14, 375.12]
Detected remote with confidence 0.986 at location [40.14, 73.54, 175.75, 117.99]
Detected couch with confidence 0.42 at location [1.1, 1.34, 641.29, 473.79]
Detected couch with confidence 0.446 at location [0.73, 1.16, 641.54, 475.87]
Detected remote with confidence 0.341 at location [335.15, 77.2, 371.18, 187.61]
Detected remote with confidence 0.2 at location [334.06, 138.49, 351.61, 184.69]
These checkpoints are trained on the standard COCO 2017 object detection dataset label space (80 categories) as reflected in config.id2label.
@misc{robinson2026rfdetrneuralarchitecturesearch,
title={RF-DETR: Neural Architecture Search for Real-Time Detection Transformers},
author={Isaac Robinson and Peter Robicheaux and Matvei Popov and Deva Ramanan and Neehar Peri},
year={2026},
eprint={2511.09554},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2511.09554},
}