作者在Fully Convolutional Networks for Semantic Segmentation中写道:
现有的完全卷积版本 网络预测任意大小输入的密集输出。
我看不到Keras模型如何支持任意大小的图像。
from keras import models
from keras import layers
input_image = layers.Input(shape=(None, None, 1))
b = layers.Conv2D(32, (3,3), activation='relu')(input_image)
b = layers.MaxPooling2D((2,2))(b)
b = layers.Conv2D(64, (3,3), activation='relu')(b)
b_out = layers.MaxPooling2D((2,2))(b)
flattened_out = layers.Flatten()(b_out)
output = layers.Dense(10*10, activation='sigmoid')(flattened_out)
output = layers.Reshape((10,10))(output)
另外,当我在github上查看其他this one之类的FCN实现时,我看到它们确实声明了特定的输入大小:
fcn_vgg16 = FCN(input_shape=(500, 500, 3), classes=21,
weights='imagenet', trainable_encoder=True)
有人可以帮我在Keras中建立一个简单的FCN吗?