yolo_darknet53代码解析

yolo_darknet53解析

参考链接:https://github.com/qqwweee/keras-yolo3

yolo作为one-stage检测算法,即一次性目标检测算法。yolo经历过5次迭代,其中v1-v3是原作者Joseph Redmon更新优化,之后的版本是由其他作者更新。

其中yolov1论文地址:https://arxiv.org/pdf/1506.02640.pdf

darknet53 的解析参考 https://www.cnblogs.com/chenhuabin/p/13908615.html

源码使用keras复现的 参考@qqwweee的源码,有问题可以评论区留言

darknet53

def conv_bn_relu(inputs, filters, kernel_size, stride):
    """
    darknet53的卷积基本结构 : conv2D -> BN -> leakyReLU
    """
    if stride == 1:
        padding = "same"
    else:
        padding = "valid"
    conv = Conv2D(filters=filters, kernel_size=kernel_size, strides=stride, padding=padding, use_bias=False)(inputs)
    bn = BatchNormalization()(conv)
    relu = LeakyReLU()(bn)
    return relu

def darknet53(inputs):
    """
    darknet53:
        - darknet53 卷积基本结构为:conv2d -> BN -> leakyReLU   参考文中 conv_bn_relu() 函数
        - darknet53 总共有23组shortcut() 根据23组shortcut可以分为5组,分别为1 2 8 8 4,即每一组的
                    结构是相同的,详情可以看下面代码(以1_1_1, 2_2_1, 2_2_2标识,第一个数值代表组数,
                    第二个代表复用结构的数量,第三个代表顺序)
        - darknet53 假定输入的图片大小为416,输出图片大小为13*13 则在stride=2的时候 图片的大小会缩小为原来的1/2
                    在13*13 26*26 52*52 是darknet53的对外输出的3种尺寸(基于输入为416*416)
                    13*13 -> 32倍降采样           降采样(下采样)倍数高, 则感受野越大   适合对应的是anchor尺寸大(物体尺寸比较大)
                    26*26 -> 16倍降采样           适合对应的是anchor尺寸中等(物体尺寸中等)
                    52*52 -> 8倍降采样            适合对应的是anchor尺寸小(物体尺寸小)
    """
    x = conv_bn_relu(inputs=inputs, filters=32, kernel_size=3, stride=1)  # 这里的输入为 416*416
    x = ZeroPadding2D(((1, 0), (1, 0)))(x)
    x1 = conv_bn_relu(inputs=x, filters=64, kernel_size=3, stride=2)  # 这里的输出为 208 * 208

    # 1_1_1
    x = conv_bn_relu(inputs=x1, filters=32, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=64, kernel_size=3, stride=1)
    x = Add()([x1, y1])

    x = ZeroPadding2D(((1, 0), (1, 0)))(x)
    x1 = conv_bn_relu(inputs=x, filters=128, kernel_size=3, stride=2) # 这里的输出为 104*104

    # 2_2_1
    x = conv_bn_relu(inputs=x1, filters=64, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=128, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 2_2_2
    x = conv_bn_relu(inputs=x1, filters=64, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=128, kernel_size=3, stride=1)
    x = Add()([x1, y1])

    x = ZeroPadding2D(((1, 0), (1, 0)))(x)
    x1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=2) # 这里的输出为 52 * 52

    # 3_8_1
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_2
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_3
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_4
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_5
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_6
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_7
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    x1 = Add()([x1, y1])

    # 3_8_8
    x = conv_bn_relu(inputs=x1, filters=128, kernel_size=1, stride=1)
    y1 = conv_bn_relu(inputs=x, filters=256, kernel_size=3, stride=1)
    # shortcut_11   first_result  图片的大小输出为52 * 52
    x1_result = Add()([x1, y1])

    x = ZeroPadding2D(((1, 0), (1, 0)))(x1_result)
    x_2 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=2)   # 这里的输出为 26 * 26

    # 4_8_1
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_2
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_3
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_4
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_5
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_6
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_7
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    x_2 = Add()([x_2, y_1])

    # 4_8_8
    x = conv_bn_relu(inputs=x_2, filters=256, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=512, kernel_size=3, stride=1)
    # shortcut_19 second_result  图片的大小输出为26 * 26
    x_2_result = Add()([x_2, y_1])

    x = ZeroPadding2D(((1, 0), (1, 0)))(x_2_result)
    x_3 = conv_bn_relu(inputs=x, filters=1024, kernel_size=3, stride=2) # 这里的输出为 13 * 13

    # 5_4_1
    x = conv_bn_relu(inputs=x_3, filters=512, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=1024, kernel_size=3, stride=1)
    x_3 = Add()([x_3, y_1])

    # 5_4_2
    x = conv_bn_relu(inputs=x_3, filters=512, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=1024, kernel_size=3, stride=1)
    x_3 = Add()([x_3, y_1])

    # 5_4_3
    x = conv_bn_relu(inputs=x_3, filters=512, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=1024, kernel_size=3, stride=1)
    x_3 = Add()([x_3, y_1])

    # 5_4_4
    x = conv_bn_relu(inputs=x_3, filters=512, kernel_size=1, stride=1)
    y_1 = conv_bn_relu(inputs=x, filters=1024, kernel_size=3, stride=1)
    # shortcut_23 third_result  图片的大小输出为13 * 13
    x_3_result = Add()([x_3, y_1])
    return x_3_result

