Models · Object detection

RTMDet (CSPNeXt, tiny / S / M / L / X; nano and M person detectors)

OpenMMLab's RTMDet (tiny, s, m, l, x on COCO; nano and m person detectors): real-time one-stage box detector, a CSPNeXt CNN with NMS. The person detectors supply the boxes for RTMPose. Apache-2.0.

stable Fork of open-mmlab/mmdetection@44ebd17 · backends: portable, kernels

Checkpoint

Paper 2022 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 2.46 ms 800x1344, fp16
vs the faster original 4.3× original fp32: 10.7 ms
Peak memory 29 MiB original: 73 MiB
Accuracy vs original fp32 +0.01 kernels box mAP, COCO val2017 (40.51 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install "fastforks-core[torchvision]"

from fastforks import detection

model = detection.load("rtmdet-tiny-coco")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.boxes  # also: scores, labels
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench rtmdet-tiny-coco

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, 800x1344 (the task’s standard size)

BackenddtypeTime per call (ms)vs original fp32Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed callfp32 10.7–73 MiB/96 MiB5.20.43
Original fp16torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed callfp16 13.80.78×48 MiB/64 MiB0.21.24
Portable fp32fp32not measured ––––
Portablefp16 5.741.9×36 MiB/56 MiB0.21.37
Kernelsfp16 2.464.3×29 MiB/66 MiB0.91.01
Portable + torch.compile 3.433.1×64 MiB/94 MiB14 (build)–
TensorRT fp16fp16 0.96211×50 MiBenginenot comparable19 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-10 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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-12Originalfp3235.9 1,813 MiB process–800x1344
Portablefp1627.0 1,545 MiB processmatches800x1344
Portablefp3228.6 1,551 MiB processmatches800x1344
Kernelsfp16not implemented–800x1344

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

Code
Apache-2.0 LICENSE
Weights
Apache-2.0 source
Training data

Our reading of the licences, not legal advice.

Weights

rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth 57.5 MB· hosted on OpenMMLab

fastforks downloads and checks these files on first use (fastforks download rtmdet-tiny-coco).

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

every 10th image, box mAP

Rundtypebox mAP ↑Δ box mAP vs fp32 originalimagesms / image
Original fp32fp3240.51 reference 500 39.8
Original fp16fp1639.95 −0.56 500 44.8
Portable fp32fp3240.53 +0.02 500 20.4
Portablefp1640.48 −0.03 500 21.1
Kernelsfp1640.52 +0.01 500 17.6

pycocotools COCOeval of the top 100 detections per image. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-10; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 44640884, 2026-11-17.

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.0037 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.16 and p99 <= 0.64 (absolute error of the output boxes).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.0037 not recorded
GPU default dtypes, mean |diff|≤ 0.16 0.30669
GPU default dtypes, p99 |diff|≤ 0.64 3.78379

Recorded for rtmdet-tiny-coco on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-11, with these kernels: cudnn_haccfvm_convfvm_extrafvm_mbfvm_r3

Details

RTMDet (Lyu et al. 2022, OpenMMLab): real-time one-stage detector, all convolutions: a CSPNeXt backbone (5 x 5 depthwise convs), a CSPNeXt-PAFPN neck and a head that predicts, per cell of the stride 8 / 16 / 32 maps, a score per class and the distances to the four box edges; class-wise NMS. COCO checkpoints (80 classes) from mmdetection and the person-only detectors mmpose ships as the box source of RTMPose (same backbone family as `fastforks.pose`'s RTMPose). The image is fitted into 640 x 640 (nano: 320 x 320); vendored from mmdetection (no mmdet / mmcv dependency). The portable `module()` is the whole network (class logits and decoded boxes per cell, before NMS).

Input / output
Input: one RGB image. Output: boxes, class labels, scores and instance masks.
Input size
any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (491 MiB allocated)
Options
  • score_threshold=0.050.0 to 1.0· changes the output
  • max_detections=100>= 1· changes the output
  • cuda_graphs=true
Outputs
boxes, scores, labels
Checkpoint
deepen=0.167, widen=0.375, neck_blocks=1, exp_on_reg=false
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
  • fvm_convfused convolutions for image classifiers
  • fvm_extrafused transformer row operations (rotary split, SwiGLU with LayerNorm)
  • fvm_mbfused MBConv blocks (MobileNet and EfficientNet families)
  • fvm_r3further fused classifier blocks
Apple (MPS)
fp32, fp16

Limitations

  • The image is resized like OpenCV 4's 8-bit INTER_LINEAR (what mmdetection calls); OpenCV 5 resizes differently by up to two grey levels, so a reference run on OpenCV 5 differs slightly.
  • Boxes are not clamped to the image, as upstream: at the right or bottom border they can reach a few pixels into the padding.
  • The person detectors' released config names COCO only; the training config stored in the checkpoints (and the file name) also lists Objects365.
  • Kernels keep CUDA graphs: their private pool and static outputs stay reserved, so peak reserved is ~65 MiB above portable (peak allocated is not); `cuda_graphs=false` or `release_graphs()` frees it.
Full reference, generated from the repository

OpenMMLab's RTMDet (tiny, s, m, l, x on COCO; nano and m person detectors): real-time one-stage box detector, a CSPNeXt CNN with NMS. The person detectors supply the boxes for RTMPose. Apache-2.0.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
rtmdet-tiny-cocosynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
10.7
13.8
5.74
2.46
3.43
0.962
73 / 96
48 / 64
36 / 56
29 / 66
64 / 94
80 / 122
rtmdet-s-cocosynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
12.1
14.5
6.13
2.75
3.56
1.19
86 / 106
73 / 92
49 / 82
38 / 94
76 / 98
93 / 130
rtmdet-m-cocosynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
14.7
17.8
7.50
4.27
4.78
2.39
168 / 200
168 / 198
92 / 112
75 / 182
115 / 130
156 / 212
rtmdet-l-cocosynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
19.5
20.4
9.59
5.52
10.6
3.59
295 / 316
332 / 356
170 / 210
149 / 286
178 / 226
283 / 318
rtmdet-x-cocosynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
32.2
24.2
13.1
8.30
11.8
6.17
480 / 518
585 / 604
254 / 298
229 / 378
271 / 292
471 / 504
rtmdet-nano-personsynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
12.9
16.0
7.39
1.82
4.23
0.769
14 / 30
12 / 30
9 / 28
9 / 52
48 / 64
49 / 58
rtmdet-m-personsynthetic (800x1344)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
14.1
16.3
7.18
3.89
4.44
2.38
168 / 200
168 / 198
92 / 112
75 / 182
115 / 128
153 / 190
Details
  • Original code: https://github.com/open-mmlab/mmdetection at 44ebd17b145c
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • Licence evidence: https://github.com/open-mmlab/mmdetection/blob/44ebd17b145c2372c4b700bfb9cb20dbd28ab64a/configs/rtmdet/README.md
  • Training data: COCO 2017 (train, instance annotations), ImageNet-1k (ILSVRC 2012 classification) (COCO 2017 train (300 epochs); the CSPNeXt backbones start from ImageNet-1k pretraining (configs/rtmdet/README.md))
    • rtmdet-nano-person: COCO 2017 (train, instance annotations), Objects365 (train, box annotations), ImageNet-1k (ILSVRC 2012 classification) (persons of COCO 2017 train and Objects365 train (100 epochs; the training config stored in the checkpoint); the CSPNeXt backbone starts from ImageNet-1k pretraining)
    • rtmdet-m-person: COCO 2017 (train, instance annotations), Objects365 (train, box annotations), ImageNet-1k (ILSVRC 2012 classification) (persons of COCO 2017 train and Objects365 train (100 epochs; the training config stored in the checkpoint); the CSPNeXt backbone starts from ImageNet-1k pretraining)
  • Options: score_threshold = 0.05 (0.0 to 1.0), max_detections = 100 (>= 1), cuda_graphs = True (speed only)
  • Kernel libraries: cudnn_hacc, fvm_conv, fvm_extra, fvm_mb, fvm_r3
  • Variants: rtmdet-tiny-coco, rtmdet-s-coco, rtmdet-m-coco, rtmdet-l-coco, rtmdet-x-coco, rtmdet-nano-person, rtmdet-m-person
  • Outputs: boxes, scores, labels; label_set: coco-80
  • Input size: any H x W >= 32, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): rtmdet-tiny-coco 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); rtmdet-s-coco 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); rtmdet-m-coco 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); rtmdet-l-coco 3000x4000 (0.6 GiB peak allocated, 0.6 reserved); rtmdet-x-coco 3000x4000 (0.7 GiB peak allocated, 0.7 reserved); rtmdet-nano-person 3000x4000 (0.4 GiB peak allocated, 0.5 reserved); rtmdet-m-person 3000x4000 (0.5 GiB peak allocated, 0.5 reserved)
  • rtmdet-tiny-coco 800x1344, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 19 s (ONNX + engine).
  • rtmdet-s-coco 800x1344, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 20 s (ONNX + engine).
  • rtmdet-m-coco 800x1344, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 22 s (ONNX + engine).
  • rtmdet-l-coco 800x1344, first call: portable + torch.compile 17 s (cold Inductor cache), TensorRT fp16 25 s (ONNX + engine).
  • rtmdet-x-coco 800x1344, first call: portable + torch.compile 19 s (cold Inductor cache), TensorRT fp16 28 s (ONNX + engine).
  • rtmdet-nano-person 800x1344, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 23 s (ONNX + engine).
  • rtmdet-m-person 800x1344, first call: portable + torch.compile 16 s (cold Inductor cache), TensorRT fp16 25 s (ONNX + engine).
  • rtmdet-tiny-coco original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-tiny-coco original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-s-coco original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-s-coco original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-m-coco original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-m-coco original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-l-coco original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-l-coco original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-x-coco original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-x-coco original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-nano-person original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-nano-person original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-m-person original (fp32) 800x1344: mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-m-person original 800x1344: torch.autocast(float16) around the call; mmdet 3.3.0 inference_detector (CPU cv2 resize + pad, network, decode, NMS: torchvision nms in mmcv's batched_nms logic), score_thr 0.05, 100 detections (card defaults), all in the timed call
  • rtmdet-tiny-coco load / first call: original 0.22 s / 1.242 s, portable 0.31 s / 1.539 s, kernels 2.12 s / 0.261 s
  • rtmdet-s-coco load / first call: original 0.27 s / 0.581 s, portable 0.28 s / 1.582 s, kernels 1.81 s / 0.212 s
  • rtmdet-m-coco load / first call: original 0.46 s / 0.313 s, portable 0.72 s / 1.304 s, kernels 1.66 s / 1.197 s
  • rtmdet-l-coco load / first call: original 0.68 s / 0.323 s, portable 0.99 s / 1.292 s, kernels 2.43 s / 1.167 s
  • rtmdet-x-coco load / first call: original 1.0 s / 0.608 s, portable 1.05 s / 1.256 s, kernels 2.39 s / 1.162 s
  • rtmdet-nano-person load / first call: original 0.14 s / 2.695 s, portable 0.19 s / 2.196 s, kernels 4.13 s / 0.602 s
  • rtmdet-m-person load / first call: original 0.51 s / 0.025 s, portable 0.31 s / 0.389 s, kernels 1.0 s / 0.246 s
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

pycocotools COCOeval of the top 100 detections per image. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
rtmdet-tiny-cocoCOCO val2017, every 10th image, box mAP40.5139.9540.4840.5340.52
rtmdet-s-cocoCOCO val2017, every 10th image, box mAP45.3644.5845.2745.3545.37
rtmdet-m-cocoCOCO val2017, every 10th image, box mAP49.1149.1449.1149.1549.14
rtmdet-l-cocoCOCO val2017, every 10th image, box mAP52.3752.3952.3752.3852.41
rtmdet-x-cocoCOCO val2017, every 10th image, box mAP52.7952.7952.7952.7752.85
rtmdet-nano-personCOCO val2017, every 10th image, box AP of the person class36.8636.7936.9136.8636.94
rtmdet-m-personCOCO val2017, every 10th image, box AP of the person class60.2060.2160.2060.2160.21

Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-10; 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, 2026-11-10.

Parity

CPU, float32: max |diff| <= 0.0037 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.16 and p99 <= 0.64 (absolute error of the output boxes).

variantkernels error vs original, mean / p99GPU, torchkernels used
rtmdet-tiny-coco0.30669 / 3.78379RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
rtmdet-s-coco0.96654 / 9.43566RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
rtmdet-m-coco0.09531 / 0.32148RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
rtmdet-l-coco0.23124 / 2.21498RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
rtmdet-x-coco0.07914 / 0.24827RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
rtmdet-nano-person0.10524 / 0.42335RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
rtmdet-m-person0.12766 / 0.96977RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120

Limitations

  • The image is resized like OpenCV 4's 8-bit INTER_LINEAR (what mmdetection calls); OpenCV 5 resizes differently by up to two grey levels, so a reference run on OpenCV 5 differs slightly.
  • Boxes are not clamped to the image, as upstream: at the right or bottom border they can reach a few pixels into the padding.
  • The person detectors' released config names COCO only; the training config stored in the checkpoints (and the file name) also lists Objects365.
  • Kernels keep CUDA graphs: their private pool and static outputs stay reserved, so peak reserved is ~65 MiB above portable (peak allocated is not); cuda_graphs=false or release_graphs() frees it.

Example output

One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).

Input
Output
  • person 0.74
Astronaut Eileen Collins, input
Input · 100%

Input: Astronaut Eileen Collins, NASA (public domain).