class_docstr: Feature Pyramid Network.
  
  This is an implementation of - Feature Pyramid Networks for Object
  Detection (https://arxiv.org/abs/1612.03144)
  
  Args:
      in_channels (List[int]): Number of input channels per scale.
      out_channels (int): Number of output channels (used at each scale)
      num_outs (int): Number of output scales.
      start_level (int): Index of the start input backbone level used to
          build the feature pyramid. Default: 0.
      end_level (int): Index of the end input backbone level (exclusive) to
          build the feature pyramid. Default: -1, which means the last level.
      add_extra_convs (bool | str): If bool, it decides whether to add conv
          layers on top of the original feature maps. Default to False.
          If True, its actual mode is specified by `extra_convs_on_inputs`.
          If str, it specifies the source feature map of the extra convs.
          Only the following options are allowed
  
          - 'on_input': Last feat map of neck inputs (i.e. backbone feature).
          - 'on_lateral':  Last feature map after lateral convs.
          - 'on_output': The last output feature map after fpn convs.
      extra_convs_on_inputs (bool, deprecated): Whether to apply extra convs
          on the original feature from the backbone. If True,
          it is equivalent to `add_extra_convs='on_input'`. If False, it is
          equivalent to set `add_extra_convs='on_output'`. Default to True.
      relu_before_extra_convs (bool): Whether to apply relu before the extra
          conv. Default: False.
      no_norm_on_lateral (bool): Whether to apply norm on lateral.
          Default: False.
      conv_cfg (dict): Config dict for convolution layer. Default: None.
      norm_cfg (dict): Config dict for normalization layer. Default: None.
      act_cfg (str): Config dict for activation layer in ConvModule.
          Default: None.
      upsample_cfg (dict): Config dict for interpolate layer.
          Default: `dict(mode='nearest')`
  
  Example:
      >>> import torch
      >>> in_channels = [2, 3, 5, 7]
      >>> scales = [340, 170, 84, 43]
      >>> inputs = [torch.rand(1, c, s, s)
      ...           for c, s in zip(in_channels, scales)]
      >>> self = FPN(in_channels, 11, len(in_channels)).eval()
      >>> outputs = self.forward(inputs)
      >>> for i in range(len(outputs)):
      ...     print(f'outputs[{i}].shape = {outputs[i].shape}')
      outputs[0].shape = torch.Size([1, 11, 340, 340])
      outputs[1].shape = torch.Size([1, 11, 170, 170])
      outputs[2].shape = torch.Size([1, 11, 84, 84])
      outputs[3].shape = torch.Size([1, 11, 43, 43])
code: def init_weights(self):
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              xavier_init(m, distribution="uniform")
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/necks/fpn.py
imports: import torch.nn
  import torch.nn.functional
  from annotator.uniformer.mmcv.cnn import ConvModule, xavier_init
  from ..builder import NECKS
label_desc: Use image node_id 2 for calling the FPN obj's underlying member method code with example usage: obj.init_weights() without return types