yolo_body

def make_last_layers(x, num_filters, out_filters):
    x = conv_bn_relu(inputs=x, filters=num_filters, kernel_size=1, stride=1)
    x = conv_bn_relu(inputs=x, filters=num_filters * 2, kernel_size=3, stride=1)
    x = conv_bn_relu(inputs=x, filters=num_filters, kernel_size=1, stride=1)
    x = conv_bn_relu(inputs=x, filters=num_filters * 2, kernel_size=3, stride=1)
    x = conv_bn_relu(inputs=x, filters=num_filters, kernel_size=1, stride=1)
    y = conv_bn_relu(inputs=x, filters=num_filters * 2, kernel_size=3, stride=1)
    y = Conv2D(filters=out_filters, kernel_size=1, strides=1, padding="same", use_bias=False)(y)
    return x, y

def yolo_body(inputs, num_anchors, num_classes):
    """
    yolo主体有2部分 一部分是darknet53 另一部分是darknet输出网络,简称为yolo_head
        -yolo_body 没有全连接层,所以对输入没有尺寸说明,有blog写是因为没有池化层。
        -darknet_out 会经过一次卷积层,即本文中make_last_layers(),输出的结果是13*13*21  26*26*21  52*52*21  事实上,就是在13*13的情况下,做3个anchor的检测, 21分解为3*(5+2)  3*3是anchor的数量  5可以分解为4+1 4是boxes的相关信息,4=2+2,第一个2是x,y的偏移量,第二个2是宽和高;1指的是框置信度。
                    13*13*1024,其中一条路线经过make_last_layers(),得到输出特征图为13*13*63,
                    另一条会做conv_bn_relu()和上采样UpSampling2D,之后图片大小会从13*13变成26*26,与26*26(中间26*26的yolo_head)相同,可以串联起来。
                    之后做make_last_layers(),得到输出特征图26*26*21
                    之后的同理
    """
    darknet = Model(inputs, darknet53(inputs))
    # print(darknet.output)
    x, y1 = make_last_layers(darknet.output, 512, num_anchors * (num_classes + 5))

    x = conv_bn_relu(inputs=x, filters=256, kernel_size=1, stride=1)
    x = UpSampling2D(2)(x)

    x = Concatenate()([x, darknet.layers[152].output])
    x, y2 = make_last_layers(x, 256, num_anchors * (num_classes + 5))

    x = conv_bn_relu(inputs=x, filters=128, kernel_size=1, stride=1)
    x = UpSampling2D(2)(x)

    x = Concatenate()([x, darknet.layers[92].output])
    x, y3 = make_last_layers(x, 128, num_anchors * (num_classes + 5))

    return Model(inputs, [y1, y2, y3])

if __name__ == '__main__':
    yolo = yolo_body(inputs, 9/3, 2)
    yolo.summary()

下面出现问题 :yolo = yolo_body(inputs, 9/3, 2) —》 修改之后的
修改之前是 yolo = yolo_body(inputs, 9, 2) 导致13*13*21 错误显示为13*13*63
避雷 避雷 避雷 20220226

Model: “model_3” 模型参数


Layer (type) Output Shape Param # Connected to

input_1 (InputLayer) [(None, None, None, 0 []
3)]

