CSE445Computer Vision
Tutorials/Object Detection/OD 8B: RF-DETR Transformer Detection
OD-08BAdvanced 90 min

OD 8B: RF-DETR Transformer Detection

Part B extends transformer-based detection to RF-DETR, emphasizing practical training, inference, evaluation, and comparison with standard DETR-style detectors.

RF-DETRPyTorchRoboflowpycocotoolsMatplotlib

Code Structure Note

These notes are provided only to help students understand the code structure. Students should review, optimize, and adapt the code before using it in assignments, projects, or experiments.

Topics Covered
  1. 1RF-DETR model workflow: dataset setup, checkpoint selection, training, and inference
  2. 2Transformer detector outputs: confidence scores, class labels, and bounding boxes
  3. 3RF-DETR training configuration for custom object-detection datasets
  4. 4Evaluation against DETR-style baselines using mAP, precision, recall, and F1
  5. 5Practical strengths and limits of RF-DETR for classroom and project datasets

Learning Objectives

  • Prepare a custom detection dataset for RF-DETR training and validation
  • Run RF-DETR inference and inspect predicted boxes, labels, and confidence scores
  • Compare RF-DETR results with DETR using the same validation images and metrics
  • Explain where RF-DETR improves the practical workflow over a basic DETR pipeline

Key Takeaways

  • RF-DETR keeps the transformer detector idea but makes the workflow more usable for applied projects
  • A fair comparison requires the same dataset split, input size, metric settings, and confidence thresholds
  • RF-DETR can be a strong choice when students need transformer-based detection without building DETR training from scratch
  • Qualitative inspection is still necessary because mAP alone hides localization and class-confusion patterns

Tutorial Infographic

Notebook Resources

Jupyter Notebook

Student action area

Use this section to practice the tutorial code. Kaggle opens the prepared notebook, Colab lets you experiment in your own runtime, and the .ipynb download is best for local editing or submission.

Kaggle: follow the official tutorial notebook.
Colab: modify and rerun quickly.
IPYNB: keep a local copy.

Hands-On Exercises

  1. 1Train or run RF-DETR on a small custom dataset and save predictions for 10 validation images
  2. 2Create a side-by-side grid comparing DETR and RF-DETR predictions on the same images
  3. 3Compute mAP@50, mAP@50-95, precision, recall, and F1 for the RF-DETR run
  4. 4Write a short comparison explaining where RF-DETR succeeds or fails relative to DETR

Tools & Libraries

RF-DETRPyTorchRoboflowpycocotoolsMatplotlib