lucasb-eyer / pydensecrf

Python wrapper to Philipp Krähenbühl's dense (fully connected) CRFs with gaussian edge potentials.
MIT License
1.94k stars 413 forks source link

Kernel Weights #37

Open ctensmeyer opened 7 years ago

ctensmeyer commented 7 years ago

I have an idea on how kernel weights might be set in the code. You have a note on the README asking for explanations.

In the 2011 paper (Eq. 2), the label compatibility matrix appears outside the sum over kernel responses. However, both the addPairwiseGaussian() and addPairwiseBilateral() functions in the code accept an arbitrary label compatibility matrix. By controlling the relative magnitude of the matrices, you can effectively set the kernel weights.

Based on your understanding of Philipp's code, is this correct?

lucasb-eyer commented 7 years ago

Thanks @waldol1!

I don't have the time to actually try it out currently, but your idea sounds very reasonable. I have added a link to this issue from the README so that people who want to investigate this further will see your reasoning.