class_docstr: Region Proposal Network
  
  Args:
      anchor_generator (dict): configure of anchor generation
      rpn_target_assign (dict): configure of rpn targets assignment
      train_proposal (dict): configure of proposals generation
          at the stage of training
      test_proposal (dict): configure of proposals generation
          at the stage of prediction
      in_channel (int): channel of input feature maps which can be
          derived by from_config
class_docstr_tok: ["Region","Proposal","Network","Args",":","anchor_generator","(","dict",")",":","configure","of","anchor","generation","rpn_target_assign","(","dict",")",":","configure","of","rpn","targets","assignment","train_proposal","(","dict",")",":","configure","of","proposals","generation","at","the","stage","of","training","test_proposal","(","dict",")",":","configure","of","proposals","generation","at","the","stage","of","prediction","in_channel","(","int",")",":","channel","of","input","feature","maps","which","can","be","derived","by","from_config"]
code: def from_config(cls, cfg, input_shape):
      # FPN share same rpn head
      if isinstance(input_shape, (list, tuple)):
          input_shape = input_shape[0]
      return {"in_channel": input_shape.channels}
  
file_path: PaddleDetection/ppdet/modeling/proposal_generator/rpn_head.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import Normal
  from ppdet.core.workspace import register
  from .anchor_generator import AnchorGenerator
  from .target_layer import RPNTargetAssign
  from .proposal_generator import ProposalGenerator
  from ..cls_utils import _get_class_default_kwargs
label_desc: Use image node_id 2 for calling the RPNHead obj's underlying member method code with example usage: obj.from_config(cls, cfg, input_shape) and returns: dict