conv2d_104 (Conv2D) (None, None, None, 864 [‘input_1[0][0]’]
32)

batch_normalization_104 (Batch (None, None, None, 128 [‘conv2d_104[0][0]’]
Normalization) 32)

leaky_re_lu_104 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_104[0][0]’]
32)

zero_padding2d_10 (ZeroPadding (None, None, None, 0 [‘leaky_re_lu_104[0][0]’]
2D) 32)

conv2d_105 (Conv2D) (None, None, None, 18432 [‘zero_padding2d_10[0][0]’]
64)

batch_normalization_105 (Batch (None, None, None, 256 [‘conv2d_105[0][0]’]
Normalization) 64)

leaky_re_lu_105 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_105[0][0]’]
64)

conv2d_106 (Conv2D) (None, None, None, 2048 [‘leaky_re_lu_105[0][0]’]
32)

batch_normalization_106 (Batch (None, None, None, 128 [‘conv2d_106[0][0]’]
Normalization) 32)

leaky_re_lu_106 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_106[0][0]’]
32)

conv2d_107 (Conv2D) (None, None, None, 18432 [‘leaky_re_lu_106[0][0]’]
64)

batch_normalization_107 (Batch (None, None, None, 256 [‘conv2d_107[0][0]’]
Normalization) 64)

leaky_re_lu_107 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_107[0][0]’]
64)

add_46 (Add) (None, None, None, 0 [‘leaky_re_lu_105[0][0]’,
64) ‘leaky_re_lu_107[0][0]’]

zero_padding2d_11 (ZeroPadding (None, None, None, 0 [‘add_46[0][0]’]
2D) 64)

conv2d_108 (Conv2D) (None, None, None, 73728 [‘zero_padding2d_11[0][0]’]
128)

batch_normalization_108 (Batch (None, None, None, 512 [‘conv2d_108[0][0]’]
Normalization) 128)

leaky_re_lu_108 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_108[0][0]’]
128)

conv2d_109 (Conv2D) (None, None, None, 8192 [‘leaky_re_lu_108[0][0]’]
64)

batch_normalization_109 (Batch (None, None, None, 256 [‘conv2d_109[0][0]’]
Normalization) 64)

leaky_re_lu_109 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_109[0][0]’]
64)

conv2d_110 (Conv2D) (None, None, None, 73728 [‘leaky_re_lu_109[0][0]’]
128)

batch_normalization_110 (Batch (None, None, None, 512 [‘conv2d_110[0][0]’]
Normalization) 128)

leaky_re_lu_110 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_110[0][0]’]
128)

add_47 (Add) (None, None, None, 0 [‘leaky_re_lu_108[0][0]’,
128) ‘leaky_re_lu_110[0][0]’]

conv2d_111 (Conv2D) (None, None, None, 8192 [‘add_47[0][0]’]
64)

batch_normalization_111 (Batch (None, None, None, 256 [‘conv2d_111[0][0]’]
Normalization) 64)

leaky_re_lu_111 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_111[0][0]’]
64)

conv2d_112 (Conv2D) (None, None, None, 73728 [‘leaky_re_lu_111[0][0]’]
128)

batch_normalization_112 (Batch (None, None, None, 512 [‘conv2d_112[0][0]’]
Normalization) 128)

leaky_re_lu_112 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_112[0][0]’]
128)

add_48 (Add) (None, None, None, 0 [‘add_47[0][0]’,
128) ‘leaky_re_lu_112[0][0]’]

zero_padding2d_12 (ZeroPadding (None, None, None, 0 [‘add_48[0][0]’]
2D) 128)

conv2d_113 (Conv2D) (None, None, None, 294912 [‘zero_padding2d_12[0][0]’]
256)

batch_normalization_113 (Batch (None, None, None, 1024 [‘conv2d_113[0][0]’]
Normalization) 256)

leaky_re_lu_113 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_113[0][0]’]
256)

conv2d_114 (Conv2D) (None, None, None, 32768 [‘leaky_re_lu_113[0][0]’]
128)

batch_normalization_114 (Batch (None, None, None, 512 [‘conv2d_114[0][0]’]
Normalization) 128)

leaky_re_lu_114 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_114[0][0]’]
128)

conv2d_115 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_114[0][0]’]
256)

