(self, channels=2048)
Feature Pyramid Attention
        :type channels: int
Feature Pyramid Attention
        :type channels: int
Feature Pyramid Attention : type channels : int
def __init__(self, channels=2048):
        """
        Feature Pyramid Attention
        :type channels: int
        """
        super(FPA, self).__init__()
        channels_mid = int(channels / 4)

        self.channels_cond = channels

        # Master branch
        self.conv_master = nn.Conv2d(self.channels_cond, channels, kernel_size=1, bias=False)
        self.bn_master = nn.BatchNorm2d(channels)

        # Global pooling branch
        self.conv_gpb = nn.Conv2d(self.channels_cond, channels, kernel_size=1, bias=False)
        #self.bn_gpb = nn.BatchNorm2d(channels)

        # C333 because of the shape of last feature maps is (16, 16).
        self.conv7x7_1 = nn.Conv2d(self.channels_cond, channels_mid, kernel_size=(7, 7), stride=2, padding=3, bias=False)
        self.bn1_1 = nn.BatchNorm2d(channels_mid)
        self.conv5x5_1 = nn.Conv2d(channels_mid, channels_mid, kernel_size=(5, 5), stride=2, padding=2, bias=False)
        self.bn2_1 = nn.BatchNorm2d(channels_mid)
        self.conv3x3_1 = nn.Conv2d(channels_mid, channels_mid, kernel_size=(3, 3), stride=2, padding=1, bias=False)
        self.bn3_1 = nn.BatchNorm2d(channels_mid)

        self.conv7x7_2 = nn.Conv2d(channels_mid, channels_mid, kernel_size=(7, 7), stride=1, padding=3, bias=False)
        self.bn1_2 = nn.BatchNorm2d(channels_mid)
        self.conv5x5_2 = nn.Conv2d(channels_mid, channels_mid, kernel_size=(5, 5), stride=1, padding=2, bias=False)
        self.bn2_2 = nn.BatchNorm2d(channels_mid)
        self.conv3x3_2 = nn.Conv2d(channels_mid, channels_mid, kernel_size=(3, 3), stride=1, padding=1, bias=False)
        self.bn3_2 = nn.BatchNorm2d(channels_mid)

        self.bn_upsample_1 = nn.BatchNorm2d(channels)
        self.conv1x1_up1 = nn.Conv2d(channels_mid, channels, kernel_size=(1, 1), stride=1, padding=0, bias=False)

        self.relu = nn.ReLU(inplace=True)
def __init__ ( self , channels = 2048 ) : super ( FPA , self ) . __init__ ( ) channels_mid = int ( channels / 4 ) self . channels_cond = channels # Master branch self . conv_master = nn . Conv2d ( self . channels_cond , channels , kernel_size = 1 , bias = False ) self . bn_master = nn . BatchNorm2d ( channels ) # Global pooling branch self . conv_gpb = nn . Conv2d ( self . channels_cond , channels , kernel_size = 1 , bias = False ) #self.bn_gpb = nn.BatchNorm2d(channels) # C333 because of the shape of last feature maps is (16, 16). self . conv7x7_1 = nn . Conv2d ( self . channels_cond , channels_mid , kernel_size = ( 7 , 7 ) , stride = 2 , padding = 3 , bias = False ) self . bn1_1 = nn . BatchNorm2d ( channels_mid ) self . conv5x5_1 = nn . Conv2d ( channels_mid , channels_mid , kernel_size = ( 5 , 5 ) , stride = 2 , padding = 2 , bias = False ) self . bn2_1 = nn . BatchNorm2d ( channels_mid ) self . conv3x3_1 = nn . Conv2d ( channels_mid , channels_mid , kernel_size = ( 3 , 3 ) , stride = 2 , padding = 1 , bias = False ) self . bn3_1 = nn . BatchNorm2d ( channels_mid ) self . conv7x7_2 = nn . Conv2d ( channels_mid , channels_mid , kernel_size = ( 7 , 7 ) , stride = 1 , padding = 3 , bias = False ) self . bn1_2 = nn . BatchNorm2d ( channels_mid ) self . conv5x5_2 = nn . Conv2d ( channels_mid , channels_mid , kernel_size = ( 5 , 5 ) , stride = 1 , padding = 2 , bias = False ) self . bn2_2 = nn . BatchNorm2d ( channels_mid ) self . conv3x3_2 = nn . Conv2d ( channels_mid , channels_mid , kernel_size = ( 3 , 3 ) , stride = 1 , padding = 1 , bias = False ) self . bn3_2 = nn . BatchNorm2d ( channels_mid ) self . bn_upsample_1 = nn . BatchNorm2d ( channels ) self . conv1x1_up1 = nn . Conv2d ( channels_mid , channels , kernel_size = ( 1 , 1 ) , stride = 1 , padding = 0 , bias = False ) self . relu = nn . ReLU ( inplace = True )