SPP (three maximum pooling + one direct connection + splicing)

SPP (three maximum pooling + one direct connection + splicing) SPP (three maximum pooling + one direct connection + splicing) S P P ( three th most large pool of+A months straight even+Fight pick )

Insert picture description here

class SpatialPyramidPooling(nn.Module):
    def __init__(self, pool_sizes=[5, 9, 13]):
        super(SpatialPyramidPooling, self).__init__()

        self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size//2) for pool_size in pool_sizes])

    def forward(self, x):
        features = [maxpool(x) for maxpool in self.maxpools[::-1]]
        features = torch.cat(features + [x], dim=1)

        return features
        

Guess you like

Origin blog.csdn.net/qq_41375318/article/details/114485010