lucasb-eyer / pydensecrf

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

Util functions #6

Closed markusnagel closed 8 years ago

markusnagel commented 8 years ago

I added several useful util functions. This functions make it easy to construct a CRF, especially if it is not a 2D image with RGB values. The functions can reproduce everything what addPairwiseGaussian and addPairwiseBilateral do for the ND case and with a variable number of channels in the image.

lucasb-eyer commented 8 years ago

Great contribution, thanks a lot! I'll test it ASAP (I'm travelling) and then merge it. Thank you for writing the doc-comments, too.

Why keep create_pairwise_gaussian_2d and create_pairwise_bilateral_2d? They seem to do the exact same thing as the wrapped C++ functions you mention in their respective comments. Is there a reason to keep them? If it's for testing/example purposes only, could you mark them "private" by prefixing their names with an underscore?

lucasb-eyer commented 8 years ago

Thanks! I wanted to merge it, but then i noticed test_cython.py slipped in, could you remove it? You can amend your previous commit and force-push.

markusnagel commented 8 years ago

Sorry my fault, I removed it now. Btw are you looking into making densecrf into a proper package as discussed above?

lucasb-eyer commented 8 years ago

Yes, I plan to do so as soon as I find a chunk of time, probably in a week or two.

Thanks a lot for this PR, it's very useful!