Skip to content

An implementation of the Pyramid Pooling Module as a Keras layer.

License

Notifications You must be signed in to change notification settings

Kautenja/keras-pyramid-pooling-module

Repository files navigation

Keras Pyramid Pooling Module

PackageVersion PythonVersion Stable Format License

Deprecated: Please use tfa.layers.SpatialPyramidPooling2D instead.

A Keras implementation of the Pyramid Pooling Module discussed in Pyramid scene parsing network [1].

layer

Installation

The preferred installation of keras-pyramid-pooling-module is from pip:

pip install keras-pyramid-pooling-module

Usage

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.

References

[1] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. CVPR, 2017.