code: def c2_postprocess(im_info, rpn_rois, rpn_roi_probs, tensor_mode):
      proposals = InstancesList(
          im_info=im_info,
          indices=rpn_rois[:, 0],
          extra_fields={
              "proposal_boxes": Caffe2Boxes(rpn_rois),
              "objectness_logits": (torch.Tensor, rpn_roi_probs),
          },
      )
      if not tensor_mode:
          proposals = InstancesList.to_d2_instances_list(proposals)
      else:
          proposals = [proposals]
      return proposals
  
imports: import math
  from typing import Dict
  import torch
  import torch.nn.functional
  from detectron2.layers import ShapeSpec, cat
  from detectron2.layers.roi_align_rotated import ROIAlignRotated
  from detectron2.modeling import poolers
  from detectron2.modeling.proposal_generator import rpn
  from detectron2.modeling.roi_heads.mask_head import mask_rcnn_inference
  from detectron2.structures import Boxes, ImageList, Instances, Keypoints, RotatedBoxes
  from .shared import alias, to_device
label_desc: Use image node_id 4 for calling the Caffe2RPN obj's underlying member method code with example usage: obj.c2_postprocess(im_info, rpn_rois, rpn_roi_probs, tensor_mode) and returns: proposals