class_docstr: The class for implementing DRRG and TextSnake U-Net-like FPN.
  
  DRRG: `Deep Relational Reasoning Graph Network for Arbitrary Shape
  Text Detection <https://arxiv.org/abs/2003.07493>`_.
  
  TextSnake: `A Flexible Representation for Detecting Text of Arbitrary
  Shapes <https://arxiv.org/abs/1807.01544>`_.
  
  Args:
      in_channels (list[int]): Number of input channels at each scale. The
          length of the list should be 4.
      out_channels (int): The number of output channels.
      init_cfg (dict or list[dict], optional): Initialization configs.
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      init_cfg: Optional[Union[Dict, List[Dict]]] = dict(
          type="Xavier",
          layer=["Conv2d", "ConvTranspose2d"],
          distribution="uniform",
      ),
  ) -> None:
      super().__init__(init_cfg=init_cfg)
  
      assert len(in_channels) == 4
      assert isinstance(out_channels, int)
  
      blocks_out_channels = [out_channels] + [
          min(out_channels * 2**i, 256) for i in range(4)
      ]
      blocks_in_channels = (
          [blocks_out_channels[1]]
          + [
              in_channels[i] + blocks_out_channels[i + 2]
              for i in range(3)
          ]
          + [in_channels[3]]
      )
  
      self.up4 = nn.ConvTranspose2d(
          blocks_in_channels[4],
          blocks_out_channels[4],
          kernel_size=4,
          stride=2,
          padding=1,
      )
      self.up_block3 = UpBlock(
          blocks_in_channels[3], blocks_out_channels[3]
      )
      self.up_block2 = UpBlock(
          blocks_in_channels[2], blocks_out_channels[2]
      )
      self.up_block1 = UpBlock(
          blocks_in_channels[1], blocks_out_channels[1]
      )
      self.up_block0 = UpBlock(
          blocks_in_channels[0], blocks_out_channels[0]
      )
  
file_path: mmocr/mmocr/models/textdet/necks/fpn_unet.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from mmengine.model import BaseModule
  from torch import nn
  from mmocr.registry import MODELS
label_desc: Use image node_id 1 to create a new FPN_UNet object from inherited base classes: BaseModule with example: obj = FPN_UNet(in_channels, out_channels, init_cfg)