Install RF-DETR
develop branch. These changes have not been officially released and may be less stable than the published package.
Optional dependencies
RF-DETR ships with a minimal set of core dependencies. Install optional extras for specific use cases.| Extra | Install command | What it adds |
|---|---|---|
train | pip install rfdetr[train] | Training dependencies: pytorch_lightning, albumentations, torchmetrics, pycocotools, scipy, roboflow, and more. |
onnx | pip install rfdetr[onnx] | ONNX export: onnx, onnxsim, onnx_graphsurgeon, onnxruntime. |
plus | pip install rfdetr[plus] | XL and 2XL detection models (rfdetr_plus). Licensed under PML 1.0. |
lora | pip install rfdetr[lora] | LoRA backbone fine-tuning via peft. |
loggers | pip install rfdetr[loggers] | Experiment tracking: TensorBoard, Weights & Biases, MLflow, ClearML. |
The
plus extra installs the rfdetr_plus package, which is required for RFDETRXLarge and RFDETR2XLarge. These models are licensed under PML 1.0, separate from the Apache 2.0 license that covers the rest of the package.Development environment setup
If you plan to contribute to RF-DETR or modify the codebase locally, set up a development environment using the steps below.Troubleshooting
Permission denied when installing
Permission denied when installing
If you see a permission error during installation, install the package for your user only:Alternatively, use a virtual environment to avoid permission issues entirely.
Dependency conflicts with existing packages
Dependency conflicts with existing packages
RF-DETR requires specific version ranges for packages like Using
torch, transformers, and pydantic. If you encounter conflicts, install RF-DETR in an isolated virtual environment:uv also isolates dependencies automatically per project.Python version is too old
Python version is too old
RF-DETR requires Python 3.10 or higher (tested on 3.10–3.13). Check your version with:If you have an older version, install a newer Python release from python.org or use a version manager like
pyenv.