batch_normalization_115 (Batch (None, None, None, 1024 [‘conv2d_115[0][0]’]
Normalization) 256)

leaky_re_lu_115 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_115[0][0]’]
256)

add_49 (Add) (None, None, None, 0 [‘leaky_re_lu_113[0][0]’,
256) ‘leaky_re_lu_115[0][0]’]

conv2d_116 (Conv2D) (None, None, None, 32768 [‘add_49[0][0]’]
128)

batch_normalization_116 (Batch (None, None, None, 512 [‘conv2d_116[0][0]’]
Normalization) 128)

leaky_re_lu_116 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_116[0][0]’]
128)

conv2d_117 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_116[0][0]’]
256)

batch_normalization_117 (Batch (None, None, None, 1024 [‘conv2d_117[0][0]’]
Normalization) 256)

leaky_re_lu_117 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_117[0][0]’]
256)

add_50 (Add) (None, None, None, 0 [‘add_49[0][0]’,
256) ‘leaky_re_lu_117[0][0]’]

conv2d_118 (Conv2D) (None, None, None, 32768 [‘add_50[0][0]’]
128)

batch_normalization_118 (Batch (None, None, None, 512 [‘conv2d_118[0][0]’]
Normalization) 128)

leaky_re_lu_118 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_118[0][0]’]
128)

conv2d_119 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_118[0][0]’]
256)

batch_normalization_119 (Batch (None, None, None, 1024 [‘conv2d_119[0][0]’]
Normalization) 256)

leaky_re_lu_119 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_119[0][0]’]
256)

add_51 (Add) (None, None, None, 0 [‘add_50[0][0]’,
256) ‘leaky_re_lu_119[0][0]’]

conv2d_120 (Conv2D) (None, None, None, 32768 [‘add_51[0][0]’]
128)

batch_normalization_120 (Batch (None, None, None, 512 [‘conv2d_120[0][0]’]
Normalization) 128)

leaky_re_lu_120 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_120[0][0]’]
128)

conv2d_121 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_120[0][0]’]
256)

batch_normalization_121 (Batch (None, None, None, 1024 [‘conv2d_121[0][0]’]
Normalization) 256)

leaky_re_lu_121 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_121[0][0]’]
256)

add_52 (Add) (None, None, None, 0 [‘add_51[0][0]’,
256) ‘leaky_re_lu_121[0][0]’]

conv2d_122 (Conv2D) (None, None, None, 32768 [‘add_52[0][0]’]
128)

batch_normalization_122 (Batch (None, None, None, 512 [‘conv2d_122[0][0]’]
Normalization) 128)

leaky_re_lu_122 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_122[0][0]’]
128)

conv2d_123 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_122[0][0]’]
256)

batch_normalization_123 (Batch (None, None, None, 1024 [‘conv2d_123[0][0]’]
Normalization) 256)

leaky_re_lu_123 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_123[0][0]’]
256)

add_53 (Add) (None, None, None, 0 [‘add_52[0][0]’,
256) ‘leaky_re_lu_123[0][0]’]

conv2d_124 (Conv2D) (None, None, None, 32768 [‘add_53[0][0]’]
128)

batch_normalization_124 (Batch (None, None, None, 512 [‘conv2d_124[0][0]’]
Normalization) 128)

leaky_re_lu_124 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_124[0][0]’]
128)

conv2d_125 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_124[0][0]’]
256)

batch_normalization_125 (Batch (None, None, None, 1024 [‘conv2d_125[0][0]’]
Normalization) 256)

leaky_re_lu_125 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_125[0][0]’]
256)

add_54 (Add) (None, None, None, 0 [‘add_53[0][0]’,
256) ‘leaky_re_lu_125[0][0]’]

conv2d_126 (Conv2D) (None, None, None, 32768 [‘add_54[0][0]’]
128)

batch_normalization_126 (Batch (None, None, None, 512 [‘conv2d_126[0][0]’]
Normalization) 128)

leaky_re_lu_126 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_126[0][0]’]
128)

conv2d_127 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_126[0][0]’]
256)

batch_normalization_127 (Batch (None, None, None, 1024 [‘conv2d_127[0][0]’]
Normalization) 256)

leaky_re_lu_127 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_127[0][0]’]
256)

add_55 (Add) (None, None, None, 0 [‘add_54[0][0]’,
256) ‘leaky_re_lu_127[0][0]’]

