code: def _fasterrcnn(
      arch: str, pretrained: bool, **kwargs: Any
  ) -> FasterRCNN:
      _kwargs = {
          "image_mean": default_cfgs[arch]["mean"],
          "image_std": default_cfgs[arch]["std"],
          "box_detections_per_img": 150,
          "box_score_thresh": 0.5,
          "box_positive_fraction": 0.35,
          "box_nms_thresh": 0.2,
          "rpn_nms_thresh": 0.2,
          "num_classes": len(default_cfgs[arch]["classes"]),
      }
  
      # Build the model
      _kwargs.update(kwargs)
      model = faster_rcnn.__dict__[arch](
          weights=None, weights_backbone=None, **_kwargs
      )
      model.cfg = default_cfgs[arch]
  
      if pretrained:
          # Load pretrained parameters
          load_pretrained_params(model, default_cfgs[arch]["url"])
      else:
          # Filter keys
          state_dict = {
              k: v
              for k, v in faster_rcnn.__dict__[arch](
                  weights=FasterRCNN_MobileNet_V3_Large_FPN_Weights.DEFAULT
              )
              .state_dict()
              .items()
              if not k.startswith("roi_heads.")
          }
  
          # Load state dict
          model.load_state_dict(state_dict, strict=False)
  
      return model
  
imports: from typing import Any, Dict
  from torchvision.models.detection import FasterRCNN, FasterRCNN_MobileNet_V3_Large_FPN_Weights, faster_rcnn
  from ...utils import load_pretrained_params
label_desc: Use image node_id 1 for calling a global function with example usage: _fasterrcnn(arch, pretrained) and returns: model