0

我从残差模型中得到的输出是一个带有小方块的图像(一个非常低分辨率的图像),但它应该给我一个深度图。图像中的对象丢失了,只有那些小方块是可见的。我不会即兴创作?

定义迷你模型(输入形状):

# Define the input as a tensor with shape input_shape
X_input = Input(input_shape)

# Zero_Padding
X = ZeroPadding2D((3,3))(X_input)
#stage_1
X = Conv2D(64,(7,7),strides = (2,2),name = 'conv1')(X)
X = BatchNormalization(axis = 3,name = 'bn_conv1')(X)
X = Activation('relu')(X)
X = MaxPooling2D((3,3),strides = (2,2))(X)
# Stage 2
X = convolutional_block(X, f = 3, filters = [64, 64, 256], stage = 2, block='a', s = 1)
X = identity_block(X, 3, [64, 64, 256], stage=2, block='b')
X = identity_block(X, 3, [64, 64, 256], stage=2, block='c')

#stage3
X = convolutional_block(X,f = 3 , filters = [128,128,512],stage = 3,block = 'a', s = 2)
X = identity_block(X,3,[128,128,512],stage = 3,block='b')
X = identity_block(X,3,[128,128,512],stage = 3 , block = 'c')
X = identity_block(X,3,[128,128,512],stage = 3 , block = 'd')

#stage 4
X = convolutional_block(X,f = 3 , filters = [256,256,1024],stage = 4,block = 'a', s = 2)
X = identity_block(X,3,[256,256,1024],stage = 4,block='b')
X = identity_block(X,3,[256,256,1024],stage = 4,block='c')
X = identity_block(X,3,[256,256,1024],stage = 4,block='d')
X = identity_block(X,3,[256,256,1024],stage = 4,block='e')
X = identity_block(X,3,[256,256,1024],stage = 4,block='f')
X = identity_block(X,3,[256,256,1024],stage = 4,block='g')
X = identity_block(X,3,[256,256,1024],stage = 4,block='h')
X = identity_block(X,3,[256,256,1024],stage = 4,block='i')
X = identity_block(X,3,[256,256,1024],stage = 4,block='j')
X = identity_block(X,3,[256,256,1024],stage = 4,block='k')
X = identity_block(X,3,[256,256,1024],stage = 4,block='l')

#stage 5
X = convolutional_block(X,f = 3 , filters = [512,512,2048],stage = 5,block = 'a', s = 2)
X = identity_block(X,3,[512,512,2048],stage = 5,block='b')
X = identity_block(X,3,[512,512,2048],stage = 5,block='c')

# AVGPOOL

    X = Conv2D(3,kernel_size=(3,3), padding = 'same',use_bias = False)(X)
    X = UpSampling2D(size=2)(X)
    X = UpSampling2D(size=2)(X)
    X = UpSampling2D(size=2)(X)
    X = UpSampling2D(size=2)(X)
X = UpSampling2D(size=2)(X)

# Create model
model = Model(inputs = X_input, outputs = X)
return(model)

我的残留模型!!输入图像形状 = (480,640,3)

在此处输入图像描述

实际效果:图像由小方块组成,灰度等级不同。预期结果:图像应该是与输入(480,640,3)大小相同的深度图

4

1 回答 1

0

您依次有五个上采样层。这正是预期的结果。32 像素的大方块。(2^5 = 32)

您可能应该阅读有关 U-net 的信息,在上采样和从 resnet 到上采样结果的连接之间创建更多卷积。

于 2018-12-26T15:03:09.610 回答