conv2d_128 (Conv2D) (None, None, None, 32768 [‘add_55[0][0]’]
128)

batch_normalization_128 (Batch (None, None, None, 512 [‘conv2d_128[0][0]’]
Normalization) 128)

leaky_re_lu_128 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_128[0][0]’]
128)

conv2d_129 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_128[0][0]’]
256)

batch_normalization_129 (Batch (None, None, None, 1024 [‘conv2d_129[0][0]’]
Normalization) 256)

leaky_re_lu_129 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_129[0][0]’]
256)

add_56 (Add) (None, None, None, 0 [‘add_55[0][0]’,
256) ‘leaky_re_lu_129[0][0]’]

zero_padding2d_13 (ZeroPadding (None, None, None, 0 [‘add_56[0][0]’]
2D) 256)

conv2d_130 (Conv2D) (None, None, None, 1179648 [‘zero_padding2d_13[0][0]’]
512)

batch_normalization_130 (Batch (None, None, None, 2048 [‘conv2d_130[0][0]’]
Normalization) 512)

leaky_re_lu_130 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_130[0][0]’]
512)

conv2d_131 (Conv2D) (None, None, None, 131072 [‘leaky_re_lu_130[0][0]’]
256)

batch_normalization_131 (Batch (None, None, None, 1024 [‘conv2d_131[0][0]’]
Normalization) 256)

leaky_re_lu_131 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_131[0][0]’]
256)

conv2d_132 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_131[0][0]’]
512)

batch_normalization_132 (Batch (None, None, None, 2048 [‘conv2d_132[0][0]’]
Normalization) 512)

leaky_re_lu_132 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_132[0][0]’]
512)

add_57 (Add) (None, None, None, 0 [‘leaky_re_lu_130[0][0]’,
512) ‘leaky_re_lu_132[0][0]’]

conv2d_133 (Conv2D) (None, None, None, 131072 [‘add_57[0][0]’]
256)

batch_normalization_133 (Batch (None, None, None, 1024 [‘conv2d_133[0][0]’]
Normalization) 256)

leaky_re_lu_133 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_133[0][0]’]
256)

conv2d_134 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_133[0][0]’]
512)

batch_normalization_134 (Batch (None, None, None, 2048 [‘conv2d_134[0][0]’]
Normalization) 512)

leaky_re_lu_134 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_134[0][0]’]
512)

add_58 (Add) (None, None, None, 0 [‘add_57[0][0]’,
512) ‘leaky_re_lu_134[0][0]’]

conv2d_135 (Conv2D) (None, None, None, 131072 [‘add_58[0][0]’]
256)

batch_normalization_135 (Batch (None, None, None, 1024 [‘conv2d_135[0][0]’]
Normalization) 256)

leaky_re_lu_135 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_135[0][0]’]
256)

conv2d_136 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_135[0][0]’]
512)

batch_normalization_136 (Batch (None, None, None, 2048 [‘conv2d_136[0][0]’]
Normalization) 512)

leaky_re_lu_136 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_136[0][0]’]
512)

add_59 (Add) (None, None, None, 0 [‘add_58[0][0]’,
512) ‘leaky_re_lu_136[0][0]’]

conv2d_137 (Conv2D) (None, None, None, 131072 [‘add_59[0][0]’]
256)

batch_normalization_137 (Batch (None, None, None, 1024 [‘conv2d_137[0][0]’]
Normalization) 256)

leaky_re_lu_137 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_137[0][0]’]
256)

conv2d_138 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_137[0][0]’]
512)

batch_normalization_138 (Batch (None, None, None, 2048 [‘conv2d_138[0][0]’]
Normalization) 512)

leaky_re_lu_138 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_138[0][0]’]
512)

add_60 (Add) (None, None, None, 0 [‘add_59[0][0]’,
512) ‘leaky_re_lu_138[0][0]’]

conv2d_139 (Conv2D) (None, None, None, 131072 [‘add_60[0][0]’]
256)

batch_normalization_139 (Batch (None, None, None, 1024 [‘conv2d_139[0][0]’]
Normalization) 256)

leaky_re_lu_139 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_139[0][0]’]
256)

conv2d_140 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_139[0][0]’]
512)

batch_normalization_140 (Batch (None, None, None, 2048 [‘conv2d_140[0][0]’]
Normalization) 512)

