In this repository I provide the code associated with my master thesis as part of my Master of Science at the Eindhoven University of Technology. The master thesis itself can be found. Iterations of my master thesis with more experiments, intended for publication, exist but are not provided in this repository. The code for the master thesis can be found in the Superpixel Regularisation notebook. The dataset and result files are not present in the repository.
A PyTorch implementation of the superpixel downsampling operation is provided. The downsampling operation can be found in the python file downsample.py
In my master thesis equation 3 describes the proces of downsampling a full resolution feature map x with the assignment matrices A before upsampling with the same assignment matrices. A pixel in the resulting feature map contains the average features of its corresponding superpixels. This function is essential to the regularization term. Equation 3 consists of two distinct steps. Downsampling a full resolution feature map x with the assignment matrices A. And upsampling the resulting low resolution feature map with the same assignment matrices. In Implicit Integration of Superpixel Segmentation into Fully Convolutional Networks T. Suzuki provides a PyTorch implementation for the latter step. In this repository we provide a PyTorch implementation to downsample a feature map with a given assignment matrix i.e. the first step. Downsampling a feature map x with the assignment matrices A is done by recursively downsampling the feature map x with A(s′) for s′ ∈ {1, 2, 4, 8}. The provided downsample function is compatible with the PyTorch code provided.