code: def __init__(
      self,
      in_channels: List[int],
      out_channels: int,
      deform_conv: bool = False,
  ) -> None:
      super().__init__()
  
      out_chans = out_channels // len(in_channels)
  
      conv_layer = DeformConv2d if deform_conv else nn.Conv2d
  
      self.in_branches = nn.ModuleList(
          [
              nn.Sequential(
                  conv_layer(chans, out_channels, 1, bias=False),
                  nn.BatchNorm2d(out_channels),
                  nn.ReLU(inplace=True),
              )
              for idx, chans in enumerate(in_channels)
          ]
      )
      self.upsample = nn.Upsample(
          scale_factor=2, mode="bilinear", align_corners=True
      )
      self.out_branches = nn.ModuleList(
          [
              nn.Sequential(
                  conv_layer(
                      out_channels, out_chans, 3, padding=1, bias=False
                  ),
                  nn.BatchNorm2d(out_chans),
                  nn.ReLU(inplace=True),
                  nn.Upsample(
                      scale_factor=2**idx,
                      mode="bilinear",
                      align_corners=True,
                  ),
              )
              for idx, chans in enumerate(in_channels)
          ]
      )
  
imports: from typing import Any, Callable, Dict, List, Optional
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision.models import resnet34, resnet50
  from torchvision.models._utils import IntermediateLayerGetter
  from torchvision.ops.deform_conv import DeformConv2d
  from doctr.file_utils import CLASS_NAME
  from ...classification import mobilenet_v3_large
  from ...utils import _bf16_to_float32, load_pretrained_params
  from .base import DBPostProcessor, _DBNet
label_desc: Use image node_id 1 to create a new FeaturePyramidNetwork object from inherited base classes: nn with example: obj = FeaturePyramidNetwork(in_channels, out_channels, deform_conv)