umutonuryasar/rtdetr-r50vd-coco-detrflow
rtdetr-r50vd-coco-detrflow
RT-DETR R50 fine-tuned on COCO 2017 as part of the detrflow portfolio project — a complete object detection pipeline covering training, evaluation, serving, and deployment.
Model Details
Evaluation Results (COCO val2017)
Comparison with Baseline
The gap relative to the official checkpoint is expected — see Training Notes below.
Training Notes
This model was not trained to reproduce or surpass the official RT-DETR results. The goal of detrflow is to demonstrate a complete, production-style pipeline: data loading → training → evaluation → FastAPI serving → Gradio demo.
Key factors behind the mAP gap vs. the official checkpoint:
- Shorter schedule: 12 epochs vs. the standard 72-epoch RT-DETR recipe. DETR-family models are known to converge slowly and typically need long schedules to reach peak performance.
- No data augmentation beyond basics: The official training uses large-scale jitter, copy-paste, and mosaic augmentation. This run used standard resize + flip.
- Starting from a pre-trained backbone but re-initializing the decoder head weights, which requires additional epochs to recover.
For production use cases that require SOTA accuracy, the official `PekingU/rtdetr_r50vd` checkpoint (mAP 53.1) is recommended. This model is best suited as a reference implementation or starting point for custom fine-tuning.
Intended Use & Limitations
This model is intended for:
- Serving as a reference implementation within the detrflow end-to-end pipeline
- Developers who want a ready-to-use RT-DETR checkpoint with a working FastAPI/Gradio integration
- Starting point for domain-specific fine-tuning (replace COCO with your own dataset)
Limitations:
- mAP is below the official RT-DETR R50 result due to the shortened training schedule
- Small object detection (AP small: 0.169) is weaker than the official model
- No multi-scale test-time augmentation was applied
Usage
from transformers import AutoImageProcessor, RTDetrForObjectDetection
from PIL import Image
import torch
image = Image.open("your_image.jpg")
processor = AutoImageProcessor.from_pretrained("umutonuryasar/rtdetr-r50vd-coco-detrflow")
model = RTDetrForObjectDetection.from_pretrained("umutonuryasar/rtdetr-r50vd-coco-detrflow")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
results = processor.post_process_object_detection(
outputs,
target_sizes=torch.tensor([image.size[::-1]]),
threshold=0.5
)[0]
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
print(f"{model.config.id2label[label.item()]}: {score:.2f} — {box.tolist()}")Interactive Demo
Try it live on the detrflow HF Space — upload any image and adjust the confidence threshold.
Project
This model is part of detrflow, an end-to-end RT-DETR pipeline:
- Training — COCO 2017, custom DataLoader with augmentation, Hungarian loss (L1 + GIoU + CE)
- Inference —
RTDetrPredictorclass with threshold filtering and box rescaling - Serving — FastAPI REST API (
POST /predict), Dockerized - Demo — Gradio app deployed on HF Spaces
GitHub: umutonuryasar/detrflow
Citation
If you use this model, please cite the original RT-DETR paper:
@article{zhao2024detrs,
title={DETRs Beat YOLOs on Real-time Object Detection},
author={Zhao, Yian and Lv, Wenyu and Xu, Shangliang and Wei, Jinman and Wang, Guanzhong and Dang, Qingqing and Liu, Yi and Chen, Jie},
journal={CVPR},
year={2024}
}License
Apache 2.0 — see LICENSE.
