zeromodels/rtdetr-r18vd-coco-o365
*See [our collection](https://huggingface.co/collections/zeromodels/rt-detr-v1-and-v2-6a8eaf859a918a955e683778) for all versions of RT-DETR.*
Run RT-DETR with Keras 3: JAX, PyTorch, or TensorFlow
  
zeromodels/rtdetr-r18vd-coco-o365
Paper: DETRs Beat YOLOs on Real-time Object Detection (arXiv:2304.08069) · HF Papers
RT-DETR was the first DETR-style detector to beat YOLO on the real-time speed/accuracy tradeoff. It pairs a ResNet-vd backbone with a hybrid encoder that decouples intra-scale attention from cross-scale fusion, then feeds IoU-aware selected queries into a deformable decoder. It is NMS-free: a fixed set of queries, constant inference cost, no NMS threshold to tune.
For more details on the model, please go to PekingU's original model card.
Pure-Keras 3 conversion of `PekingU/rtdetr_r18vd_coco_o365` for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is an object detection checkpoint (RTDETRDetect) on COCO (ResNet-18-vd).
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.rt_detr import RTDETRDetect, RTDETRImageProcessor
model = RTDETRDetect.from_weights("zeromodels/rtdetr-r18vd-coco-o365")
processor = RTDETRImageProcessor.from_weights("zeromodels/rtdetr-r18vd-coco-o365")
image = Image.open("your_image.jpg").convert("RGB")
inputs = processor(image)
output = model(inputs["pixel_values"], training=False)
results = processor.post_process_object_detection(
output, threshold=0.5, target_sizes=[(image.height, image.width)]
)[0]
for score, name, box in zip(
results["scores"], results["label_names"], results["boxes"]
):
print(f"{name}: {float(score):.3f} {box}")Load any RT-DETR v1 variant the same way with from_weights("zeromodels/<variant>"):
Tips
- Set
KERAS_BACKENDbefore importing Keras / zeromodels. RTDETRImageProcessorkeepsdo_normalize=Falseby default (rescaled[0, 1]input, matching upstream).- See RT-DETR docs and Loading Weights.
- Community / upstream safetensors still work via the
hf:prefix, e.g.RTDETRDetect.from_weights("hf:PekingU/rtdetr_r18vd_coco_o365").
Special Thanks
A huge thank you to the RT-DETR authors (Baidu / PekingU) for creating and releasing these models.
License: Apache 2.0.
