detectron2 Mask / Faster R-CNN (R50-FPN)
Faster R-CNN and Mask R-CNN from the detectron2 model zoo (ResNet-50 FPN, COCO): boxes, classes and, for Mask R-CNN, instance masks. Commercially usable.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
mask-rcnn-r50-fpn-3x-coco | synthetic (800x1344) | original (fp32) original portable kernels | 85.4 43.5 24.6 21.0 | 1601 / 1918 604 / 650 352 / 440 353 / 400 |
faster-rcnn-r50-fpn-3x-coco | synthetic (800x1344) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 83.6 41.4 22.8 19.5 18.9 5.35 (backbone + FPN only) | 1591 / 1898 626 / 708 390 / 490 391 / 450 413 / 438 258 (engine) |
Details
- Original code: https://github.com/facebookresearch/detectron2 at
1e3e13b - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: CC-BY-SA-3.0
- Licence evidence: https://github.com/facebookresearch/detectron2/blob/1e3e13bbf607b54f62205c4c33922521822fb298/MODEL_ZOO.md (License section)
- Training data: COCO 2017 (train, instance annotations) (COCO 2017 train (3x schedule); the ResNet-50 backbone was initialised from MSRA's ImageNet-1k model)
- Licence note: The detectron2 model-zoo weights are CC-BY-SA-3.0 (share-alike), and the COCO images carry their own licences.
- Options:
score_threshold= 0.05 (0.0 to 1.0),max_detections= 100 (>= 1) - Kernel libraries:
cudnn_hacc - Variants:
mask-rcnn-r50-fpn-3x-coco,faster-rcnn-r50-fpn-3x-coco - Outputs: boxes, scores, labels, masks; 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):
mask-rcnn-r50-fpn-3x-coco3000x4000 (0.6 GiB peak allocated, 0.7 reserved);faster-rcnn-r50-fpn-3x-coco3000x4000 (0.6 GiB peak allocated, 0.7 reserved) faster-rcnn-r50-fpn-3x-coco800x1344, first call: portable + torch.compile 26 s (cold Inductor cache), TensorRT fp16 16 s (ONNX + engine).mask-rcnn-r50-fpn-3x-cocooriginal 800x1344: torch.autocast(fp16) around the forwardfaster-rcnn-r50-fpn-3x-cocooriginal 800x1344: torch.autocast(fp16) around the forwardmask-rcnn-r50-fpn-3x-cocoload / first call: original 0.97 s / 0.836 s, portable 1.5 s / 0.417 s, kernels 0.22† s / 0.043 sfaster-rcnn-r50-fpn-3x-cocoload / first call: original 0.73 s / 0.045 s, portable 0.53 s / 0.247 s, kernels 0.14† s / 0.04 s- † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
- Protocol, median of 5 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls
Measured
pycocotools COCOeval of the top 100 detections per image. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
mask-rcnn-r50-fpn-3x-coco | COCO val2017, every 10th image, box mAP / mask mAP | 42.13 / 38.67 | 42.13 / 38.66 | 42.12 / 38.65 | 42.10 / 38.64 | |
faster-rcnn-r50-fpn-3x-coco | COCO val2017, every 10th image, box mAP | 41.54 | 41.44 | 41.58 | 41.58 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1.0 and p99 <= 2.0 (absolute error of the output boxes).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
mask-rcnn-r50-fpn-3x-coco | 0.09391 / 0.46488 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
faster-rcnn-r50-fpn-3x-coco | 0.49736 / 2.92376 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |