parsing_rcnn_model.py
def atrous_identity_block(input_tensor, kernel_size, filters, stage,
                          block, atrous_rate=(2, 2), use_bias=True, roi_res=False):
    '''The identity_block is the block that has no conv layer at shortcut
    # Arguments
        kernel_size: defualt 3, the kernel size of middle conv layer at main path
        filters: list of integers, the nb_filters of 3 conv layer at main path
        stage: integer, current stage label, used for generating layer names
        block: 'a','b'..., current block label, used for generating layer names
    '''
    nb_filter1, nb_filter2, nb_filter3 = filters
    conv_name_base = 'res' + str(stage) + block + '_branch'
    bn_name_base = 'bn' + str(stage) + block + '_branch'

    if roi_res:
        conv_name_base = 'mrcnn_mask_' + conv_name_base
        bn_name_base = 'mrcnn_mask_' + bn_name_base


    x = KL.Conv2D(nb_filter1, (1, 1), name=conv_name_base + '2a',  
                  use_bias=use_bias)(input_tensor)
    x = BatchNorm(axis=-1, name=bn_name_base + '2a')(x)
    x = KL.Activation('relu')(x)

    x = KL.Conv2D(nb_filter2, (kernel_size, kernel_size), dilation_rate=atrous_rate,  
                      padding='same', name=conv_name_base + '2b', use_bias=use_bias)(x)
    x = BatchNorm(axis=-1, name=bn_name_base + '2b')(x)
    x = KL.Activation('relu')(x)

    x = KL.Conv2D(nb_filter3, (1, 1), name=conv_name_base + '2c',  
                  use_bias=use_bias)(x)
    x = BatchNorm(axis=-1, name=bn_name_base + '2c')(x)

    x = KL.Add()([x, input_tensor])
    x = KL.Activation('relu')(x)
    return x
The identity_block is the block that has no conv layer at shortcut
    # Arguments
        kernel_size: defualt 3, the kernel size of middle conv layer at main path
        filters: list of integers, the nb_filters of 3 conv layer at main path
        stage: integer, current stage label, used for generating layer names
        block: 'a','b'..., current block label, used for generating layer names
    
The identity_block is the block that has no conv layer at shortcut
Arguments
kernel_size: defualt 3, the kernel size of middle conv layer at main path
filters: list of integers, the nb_filters of 3 conv layer at main path
stage: integer, current stage label, used for generating layer names
block: 'a','b'..., current block label, used for generating layer names
The identity_block is the block that has no conv layer at shortcut Arguments kernel_size : defualt 3 the kernel size of middle conv layer at main path filters : list of integers the nb_filters of 3 conv layer at main path stage : integer current stage label used for generating layer names block : ' a ' ' b ' ... current block label used for generating layer names
def atrous_identity_block(input_tensor, kernel_size, filters, stage,
                          block, atrous_rate=(2, 2), use_bias=True, roi_res=False):
    nb_filter1, nb_filter2, nb_filter3 = filters
    conv_name_base = 'res' + str(stage) + block + '_branch'
    bn_name_base = 'bn' + str(stage) + block + '_branch'
    if roi_res:
        conv_name_base = 'mrcnn_mask_' + conv_name_base
        bn_name_base = 'mrcnn_mask_' + bn_name_base
    x = KL.Conv2D(nb_filter1, (1, 1), name=conv_name_base + '2a',  
                  use_bias=use_bias)(input_tensor)
    x = BatchNorm(axis=-1, name=bn_name_base + '2a')(x)
    x = KL.Activation('relu')(x)
    x = KL.Conv2D(nb_filter2, (kernel_size, kernel_size), dilation_rate=atrous_rate,  
                      padding='same', name=conv_name_base + '2b', use_bias=use_bias)(x)
    x = BatchNorm(axis=-1, name=bn_name_base + '2b')(x)
    x = KL.Activation('relu')(x)
    x = KL.Conv2D(nb_filter3, (1, 1), name=conv_name_base + '2c',  
                  use_bias=use_bias)(x)
    x = BatchNorm(axis=-1, name=bn_name_base + '2c')(x)
    x = KL.Add()([x, input_tensor])
    x = KL.Activation('relu')(x)
    return x
def atrous_identity_block ( input_tensor , kernel_size , filters , stage , block , atrous_rate = ( 2 , 2 ) , use_bias = True , roi_res = False ) : nb_filter1 , nb_filter2 , nb_filter3 = filters conv_name_base = 'res' + str ( stage ) + block + '_branch' bn_name_base = 'bn' + str ( stage ) + block + '_branch' if roi_res : conv_name_base = 'mrcnn_mask_' + conv_name_base bn_name_base = 'mrcnn_mask_' + bn_name_base x = KL . Conv2D ( nb_filter1 , ( 1 , 1 ) , name = conv_name_base + '2a' , use_bias = use_bias ) ( input_tensor ) x = BatchNorm ( axis = - 1 , name = bn_name_base + '2a' ) ( x ) x = KL . Activation ( 'relu' ) ( x ) x = KL . Conv2D ( nb_filter2 , ( kernel_size , kernel_size ) , dilation_rate = atrous_rate , padding = 'same' , name = conv_name_base + '2b' , use_bias = use_bias ) ( x ) x = BatchNorm ( axis = - 1 , name = bn_name_base + '2b' ) ( x ) x = KL . Activation ( 'relu' ) ( x ) x = KL . Conv2D ( nb_filter3 , ( 1 , 1 ) , name = conv_name_base + '2c' , use_bias = use_bias ) ( x ) x = BatchNorm ( axis = - 1 , name = bn_name_base + '2c' ) ( x ) x = KL . Add ( ) ( [ x , input_tensor ] ) x = KL . Activation ( 'relu' ) ( x ) return x
The identity_block is the block that has no conv layer at shortcut
 Arguments
kernel_size: defualt 3, the kernel size of middle conv layer at main path
filters: list of integers, the nb_filters of 3 conv layer at main path
stage: integer, current stage label, used for generating layer names
block: 'a','b'..., current block label, used for generating layer names
The identity_block is the block that has no conv layer at shortcut Arguments kernel_size : defualt 3 the kernel size of middle conv layer at main path filters : list of integers the nb_filters of 3 conv layer at main path stage : integer current stage label used for generating layer names block : ' a ' ' b ' ... current block label used for generating layer names
'''The identity_block is the block that has no conv layer at shortcut
    # Arguments
        kernel_size: defualt 3, the kernel size of middle conv layer at main path
        filters: list of integers, the nb_filters of 3 conv layer at main path
        stage: integer, current stage label, used for generating layer names
        block: 'a','b'..., current block label, used for generating layer names
    '''
input_tensor
kernel_size
filters
stage
block
atrous_rate
use_bias
roi_res