detr_resnet50(pretrained: bool | str = False, weights: DETRResNet50Weights | None = None, overrides: object = {})DETR with ResNet-50 backbone (Carion et al., ECCV 2020).
Builds a DETRForObjectDetection with the paper-cited
ResNet-50 + transformer configuration: 100 object queries, a 6-layer
encoder + 6-layer decoder with d_model = 256, 8 attention heads,
and dim_feedforward = 2048. The COCO config uses
num_classes = 91. Reaches COCO box mAP of 42.0 (paper Table 1).
Approximately 41.5M parameters with a notable no-anchor / no-NMS
design.
Model Size
Parameters
pretrainedbool or str= FalseFalse → random init; True
→ the DEFAULT tag (DETRResNet50Weights.COCO_2017); a
tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).pretrained.**overridesobject= {}DETRConfig
(num_queries, num_classes, dropout,
num_encoder_layers, num_decoder_layers, d_model, ...).Returns
DETRForObjectDetectionDetector with the DETR ResNet-50 configuration applied (or with
overrides merged on top of it).
Notes
See Carion et al., "End-to-End Object Detection with Transformers",
ECCV 2020 (arXiv:2005.12872). Pretrained weights are converted from
the original Facebook DETR detr_resnet50 checkpoint and hosted
under lucid-dl/detr-resnet-50.
Examples
>>> import lucid
>>> from lucid.models.vision.detr import detr_resnet50
>>> model = detr_resnet50()
>>> x = lucid.randn(1, 3, 800, 800)
>>> out = model(x)
>>> out.logits.shape
(1, 100, 92)