RF-DETR Keypoint
Roboflow RF-DETR Keypoint Preview: predicts people and their 17 COCO joints from a whole image using a DINOv2 backbone and transformer decoder. Apache-2.0 code and preview weights.
stable Fork of roboflow/rf-detr@5b22dfc · backends: portable, kernels
- Paper RF-DETR: Neural Architecture Search for Real-Time Detection Transformers ICLR 2026 · first released 12 Nov 2025
Checkpoint rf-detr-keypoint-preview
Paper 2025 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install "fastforks-core[torchvision,transformers]"
from fastforks import pose
model = pose.load("rf-detr-keypoint-preview") # kernels on a supported GPU, else portable PyTorch
result = model(image, boxes=...)
result.keypoints # also: keypoint_scores, boxes, scores
result.backend # what ran: mode, device, dtype, kernels fastforks bench rf-detr-keypoint-preview Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 1080x1920 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32pinned RF-DETR torchvision resize/normalize, original network and uncertainty-fused PostProcess | fp32 | 29.4 | 0.65× | 305 MiB/322 MiB | 4.7 | 0.66 |
| Original fp16the authors' float16 model option; pinned RF-DETR torchvision resize/normalize, original network and uncertainty-fused PostProcess; authors inference(compile=False, dtype=float16, inplace=True) | fp16 | 19.3 | – | 186 MiB/244 MiB | 1.5 | 0.08 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 18.2 | 1.1× | 179 MiB/204 MiB | 2.7 | 0.38 |
| Kernels | fp16 | 9.46 | 2.0× | 176 MiB/224 MiB | 3.8 | 0.45 |
| Portable + torch.compile | 8.00 | 2.4× | 191 MiB/220 MiB | 48 (build) | – | |
| TensorRT fp16network on person crops only | fp16 | 4.28 | 4.5× | 124 MiBenginenot comparable | 67 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-11 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-12 | Original | fp32 | 148 | 2,074 MiB process | – | 1080x1920 |
| Portable | fp16 | 135 | 1,737 MiB process | differs | 1080x1920 | |
| Portable | fp32 | 148 | 1,830 MiB process | matches | 1080x1920 | |
| Kernels | fp16 | not implemented | – | 1080x1920 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
Our reading of the licences, not legal advice.
Weights
rf-detr-keypoint-preview-xlarge.pth 164 MB· hosted on repo.roboflow.comfastforks downloads and checks these files on first use (fastforks download rf-detr-keypoint-preview).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
COCO val2017
predicted people, keypoint AP
| Run | dtype | keypoint AP ↑ | Δ keypoint AP vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 71.8 | reference | 5000 | – |
| Original fp16 | fp16 | 71.8 | +0.0 | 5000 | – |
| Portable fp32 | not measured | ||||
| Portable | fp16 | 71.8 | +0.0 | 5000 | – |
| Kernels | fp16 | 71.8 | ±0.0 | 5000 | – |
Bottom-up on all 5,000 validation images, no ground-truth boxes; people ranked by their predicted person score, after model-specific decoding; pycocotools OKS AP. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-11; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 0050000f, 2026-11-11.
COCO val2017
every 10th image, predicted people, keypoint AP
| Run | dtype | keypoint AP ↑ | Δ keypoint AP vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 72.7 | reference | 500 | – |
| Original fp16 | fp16 | 72.9 | +0.2 | 500 | – |
| Portable fp32 | fp32 | 72.7 | +0.0 | 500 | 32.4 |
| Portable | fp16 | 72.9 | +0.2 | 500 | – |
| Kernels | fp16 | 72.8 | +0.1 | 500 | – |
Bottom-up on the same every-tenth-image subset for all modes, ranked by predicted person score after model-specific decoding; pycocotools OKS AP. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-11; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 44640884, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 0050000f, 2026-11-11.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.12 and p99 <= 0.32 (absolute error of the output keypoints).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.0001 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.12 | 0.07925 |
| GPU default dtypes, p99 |diff| | ≤ 0.32 | 0.21301 |
| gpu_min_score | ≤ 0.3 | not recorded |
Recorded for rf-detr-keypoint-preview on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-11, with these kernels: fastbb
Details
Roboflow RF-DETR Keypoint Preview: a DINOv2-small backbone with windowed attention and a deformable transformer decoder that predicts people and 17 COCO joints directly from the whole image. The 40.7M-parameter Apache-2.0 preview uses 576 x 576 square inputs and conditional keypoint queries. Person confidence includes the upstream localization-uncertainty fusion; joint confidence is findability. No person detector, boxes or NMS are required.
- Input / output
- Input: one RGB image and a box per person. Output: keypoints with confidence scores for every person.
- Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (526 MiB allocated)
- Options
score_threshold=0.50.0 to 1.0· changes the output
- Outputs
keypoints,keypoint_scores,boxes,scores- CUDA kernels
fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbones
- Apple (MPS)
- fp32, fp16
Limitations
- Requires the optional transformers and torchvision libraries.
- This is the Apache-2.0 Keypoint Preview checkpoint; restricted RF-DETR Plus detection variants are not included.
- module() exports raw boxes, class logits and keypoint predictions; confidence fusion and thresholding remain outside the exported graph.
- Float16 and float32 may retain different people near the score threshold; raw query ordering can differ across export engines.
- torch.compile uses upstream positional-interpolation graph breaks; fullgraph=True is unsupported. Fixed-shape torch.export and ONNX remain supported.
Full reference, generated from the repository
Roboflow RF-DETR Keypoint Preview: predicts people and their 17 COCO joints from a whole image using a DINOv2 backbone and transformer decoder. Apache-2.0 code and preview weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
rf-detr-keypoint-preview | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 29.4 19.3 18.2 9.46 8.00 4.28 (network on person crops only) | 305 / 322 186 / 244 179 / 204 176 / 224 191 / 220 264 / 294 |
Details
- Original code: https://github.com/roboflow/rf-detr at
5b22dfc09406 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/roboflow/rf-detr/blob/5b22dfc0940697ce1abdfa681a5f7392b3eddbfb/README.md#keypoints
- Training data: COCO 2017 (train, instance annotations), LVD-142M (DINOv2's curated web-image set, not released) (Author README: pretrained on COCO person keypoints; DINOv2-small backbone originates from LVD-142M pretraining. Full intermediate training provenance is not stated.)
- Options:
score_threshold= 0.5 (0.0 to 1.0) - Kernel libraries:
fastbb - Variants:
rf-detr-keypoint-preview - Outputs: keypoints, keypoint_scores, boxes, scores; label_set:
coco-keypoints-17 - Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
rf-detr-keypoint-preview3000x4000 (0.5 GiB peak allocated, 0.6 reserved) rf-detr-keypoint-preview1080x1920, first call: portable + torch.compile 48 s (cold Inductor cache), TensorRT fp16 67 s (ONNX + engine).rf-detr-keypoint-previeworiginal (fp32) 1080x1920: pinned RF-DETR torchvision resize/normalize, original network and uncertainty-fused PostProcessrf-detr-keypoint-previeworiginal 1080x1920: the authors' float16 model option; pinned RF-DETR torchvision resize/normalize, original network and uncertainty-fused PostProcess; authors inference(compile=False, dtype=float16, inplace=True)rf-detr-keypoint-previewload / first call: original 1.49 s / 0.083 s, portable 2.66 s / 0.386 s, kernels 2.7 s / 0.384 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Bottom-up on all 5,000 validation images, no ground-truth boxes; people ranked by their predicted person score, after model-specific decoding; pycocotools OKS AP. Bottom-up on the same every-tenth-image subset for all modes, ranked by predicted person score after model-specific decoding; pycocotools OKS AP. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
rf-detr-keypoint-preview | COCO val2017, predicted people, keypoint AP | 71.8 | 71.8 | 71.8 | 71.8 | ||
rf-detr-keypoint-preview | COCO val2017, every 10th image, predicted people, keypoint AP | 72.7 | 72.9 | 72.9 | 72.7 | 72.8 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 0050000f, 2026-11-11; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 44640884, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 0050000f, 2026-11-11.
Parity
CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.12 and p99 <= 0.32 (absolute error of the output keypoints).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
rf-detr-keypoint-preview | 0.07925 / 0.21301 | RTX 5060 Ti, torch 2.14.1+cu130 | fastbb@7d058322634d:sm_120 |
Limitations
- Requires the optional transformers and torchvision libraries.
- This is the Apache-2.0 Keypoint Preview checkpoint; restricted RF-DETR Plus detection variants are not included.
- module() exports raw boxes, class logits and keypoint predictions; confidence fusion and thresholding remain outside the exported graph.
- Float16 and float32 may retain different people near the score threshold; raw query ordering can differ across export engines.
- torch.compile uses upstream positional-interpolation graph breaks; fullgraph=True is unsupported. Fixed-shape torch.export and ONNX remain supported.
Example output
One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).
Input: Astronaut Eileen Collins, NASA (public domain).