g96889
い哎哟喂〤
采纳率25%
2018-11-03 11:57 阅读 7.6k

keras yolov3 tiny_yolo_body网络结构改为vgg16结构

40

将keras框架yolov3 tiny_yolo_body网络结构改为vgg16网络结构,程序能够运行 loss正常下降即可。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • g96889 い哎哟喂〤 2018-11-03 11:58

    修改下面网络结构
    def tiny_yolo_body(inputs, num_anchors, num_classes):
    '''Create Tiny YOLO_v3 model CNN body in keras.'''
    x1 = compose(
    DarknetConv2D_BN_Leaky(16, (3,3)),
    MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='same'),
    DarknetConv2D_BN_Leaky(32, (3,3)),
    MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='same'),
    DarknetConv2D_BN_Leaky(64, (3,3)),
    MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='same'),
    DarknetConv2D_BN_Leaky(128, (3,3)),
    MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='same'),
    DarknetConv2D_BN_Leaky(256, (3,3)))(inputs)
    x2 = compose(
    MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='same'),
    DarknetConv2D_BN_Leaky(512, (3,3)),
    MaxPooling2D(pool_size=(2,2), strides=(1,1), padding='same'),
    DarknetConv2D_BN_Leaky(1024, (3,3)),
    DarknetConv2D_BN_Leaky(256, (1,1)))(x1)
    y1 = compose(
    DarknetConv2D_BN_Leaky(512, (3,3)),
    DarknetConv2D(num_anchors*(num_classes+5), (1,1)))(x2)

    x2 = compose(
            DarknetConv2D_BN_Leaky(128, (1,1)),
            UpSampling2D(2))(x2)
    y2 = compose(
            Concatenate(),
            DarknetConv2D_BN_Leaky(256, (3,3)),
            DarknetConv2D(num_anchors*(num_classes+5), (1,1)))([x2,x1])
    return Model(inputs, [y1,y2])
    
    点赞 1 评论 复制链接分享
  • devmiao devmiao 2018-11-03 15:48

相关推荐