Issues related to the code for ROI pooling from the feature map I am trying to do ROI pooling on the feature map obtained from the VGG layers but I don't know how to code this layers. Can anybody help me out?

Here is my VGG layers:

model=Sequential()
    model.add(ZeroPadding2D((1,1),input_shape=(3,112,112)))
    model.add(Convolution2D(64, 3, 3, activation='relu'))
    model.add(BatchNormalization(momentum=0.99))
    model.add(ZeroPadding2D((1,1)))
    model.add(Convolution2D(64, 3, 3, activation='relu'))
    model.add(BatchNormalization(momentum=0.99))
    model.add(MaxPooling2D((2,2), strides=(2,2), dim_ordering="th"))

model.add(ZeroPadding2D((1,1)))
model.add(Convolution2D(128, 3, 3, activation='relu'))
model.add(BatchNormalization(momentum=0.99))
model.add(ZeroPadding2D((1,1)))
model.add(Convolution2D(128, 3, 3, activation='relu'))
model.add(BatchNormalization(momentum=0.99))
model.add(MaxPooling2D((2,2), strides=(2,2), dim_ordering="th"))

model.add(ZeroPadding2D((1,1)))
model.add(Convolution2D(256, 3, 3, activation='relu'))


`
The corresponding model is described in the picture below:
For the implementation of ROI pooling kindly refer to the following article...

https://medium.com/xplore-ai/implementing-attention-in-tensorflow-keras-using-roi-pooling-992508b6592b

https://deepsense.ai/region-of-interest-pooling-explained/