class_docstr: Stage of CascadeRPNHead.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      anchor_generator (:obj:`ConfigDict` or dict): anchor generator config.
      adapt_cfg (:obj:`ConfigDict` or dict): adaptation config.
      bridged_feature (bool): whether update rpn feature. Defaults to False.
      with_cls (bool): whether use classification branch. Defaults to True.
      init_cfg :obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
          list[dict], optional): Initialization config dict.
          Defaults to None.
class_docstr_tok: ["Stage","of","CascadeRPNHead",".","Args",":","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","anchor_generator","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","anchor","generator","config",".","adapt_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","adaptation","config",".","bridged_feature","(","bool",")",":","whether","update","rpn","feature",".","Defaults","to","False",".","with_cls","(","bool",")",":","whether","use","classification","branch",".","Defaults","to","True",".","init_cfg",":","obj",":","`","ConfigDict","`","or","list","[",":","obj",":","`","ConfigDict","`","]","or","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict",".","Defaults","to","None","."]
docstr: Get proposal predict. Overriding to enable input ``anchor_list``
  from outside.
  
  Args:
      anchor_list (list[list[Tensor]]): Multi level anchors of each
          image.
      cls_scores (list[Tensor]): Classification scores for all
          scale levels, each is a 4D-tensor, has shape
          (batch_size, num_priors * num_classes, H, W).
      bbox_preds (list[Tensor]): Box energies / deltas for all
          scale levels, each is a 4D-tensor, has shape
          (batch_size, num_priors * 4, H, W).
      batch_img_metas (list[dict], Optional): Image meta info.
      cfg (:obj:`ConfigDict`, optional): Test / postprocessing
          configuration, if None, test_cfg would be used.
      rescale (bool): If True, return boxes in original image space.
          Defaults to False.
  
  Returns:
      list[:obj:`InstanceData`]: Object detection results of each image
      after the post process. Each item usually contains following keys.
  
          - scores (Tensor): Classification scores, has a shape
            (num_instance, )
          - labels (Tensor): Labels of bboxes, has a shape
            (num_instances, ).
          - bboxes (Tensor): Has a shape (num_instances, 4),
            the last dimension 4 arrange as (x1, y1, x2, y2).
docstr_tok: ["Get","proposal","predict",".","Overriding","to","enable","input","``","anchor_list","``","from","outside",".","Args",":","anchor_list","(","list","[","list","[","Tensor","]","]",")",":","Multi","level","anchors","of","each","image",".","cls_scores","(","list","[","Tensor","]",")",":","Classification","scores","for","all","scale","levels",",","each","is","a","4D-tensor",",","has","shape","(","batch_size",",","num_priors","*","num_classes",",","H",",","W",")",".","bbox_preds","(","list","[","Tensor","]",")",":","Box","energies","\/","deltas","for","all","scale","levels",",","each","is","a","4D-tensor",",","has","shape","(","batch_size",",","num_priors","*","4",",","H",",","W",")",".","batch_img_metas","(","list","[","dict","]",",","Optional",")",":","Image","meta","info",".","cfg","(",":","obj",":","`","ConfigDict","`",",","optional",")",":","Test","\/","postprocessing","configuration",",","if","None",",","test_cfg","would","be","used",".","rescale","(","bool",")",":","If","True",",","return","boxes","in","original","image","space",".","Defaults","to","False",".","Returns",":","list","[",":","obj",":","`","InstanceData","`","]",":","Object","detection","results","of","each","image","after","the","post","process",".","Each","item","usually","contains","following","keys",".","-","scores","(","Tensor",")",":","Classification","scores",",","has","a","shape","(","num_instance",",",")","-","labels","(","Tensor",")",":","Labels","of","bboxes",",","has","a","shape","(","num_instances",",",")",".","-","bboxes","(","Tensor",")",":","Has","a","shape","(","num_instances",",","4",")",",","the","last","dimension","4","arrange","as","(","x1",",","y1",",","x2",",","y2",")","."]
code: def predict_by_feat(
      self,
      anchor_list: List[List[Tensor]],
      cls_scores: List[Tensor],
      bbox_preds: List[Tensor],
      batch_img_metas: List[dict],
      cfg: Optional[ConfigDict] = None,
      rescale: bool = False,
  ) -> InstanceList:
      """Get proposal predict. Overriding to enable input ``anchor_list``
      from outside.
  
      Args:
          anchor_list (list[list[Tensor]]): Multi level anchors of each
              image.
          cls_scores (list[Tensor]): Classification scores for all
              scale levels, each is a 4D-tensor, has shape
              (batch_size, num_priors * num_classes, H, W).
          bbox_preds (list[Tensor]): Box energies / deltas for all
              scale levels, each is a 4D-tensor, has shape
              (batch_size, num_priors * 4, H, W).
          batch_img_metas (list[dict], Optional): Image meta info.
          cfg (:obj:`ConfigDict`, optional): Test / postprocessing
              configuration, if None, test_cfg would be used.
          rescale (bool): If True, return boxes in original image space.
              Defaults to False.
  
      Returns:
          list[:obj:`InstanceData`]: Object detection results of each image
          after the post process. Each item usually contains following keys.
  
              - scores (Tensor): Classification scores, has a shape
                (num_instance, )
              - labels (Tensor): Labels of bboxes, has a shape
                (num_instances, ).
              - bboxes (Tensor): Has a shape (num_instances, 4),
                the last dimension 4 arrange as (x1, y1, x2, y2).
      """
      assert len(cls_scores) == len(bbox_preds)
  
      result_list = []
      for img_id in range(len(batch_img_metas)):
          cls_score_list = select_single_mlvl(cls_scores, img_id)
          bbox_pred_list = select_single_mlvl(bbox_preds, img_id)
          proposals = self._predict_by_feat_single(
              cls_scores=cls_score_list,
              bbox_preds=bbox_pred_list,
              mlvl_anchors=anchor_list[img_id],
              img_meta=batch_img_metas[img_id],
              cfg=cfg,
              rescale=rescale,
          )
          result_list.append(proposals)
      return result_list
  
imports: from __future__ import division
  import copy
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from mmcv.ops import DeformConv2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule, ModuleList
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import SampleList
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptInstanceList, OptMultiConfig
  from ..task_modules.assigners import RegionAssigner
  from ..task_modules.samplers import PseudoSampler
  from ..utils import images_to_levels, multi_apply, select_single_mlvl, unpack_gt_instances
  from .base_dense_head import BaseDenseHead
  from .rpn_head import RPNHead
label_desc: Use image node_id 11 for calling the StageCascadeRPNHead obj's underlying member method code with example usage: obj.predict_by_feat(anchor_list, cls_scores, bbox_preds, batch_img_metas, cfg, rescale) and returns: result_list