Closed
Conversation
Squashes previous apply/export/dvc-track commits into one.
- Coerce dataset.yaml name keys to int for consistent class filtering/per-class output - Remove unused num_classes in RF-DETR adapter - Simplify README YOLO backend description
- Sanitize RF-DETR dataset export dir names to prevent path traversal deletes - Remove FP16 eval pass/metrics and rename latency key to ms_per_frame - Add regression test for unsafe dataset_name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AB#2096 — Integrate RF-DETR backend (multi-backend training pipeline)
This PR introduces a config-driven multi-backend training pipeline that supports both Ultralytics YOLO and RF-DETR, while keeping the existing workflow stable: DVC stages, baseline comparison, unified metrics export, and side-by-side visualizations.
It also promotes a new "current best" baseline checkpoint for YOLO11m trained on the mapped classes: waste, cigarette, leaves_dense, and leaves_sparse.
Why
What changed
1) Config-driven backend selection (params.yaml)
train.modelselects a model key frommodels.<key>models.<key>.backenddetermines the backend (yoloorrfdetr)This establishes an extensible pattern: add a new model family by adding a new backend module + adapter while keeping evaluation/reporting stable.
2) Pipeline modularization (backend separation)
yolov8_training/train_pipeline.pyis now primarily:yolov8_training/backends/yolo_backend.py(YOLO train + finetune path)yolov8_training/backends/rfdetr_backend.py(RF-DETR train + dataset bridging + weights layout)This keeps train_pipeline.py predictable and makes adding "backend 3" straightforward.
3) RF-DETR training path + YOLO-compatible artifacts
runs/rfdetr/...weights/best.pt(so baseline export/downstream tooling work unchanged).checkpoint_best_*(fallback to a regular checkpoint so the pipeline can continue).4) Adapter to reuse the existing evaluation stack
yolov8_training/utils/rfdetr_adapter.py(RFDETRModelAdapter) that makes an RF-DETR model look likeultralytics.YOLOfor:maxDets=500+ patched COCOeval summarize).coco_extended_metrics) and exposed asmetrics/f1(B)so the shared logger reports the native value.5) Unified evaluation/reporting improvements
yolov8_training/utils/evaluate.pynow:metrics/f1(B)when present (otherwise computes F1 from precision/recall)6) DVC + docs + tests
rfdetr,pycocotools,supervision) and updated ignores for new artifact types (*.pth, outputs)."0"vs0consistently).How to use
Switching backends is a one-line change: