code: def __init__(
      self,
      box_roi_pool,  # Multi-scale RoIAlign pooling
      box_head,  # TwoMLPHead
      box_predictor,  # FastRCNNPredictor
      # Faster R-CNN training
      fg_iou_thresh,
      bg_iou_thresh,  # default: 0.5, 0.5
      batch_size_per_image,
      positive_fraction,  # default: 512, 0.25
      bbox_reg_weights,  # None
      # Faster R-CNN inference
      score_thresh,  # default: 0.05
      nms_thresh,  # default: 0.5
      detection_per_img,
  ):  # default: 100
      super(RoIHeads, self).__init__()
  
      self.box_similarity = box_ops.box_iou
      # assign ground-truth boxes for each proposal
      self.proposal_matcher = det_utils.Matcher(
          fg_iou_thresh,  # default: 0.5
          bg_iou_thresh,  # default: 0.5
          allow_low_quality_matches=False,
      )
  
      self.fg_bg_sampler = det_utils.BalancedPositiveNegativeSampler(
          batch_size_per_image, positive_fraction  # default: 512
      )  # default: 0.25
  
      if bbox_reg_weights is None:
          bbox_reg_weights = (10.0, 10.0, 5.0, 5.0)
      self.box_coder = det_utils.BoxCoder(bbox_reg_weights)
  
      self.box_roi_pool = box_roi_pool  # Multi-scale RoIAlign pooling
      self.box_head = box_head  # TwoMLPHead
      self.box_predictor = box_predictor  # FastRCNNPredictor
  
      self.score_thresh = score_thresh  # default: 0.05
      self.nms_thresh = nms_thresh  # default: 0.5
      self.detection_per_img = detection_per_img
  
file_path: deep-learning-for-image-processing/pytorch_object_detection/faster_rcnn/network_files/roi_head.py
imports: from typing import Optional, List, Dict, Tuple
  import torch
  from torch import Tensor
  import torch.nn.functional
  from .None import det_utils
  from .None import boxes
label_desc: Use image node_id 1 to create a new RoIHeads object from inherited base classes: torch.nn with example: obj = RoIHeads(box_roi_pool, box_head, box_predictor, fg_iou_thresh, bg_iou_thresh, batch_size_per_image, positive_fraction, bbox_reg_weights, score_thresh, nms_thresh, detection_per_img)