leaky_re_lu_140 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_140[0][0]’]
512)

add_61 (Add) (None, None, None, 0 [‘add_60[0][0]’,
512) ‘leaky_re_lu_140[0][0]’]

conv2d_141 (Conv2D) (None, None, None, 131072 [‘add_61[0][0]’]
256)

batch_normalization_141 (Batch (None, None, None, 1024 [‘conv2d_141[0][0]’]
Normalization) 256)

leaky_re_lu_141 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_141[0][0]’]
256)

conv2d_142 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_141[0][0]’]
512)

batch_normalization_142 (Batch (None, None, None, 2048 [‘conv2d_142[0][0]’]
Normalization) 512)

leaky_re_lu_142 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_142[0][0]’]
512)

add_62 (Add) (None, None, None, 0 [‘add_61[0][0]’,
512) ‘leaky_re_lu_142[0][0]’]

conv2d_143 (Conv2D) (None, None, None, 131072 [‘add_62[0][0]’]
256)

batch_normalization_143 (Batch (None, None, None, 1024 [‘conv2d_143[0][0]’]
Normalization) 256)

leaky_re_lu_143 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_143[0][0]’]
256)

conv2d_144 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_143[0][0]’]
512)

batch_normalization_144 (Batch (None, None, None, 2048 [‘conv2d_144[0][0]’]
Normalization) 512)

leaky_re_lu_144 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_144[0][0]’]
512)

add_63 (Add) (None, None, None, 0 [‘add_62[0][0]’,
512) ‘leaky_re_lu_144[0][0]’]

conv2d_145 (Conv2D) (None, None, None, 131072 [‘add_63[0][0]’]
256)

batch_normalization_145 (Batch (None, None, None, 1024 [‘conv2d_145[0][0]’]
Normalization) 256)

leaky_re_lu_145 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_145[0][0]’]
256)

conv2d_146 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_145[0][0]’]
512)

batch_normalization_146 (Batch (None, None, None, 2048 [‘conv2d_146[0][0]’]
Normalization) 512)

leaky_re_lu_146 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_146[0][0]’]
512)

add_64 (Add) (None, None, None, 0 [‘add_63[0][0]’,
512) ‘leaky_re_lu_146[0][0]’]

zero_padding2d_14 (ZeroPadding (None, None, None, 0 [‘add_64[0][0]’]
2D) 512)

conv2d_147 (Conv2D) (None, None, None, 4718592 [‘zero_padding2d_14[0][0]’]
1024)

batch_normalization_147 (Batch (None, None, None, 4096 [‘conv2d_147[0][0]’]
Normalization) 1024)

leaky_re_lu_147 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_147[0][0]’]
1024)

conv2d_148 (Conv2D) (None, None, None, 524288 [‘leaky_re_lu_147[0][0]’]
512)

batch_normalization_148 (Batch (None, None, None, 2048 [‘conv2d_148[0][0]’]
Normalization) 512)

leaky_re_lu_148 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_148[0][0]’]
512)

conv2d_149 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_148[0][0]’]
1024)

batch_normalization_149 (Batch (None, None, None, 4096 [‘conv2d_149[0][0]’]
Normalization) 1024)

leaky_re_lu_149 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_149[0][0]’]
1024)

add_65 (Add) (None, None, None, 0 [‘leaky_re_lu_147[0][0]’,
1024) ‘leaky_re_lu_149[0][0]’]

conv2d_150 (Conv2D) (None, None, None, 524288 [‘add_65[0][0]’]
512)

batch_normalization_150 (Batch (None, None, None, 2048 [‘conv2d_150[0][0]’]
Normalization) 512)

leaky_re_lu_150 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_150[0][0]’]
512)

conv2d_151 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_150[0][0]’]
1024)

batch_normalization_151 (Batch (None, None, None, 4096 [‘conv2d_151[0][0]’]
Normalization) 1024)

leaky_re_lu_151 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_151[0][0]’]
1024)

add_66 (Add) (None, None, None, 0 [‘add_65[0][0]’,
1024) ‘leaky_re_lu_151[0][0]’]

conv2d_152 (Conv2D) (None, None, None, 524288 [‘add_66[0][0]’]
512)

batch_normalization_152 (Batch (None, None, None, 2048 [‘conv2d_152[0][0]’]
Normalization) 512)

