aten_model.py
def deeplab_resnet_share(img_inputs, architecture):
    """
    Build the architecture of resnet-101.
    img_inputs: a list of input image
    """

    # Stage 1
    conv1 = KL.Conv2D(64, (7, 7), strides=(2, 2), 
        name='conv1', use_bias=False)
    bn_conv1 = BatchNorm(axis=-1, name='bn_conv1')
    c1 = []
    for img_input in img_inputs:
        x = KL.ZeroPadding2D((3, 3))(img_input)
        x = conv1(x)
        x = bn_conv1(x)
        x = KL.Activation('relu')(x)
        x = KL.MaxPooling2D((3, 3), strides=(2, 2), padding="same")(x)
        c1.append(x)

    # Stage 2
    features = conv_block_share(c1, 3, [64, 64, 256], stage=2, block='a', strides=(1, 1), use_bias=False)
    features = identity_block_share(features, 3, [64, 64, 256], stage=2, block='b', use_bias=False)
    features = identity_block_share(features, 3, [64, 64, 256], stage=2, block='c', use_bias=False)
    # Stage 3
    features = conv_block_share(features, 3, [128, 128, 512], stage=3, block='a', use_bias=False)
    features = identity_block_share(features, 3, [128, 128, 512], stage=3, block='b1', use_bias=False)
    features = identity_block_share(features, 3, [128, 128, 512], stage=3, block='b2', use_bias=False)
    features = identity_block_share(features, 3, [128, 128, 512], stage=3, block='b3', use_bias=False)
    # Stage 4
    features = conv_block_share(features, 3, [256, 256, 1024], stage=4, block='a', use_bias=False)
    block_count = {"resnet50": 5, "resnet101": 22}[architecture]
    for i in range(1, block_count+1):
        features = identity_block_share(features, 3, [256, 256, 1024], stage=4, block='b%d'%i, use_bias=False)
    # Stage 5
    features = atrous_conv_block_share(features, 3, [512, 512, 2048], stage=5, block='a', atrous_rate=(2, 2), use_bias=False)
    features = atrous_identity_block_share(features, 3, [512, 512, 2048], stage=5, block='b', atrous_rate=(2, 2), use_bias=False)
    c5 = atrous_identity_block_share(features, 3, [512, 512, 2048], stage=5, block='c', atrous_rate=(2, 2), use_bias=False)

    return c1, c5

    Build the architecture of resnet-101.
    img_inputs: a list of input image
    
Build the architecture of resnet-101.
img_inputs: a list of input image
Build the architecture of resnet - 101 . img_inputs : a list of input image
def deeplab_resnet_share(img_inputs, architecture):
    conv1 = KL.Conv2D(64, (7, 7), strides=(2, 2), 
        name='conv1', use_bias=False)
    bn_conv1 = BatchNorm(axis=-1, name='bn_conv1')
    c1 = []
    for img_input in img_inputs:
        x = KL.ZeroPadding2D((3, 3))(img_input)
        x = conv1(x)
        x = bn_conv1(x)
        x = KL.Activation('relu')(x)
        x = KL.MaxPooling2D((3, 3), strides=(2, 2), padding="same")(x)
        c1.append(x)
    features = conv_block_share(c1, 3, [64, 64, 256], stage=2, block='a', strides=(1, 1), use_bias=False)
    features = identity_block_share(features, 3, [64, 64, 256], stage=2, block='b', use_bias=False)
    features = identity_block_share(features, 3, [64, 64, 256], stage=2, block='c', use_bias=False)
    features = conv_block_share(features, 3, [128, 128, 512], stage=3, block='a', use_bias=False)
    features = identity_block_share(features, 3, [128, 128, 512], stage=3, block='b1', use_bias=False)
    features = identity_block_share(features, 3, [128, 128, 512], stage=3, block='b2', use_bias=False)
    features = identity_block_share(features, 3, [128, 128, 512], stage=3, block='b3', use_bias=False)
    features = conv_block_share(features, 3, [256, 256, 1024], stage=4, block='a', use_bias=False)
    block_count = {"resnet50": 5, "resnet101": 22}[architecture]
    for i in range(1, block_count+1):
        features = identity_block_share(features, 3, [256, 256, 1024], stage=4, block='b%d'%i, use_bias=False)
    features = atrous_conv_block_share(features, 3, [512, 512, 2048], stage=5, block='a', atrous_rate=(2, 2), use_bias=False)
    features = atrous_identity_block_share(features, 3, [512, 512, 2048], stage=5, block='b', atrous_rate=(2, 2), use_bias=False)
    c5 = atrous_identity_block_share(features, 3, [512, 512, 2048], stage=5, block='c', atrous_rate=(2, 2), use_bias=False)
    return c1, c5
