faster_rcnn(pretrained: bool | str = False, weights: FasterRCNNResNet50FPNWeights | None = None, overrides: object = {})Faster R-CNN with a ResNet-50-FPN backbone (Ren et al., NeurIPS 2015).
Alias of faster_rcnn_resnet50_fpn — the canonical reference
configuration: a ResNet-50 trunk (frozen BN) feeding a Feature Pyramid
Network, a Region Proposal Network over five pyramid levels, and a Fast
R-CNN RoI head. The COCO config uses num_classes = 91. Reaches
COCO box AP of 37.0 (reference fasterrcnn_resnet50_fpn).
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True →
the DEFAULT tag (FasterRCNNResNet50FPNWeights.COCO_V1);
a tag string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).Explicit weights enum member. Takes precedence over
pretrained.**overridesobject= {}Keyword overrides forwarded into
FasterRCNNConfig
(num_classes, rpn_pre_nms_top_n, score_thresh, ...).Returns
FasterRCNNForObjectDetectionDetector with the ResNet-50-FPN configuration applied (or with
overrides merged on top of it).
Examples
>>> import lucid
>>> from lucid.models.vision.faster_rcnn import faster_rcnn
>>> model = faster_rcnn(num_classes=91)
>>> model.eval()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape[-1]
91