CoolFace
Modelpublic

zeromodels/rtdetr-r18vd-coco-o365

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes27downloads
Model Card

*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

![GitHub](https://github.com/IMvision12/ZeroModels) ![Docs](https://imvision12.github.io/ZeroModels/rt_detr/) ![Collection](https://huggingface.co/collections/zeromodels/rt-detr-v1-and-v2-6a8eaf859a918a955e683778)

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

python
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>"):

VariantHubBackbone
rtdetr-r18vd`zeromodels/rtdetr-r18vd`ResNet-18-vd
rtdetr-r18vd-coco-o365`zeromodels/rtdetr-r18vd-coco-o365`ResNet-18-vd (COCO+O365)
rtdetr-r34vd`zeromodels/rtdetr-r34vd`ResNet-34-vd
rtdetr-r50vd`zeromodels/rtdetr-r50vd`ResNet-50-vd
rtdetr-r50vd-coco-o365`zeromodels/rtdetr-r50vd-coco-o365`ResNet-50-vd (COCO+O365)
rtdetr-r101vd`zeromodels/rtdetr-r101vd`ResNet-101-vd
rtdetr-r101vd-coco-o365`zeromodels/rtdetr-r101vd-coco-o365`ResNet-101-vd (COCO+O365)

Tips

  • —Set KERAS_BACKEND before importing Keras / zeromodels.
  • —RTDETRImageProcessor keeps do_normalize=False by 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.