CoolFace
Modelpublic

umutonuryasar/rtdetr-r50vd-coco-detrflow

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes8downloads
Model Card

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

PropertyValue
Base model`PekingU/rtdetr_r50vd`
BackboneResNet-50-vd
Training dataCOCO 2017 (118k train / 5k val)
Epochs12
Effective batch size64 (batch 16 × grad accum 4)
OptimizerAdamW, lr=1e-4, warmup 1 epoch
HardwareNVIDIA A100 40GB (Google Colab Pro+)
Precisionbfloat16

Evaluation Results (COCO val2017)

MetricValue
mAP (IoU 0.50:0.95)0.336
AP500.423
AP750.361
AP small0.169
AP medium0.412
AP large0.572
AR@10.303
AR@100.487
AR@1000.581

Comparison with Baseline

ModelmAP (IoU 0.50:0.95)AP50AP75Notes
PekingU/rtdetr_r50vd (official)0.531——Trained 72 epochs, full schedule
This model (detrflow fine-tune)0.3360.4230.36112 epochs, portfolio demo

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

python
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 — RTDetrPredictor class 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:

bibtex
@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.