leaky_re_lu_152 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_152[0][0]’]
512)

conv2d_153 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_152[0][0]’]
1024)

batch_normalization_153 (Batch (None, None, None, 4096 [‘conv2d_153[0][0]’]
Normalization) 1024)

leaky_re_lu_153 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_153[0][0]’]
1024)

add_67 (Add) (None, None, None, 0 [‘add_66[0][0]’,
1024) ‘leaky_re_lu_153[0][0]’]

conv2d_154 (Conv2D) (None, None, None, 524288 [‘add_67[0][0]’]
512)

batch_normalization_154 (Batch (None, None, None, 2048 [‘conv2d_154[0][0]’]
Normalization) 512)

leaky_re_lu_154 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_154[0][0]’]
512)

conv2d_155 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_154[0][0]’]
1024)

batch_normalization_155 (Batch (None, None, None, 4096 [‘conv2d_155[0][0]’]
Normalization) 1024)

leaky_re_lu_155 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_155[0][0]’]
1024)

add_68 (Add) (None, None, None, 0 [‘add_67[0][0]’,
1024) ‘leaky_re_lu_155[0][0]’]

conv2d_156 (Conv2D) (None, None, None, 524288 [‘add_68[0][0]’]
512)

batch_normalization_156 (Batch (None, None, None, 2048 [‘conv2d_156[0][0]’]
Normalization) 512)

leaky_re_lu_156 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_156[0][0]’]
512)

conv2d_157 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_156[0][0]’]
1024)

batch_normalization_157 (Batch (None, None, None, 4096 [‘conv2d_157[0][0]’]
Normalization) 1024)

leaky_re_lu_157 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_157[0][0]’]
1024)

conv2d_158 (Conv2D) (None, None, None, 524288 [‘leaky_re_lu_157[0][0]’]
512)

batch_normalization_158 (Batch (None, None, None, 2048 [‘conv2d_158[0][0]’]
Normalization) 512)

leaky_re_lu_158 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_158[0][0]’]
512)

conv2d_159 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_158[0][0]’]
1024)

batch_normalization_159 (Batch (None, None, None, 4096 [‘conv2d_159[0][0]’]
Normalization) 1024)

leaky_re_lu_159 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_159[0][0]’]
1024)

conv2d_160 (Conv2D) (None, None, None, 524288 [‘leaky_re_lu_159[0][0]’]
512)

batch_normalization_160 (Batch (None, None, None, 2048 [‘conv2d_160[0][0]’]
Normalization) 512)

leaky_re_lu_160 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_160[0][0]’]
512)

conv2d_163 (Conv2D) (None, None, None, 131072 [‘leaky_re_lu_160[0][0]’]
256)

batch_normalization_162 (Batch (None, None, None, 1024 [‘conv2d_163[0][0]’]
Normalization) 256)

leaky_re_lu_162 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_162[0][0]’]
256)

up_sampling2d (UpSampling2D) (None, None, None, 0 [‘leaky_re_lu_162[0][0]’]
256)

concatenate (Concatenate) (None, None, None, 0 [‘up_sampling2d[0][0]’,
768) ‘add_64[0][0]’]

conv2d_164 (Conv2D) (None, None, None, 196608 [‘concatenate[0][0]’]
256)

batch_normalization_163 (Batch (None, None, None, 1024 [‘conv2d_164[0][0]’]
Normalization) 256)

leaky_re_lu_163 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_163[0][0]’]
256)

conv2d_165 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_163[0][0]’]
512)

batch_normalization_164 (Batch (None, None, None, 2048 [‘conv2d_165[0][0]’]
Normalization) 512)

leaky_re_lu_164 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_164[0][0]’]
512)

conv2d_166 (Conv2D) (None, None, None, 131072 [‘leaky_re_lu_164[0][0]’]
256)

batch_normalization_165 (Batch (None, None, None, 1024 [‘conv2d_166[0][0]’]
Normalization) 256)

leaky_re_lu_165 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_165[0][0]’]
256)

conv2d_167 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_165[0][0]’]
512)

batch_normalization_166 (Batch (None, None, None, 2048 [‘conv2d_167[0][0]’]
Normalization) 512)

leaky_re_lu_166 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_166[0][0]’]
512)