def deeplab_resnet_share ( img_inputs , architecture ) : conv1 = KL . Conv2D ( 64 , ( 7 , 7 ) , strides = ( 2 , 2 ) , name = 'conv1' , use_bias = False ) bn_conv1 = BatchNorm ( axis = - 1 , name = 'bn_conv1' ) c1 = [ ] for img_input in img_inputs : x = KL . ZeroPadding2D ( ( 3 , 3 ) ) ( img_input ) x = conv1 ( x ) x = bn_conv1 ( x ) x = KL . Activation ( 'relu' ) ( x ) x = KL . MaxPooling2D ( ( 3 , 3 ) , strides = ( 2 , 2 ) , padding = "same" ) ( x ) c1 . append ( x ) features = conv_block_share ( c1 , 3 , [ 64 , 64 , 256 ] , stage = 2 , block = 'a' , strides = ( 1 , 1 ) , use_bias = False ) features = identity_block_share ( features , 3 , [ 64 , 64 , 256 ] , stage = 2 , block = 'b' , use_bias = False ) features = identity_block_share ( features , 3 , [ 64 , 64 , 256 ] , stage = 2 , block = 'c' , use_bias = False ) features = conv_block_share ( features , 3 , [ 128 , 128 , 512 ] , stage = 3 , block = 'a' , use_bias = False ) features = identity_block_share ( features , 3 , [ 128 , 128 , 512 ] , stage = 3 , block = 'b1' , use_bias = False ) features = identity_block_share ( features , 3 , [ 128 , 128 , 512 ] , stage = 3 , block = 'b2' , use_bias = False ) features = identity_block_share ( features , 3 , [ 128 , 128 , 512 ] , stage = 3 , block = 'b3' , use_bias = False ) features = conv_block_share ( features , 3 , [ 256 , 256 , 1024 ] , stage = 4 , block = 'a' , use_bias = False ) block_count = { "resnet50" : 5 , "resnet101" : 22 } [ architecture ] for i in range ( 1 , block_count + 1 ) : features = identity_block_share ( features , 3 , [ 256 , 256 , 1024 ] , stage = 4 , block = 'b%d' % i , use_bias = False ) features = atrous_conv_block_share ( features , 3 , [ 512 , 512 , 2048 ] , stage = 5 , block = 'a' , atrous_rate = ( 2 , 2 ) , use_bias = False ) features = atrous_identity_block_share ( features , 3 , [ 512 , 512 , 2048 ] , stage = 5 , block = 'b' , atrous_rate = ( 2 , 2 ) , use_bias = False ) c5 = atrous_identity_block_share ( features , 3 , [ 512 , 512 , 2048 ] , stage = 5 , block = 'c' , atrous_rate = ( 2 , 2 ) , use_bias = False ) return c1 , c5
Build the architecture of resnet-101.
Build the architecture of resnet - 101 .
"""
    Build the architecture of resnet-101.
    img_inputs: a list of input image
    """ # Stage 1 # Stage 2 # Stage 3 # Stage 4 # Stage 5
img_inputs
architecture