The CRFasRNN Model was introduced by Zheng el al [1]. The Source code [2] from Miguel Monteiro was changed, such that it can be used with pytorch.
To use the package, it's necessary to install the Permuthodral lattice. We recommand the usage of virtual enviourments.
After you install it, you can use the CRFasRNN.py. It has implemented the model like in Zheng.
For performance reasons the source uses shared memory. The size of the memory depends on the number of segments. The size is given by a compile time template paramater. If you like to change the number of segments, you need to change this number. Sorry that you need to do this. But it is quite simple. You need to add an additional litticeFilterGpu.
( output_tensor, input_tensor, positions, num_super_pixels, backward );
[1] https://www.robots.ox.ac.uk/~szheng/papers/CRFasRNN.pdf [2] https://github.com/MiguelMonteiro/CRFasRNNLayer