Skip to main content
RF-DETR requires Python >= 3.10. Install it using any of the methods below.

Install RF-DETR

pip install rfdetr
The source archive installs the latest development version from the 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.
ExtraInstall commandWhat it adds
trainpip install rfdetr[train]Training dependencies: pytorch_lightning, albumentations, torchmetrics, pycocotools, scipy, roboflow, and more.
onnxpip install rfdetr[onnx]ONNX export: onnx, onnxsim, onnx_graphsurgeon, onnxruntime.
pluspip install rfdetr[plus]XL and 2XL detection models (rfdetr_plus). Licensed under PML 1.0.
lorapip install rfdetr[lora]LoRA backbone fine-tuning via peft.
loggerspip install rfdetr[loggers]Experiment tracking: TensorBoard, Weights & Biases, MLflow, ClearML.
You can combine extras in a single install command:
pip install "rfdetr[train,loggers]"
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.
1

Clone the repository

git clone --depth 1 -b develop https://github.com/roboflow/rf-detr.git
cd rf-detr
2

Create a virtual environment

python3.10 -m venv venv
source venv/bin/activate
pip install --upgrade pip
3

Install in development mode

pip install -e "."

Troubleshooting

If you see a permission error during installation, install the package for your user only:
pip install --user rfdetr
Alternatively, use a virtual environment to avoid permission issues entirely.
RF-DETR requires specific version ranges for packages like torch, transformers, and pydantic. If you encounter conflicts, install RF-DETR in an isolated virtual environment:
python3.10 -m venv rfdetr-env
source rfdetr-env/bin/activate
pip install rfdetr
Using uv also isolates dependencies automatically per project.
RF-DETR requires Python 3.10 or higher (tested on 3.10–3.13). Check your version with:
python --version
If you have an older version, install a newer Python release from python.org or use a version manager like pyenv.

Build docs developers (and LLMs) love