AGENT SKILL

rf-detr

Use and maintain RF-DETR for real-time object detection, instance segmentation, keypoint preview, training, export, deployment, and repository development.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
rf-detr
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use and maintain RF-DETR for real-time object detection, instance segmentation, keypoint preview, training, export, deployment, and repository development.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

RF-DETR Repo Skill

Use this skill when a task involves the rfdetr Python package or the RF-DETR repository: selecting model variants, running prediction, fine-tuning on COCO/YOLO/keypoint datasets, exporting artifacts, deploying to inference runtimes, or editing the RF-DETR source tree.

RF-DETR is a PyTorch/DINOv2-based real-time vision model family for object detection, instance segmentation, and keypoint preview. The public package name is rfdetr and the default concrete detection model for new examples is RFDETRSmall / "rfdetr-small".

Install and smoke-check first

For ordinary package use:

pip install rfdetr
python -c "from rfdetr import RFDETRSmall; print(RFDETRSmall.size)"

Add extras only for the workflow you need:

pip install "rfdetr[train,cli]"       # training and Lightning CLI
pip install "rfdetr[augment]"         # Albumentations / Kornia augmentation backends
pip install "rfdetr[onnx]"            # ONNX export and ONNX Runtime inspection
pip install "rfdetr[tensorrt]"        # TensorRT export on NVIDIA GPU hosts
pip install "rfdetr[tflite]"          # experimental TFLite export
pip install "rfdetr[executorch]"      # experimental ExecuTorch export
pip install "rfdetr[coreml]"          # native CoreML export on supported macOS hosts
pip install "rfdetr[plus]"            # Plus detection models; separate package/license

Run the bundled read-only environment check when import, optional dependency, CLI, or backend readiness is unclear:

python scripts/check_rfdetr_environment.py
python scripts/check_rfdetr_environment.py --extras train onnx augment --check-cuda

Route by task

User task Open
Choose an RF-DETR model class/alias, run image/video/stream prediction, load checkpoints, interpret supervision detections/keypoints, fix labels/devices/shape/downloads sub-skills/inference-and-models/SKILL.md
Fine-tune/evaluate detection, segmentation, or keypoint models; validate COCO/YOLO/keypoint datasets; use rfdetr Lightning CLI and YAML configs; debug resume, DDP, augmentation, loggers sub-skills/training-and-cli/SKILL.md
Export to ONNX, TensorRT, TFLite, ExecuTorch, or CoreML; choose deployment artifacts; diagnose optional backend constraints and output naming sub-skills/export-and-deployment/SKILL.md
Modify RF-DETR source, tests, docs, configs, package metadata, CI, or examples while following repository contribution rules sub-skills/repository-development/SKILL.md

Shared references

Core decisions to preserve

  1. Default new detection examples to RFDETRSmall / "rfdetr-small"; treat RFDETRBase / "rfdetr-base" as deprecated for new examples, docs, and tests.
  2. Use released sized segmentation classes (RFDETRSegNano, RFDETRSegSmall, RFDETRSegMedium, RFDETRSegLarge, RFDETRSegXLarge, RFDETRSeg2XLarge); do not use RFDETRSegPreview for new work.
  3. Use preview variants only when the capability has no released sized version. In current RF-DETR evidence, keypoints are preview-only: RFDETRKeypointPreview / "rfdetr-keypoint-preview".
  4. Keep optional backend claims honest. A CPU import check does not verify TensorRT, CoreML, ExecuTorch QNN, XLA, or CUDA-specific behavior.
  5. Prefer bundled scripts in this skill for inspection and preflight checks. They are designed to be safe, read-only, and runnable without downloading pretrained weights or starting training.

Common first-response patterns

  • For an inference question, ask for the task family (detection, segmentation, keypoint), checkpoint source if any, input type, and whether the user needs CPU, CUDA, or deployment-runtime constraints.
  • For a training question, validate dataset layout before recommending a long run, then choose model family, extras, batch/effective-batch plan, resume semantics, and evaluation split.
  • For an export question, start with ONNX unless the target runtime requires another artifact. Reject invalid static combinations early, especially dynamic_batch=True for ExecuTorch/CoreML or QNN without soc.
  • For repository changes, follow RF-DETR TDD and style rules, choose focused tests by changed paths, and run full pre-commit before handoff.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351