You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains an implementation of the CRF-as-RNN method
described here. Please cite
their work if you use this in your own code. I am not affiliated with their
group, this is just a side-project.
The pytorch module relies on two Functions: one to build the hashtable
representing a permutohedral
lattice
and another to perform the high-dimensional Gaussian filtering required by
approximate CRF inference.
Setup
For inplace use / testing:
python setup.py build_ext --inplace
Or, to install the packages (permutohedral, crfrnn):
python setup.py install
Pytorch Module
The Pytorch module takes two inputs for
the forward pass: a probability map (typically the output of a softmax layer),
and a reference image (typically the image being segmented/densely-classified).
Optional additional parameters may be provided to the module on construction:
sxy_bf: spatial standard deviation for the bilateral filter.
sc_bf: color standard deviation for the bilateral filter.
compat_bf: label compatibility weight for the bilateral filter.
sxy_spatial: spatial standard deviation for the 2D Gaussian filter.
compat_spatial: label compatibility weight for the 2D Gaussian filter.
Note: the default color standard deviation assumes the input is a color
image in the range [0, 255]. If you use whitened or otherwise-normalized images,
you should change this value.