conv2d_168 (Conv2D) (None, None, None, 131072 [‘leaky_re_lu_166[0][0]’]
256)

batch_normalization_167 (Batch (None, None, None, 1024 [‘conv2d_168[0][0]’]
Normalization) 256)

leaky_re_lu_167 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_167[0][0]’]
256)

conv2d_171 (Conv2D) (None, None, None, 32768 [‘leaky_re_lu_167[0][0]’]
128)

batch_normalization_169 (Batch (None, None, None, 512 [‘conv2d_171[0][0]’]
Normalization) 128)

leaky_re_lu_169 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_169[0][0]’]
128)

up_sampling2d_1 (UpSampling2D) (None, None, None, 0 [‘leaky_re_lu_169[0][0]’]
128)

concatenate_1 (Concatenate) (None, None, None, 0 [‘up_sampling2d_1[0][0]’,
384) ‘add_56[0][0]’]

conv2d_172 (Conv2D) (None, None, None, 49152 [‘concatenate_1[0][0]’]
128)

batch_normalization_170 (Batch (None, None, None, 512 [‘conv2d_172[0][0]’]
Normalization) 128)

leaky_re_lu_170 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_170[0][0]’]
128)

conv2d_173 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_170[0][0]’]
256)

batch_normalization_171 (Batch (None, None, None, 1024 [‘conv2d_173[0][0]’]
Normalization) 256)

leaky_re_lu_171 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_171[0][0]’]
256)

conv2d_174 (Conv2D) (None, None, None, 32768 [‘leaky_re_lu_171[0][0]’]
128)

batch_normalization_172 (Batch (None, None, None, 512 [‘conv2d_174[0][0]’]
Normalization) 128)

leaky_re_lu_172 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_172[0][0]’]
128)

conv2d_175 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_172[0][0]’]
256)

batch_normalization_173 (Batch (None, None, None, 1024 [‘conv2d_175[0][0]’]
Normalization) 256)

leaky_re_lu_173 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_173[0][0]’]
256)

conv2d_176 (Conv2D) (None, None, None, 32768 [‘leaky_re_lu_173[0][0]’]
128)

batch_normalization_174 (Batch (None, None, None, 512 [‘conv2d_176[0][0]’]
Normalization) 128)

leaky_re_lu_174 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_174[0][0]’]
128)

conv2d_161 (Conv2D) (None, None, None, 4718592 [‘leaky_re_lu_160[0][0]’]
1024)

conv2d_169 (Conv2D) (None, None, None, 1179648 [‘leaky_re_lu_167[0][0]’]
512)

conv2d_177 (Conv2D) (None, None, None, 294912 [‘leaky_re_lu_174[0][0]’]
256)

batch_normalization_161 (Batch (None, None, None, 4096 [‘conv2d_161[0][0]’]
Normalization) 1024)

batch_normalization_168 (Batch (None, None, None, 2048 [‘conv2d_169[0][0]’]
Normalization) 512)

batch_normalization_175 (Batch (None, None, None, 1024 [‘conv2d_177[0][0]’]
Normalization) 256)

leaky_re_lu_161 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_161[0][0]’]
1024)

leaky_re_lu_168 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_168[0][0]’]
512)

leaky_re_lu_175 (LeakyReLU) (None, None, None, 0 [‘batch_normalization_175[0][0]’]
256)

conv2d_162 (Conv2D) (None, None, None, 64512 [‘leaky_re_lu_161[0][0]’]
63)

conv2d_170 (Conv2D) (None, None, None, 32256 [‘leaky_re_lu_168[0][0]’]
63)

conv2d_178 (Conv2D) (None, None, None, 16128 [‘leaky_re_lu_175[0][0]’]
63)

==================================================================================================
Total params: 61,656,928
Trainable params: 61,604,320
Non-trainable params: 52,608


 ['leaky_re_lu_161[0][0]']        
                            63)                                                               

conv2d_170 (Conv2D) (None, None, None, 32256 [‘leaky_re_lu_168[0][0]’]
63)

conv2d_178 (Conv2D) (None, None, None, 16128 [‘leaky_re_lu_175[0][0]’]
63)

==================================================================================================
Total params: 61,656,928
Trainable params: 61,604,320
Non-trainable params: 52,608


你可能感兴趣的:(#,目标检测,深度学习,计算机视觉,keras)