Deprecated: Please use tfa.layers.SpatialPyramidPooling2D instead.
A Keras implementation of the Pyramid Pooling Module discussed in Pyramid scene parsing network [1].
The preferred installation of keras-pyramid-pooling-module
is from pip
:
pip install keras-pyramid-pooling-module
The module functions as any other convolutional / pooling layer applied to a rank 4 tensor (batch, height, width, channels):
from keras.layers import Input
from keras.models import Model
from keras_pyramid_pooling_module import PyramidPoolingModule
input_ = Input((224, 224, 3))
x = PyramidPoolingModule()(input_)
model = Model(inputs=input_, outputs=x)
See PyramidPoolingModule.ipynb for a rough example of the layer outputs for a simple RGB image.
See CIFAR10Classifier.ipynb for an example of using the layer in a model to classify images.
[1] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. CVPR, 2017.