class_docstr: Implementation of Region Proposal Network.
class_docstr_tok: ["Implementation","of","Region","Proposal","Network","."]
code: def __init__(
      self,
      backbone,
      neck,
      rpn_head,
      train_cfg,
      test_cfg,
      pretrained=None,
  ):
      super(RPN, self).__init__()
      self.backbone = build_backbone(backbone)
      self.neck = build_neck(neck) if neck is not None else None
      rpn_train_cfg = train_cfg.rpn if train_cfg is not None else None
      rpn_head.update(train_cfg=rpn_train_cfg)
      rpn_head.update(test_cfg=test_cfg.rpn)
      self.rpn_head = build_head(rpn_head)
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
      self.init_weights(pretrained=pretrained)
  
file_path: insightface/detection/scrfd/mmdet/models/detectors/rpn.py
imports: import mmcv
  from mmcv.image import tensor2imgs
  from mmdet.core import bbox_mapping
  from ..builder import DETECTORS, build_backbone, build_head, build_neck
  from .base import BaseDetector
label_desc: Use image node_id 1 to create a new RPN object from inherited base classes: BaseDetector with example: obj = RPN(backbone, neck, rpn_head, train_cfg, test_cfg, pretrained)