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

how to determine sxy srgb etc. parameters in pydensecrf #76

Closed cliff007 closed 5 years ago

cliff007 commented 5 years ago

Hi all, I am not good at math, can you guys tell me how to set up a reasonable value of sxy srgb according to my own input image? Thanks!

cliff007 commented 5 years ago

I mean when to change the default setting of these parameters? I saw some setting is as below:

d.addPairwiseGaussian(sxy=20, compat=3) d.addPairwiseBilateral(sxy=30, srgb=20, rgbim=img, compat=10)

lucasb-eyer commented 5 years ago

Hi there,

there is no simple rule and it depends on your problem. Some people have developed an intuition over years of using this, but I haven't. Your best bet is to treat them as hyperparameters and to perform a search over them, with some way to test for the quality of the results.

Roughly speaking, they mean "is spatial proximity (sxy) or color similarity (srgb) more important? Is the pairwise-gaussian (compat=3) or the pairwise-bilateral (compat=10) more important?" and the answer to the questions depends on your data.

Here is one example where I did that, although without checking for the quality, just to give you a rough idea.

image

huixiancheng commented 3 years ago

hi,lucas,could u tell me the mean of the "lbp.progress" in your example? @lucasb-eyer is it mean the model Local Binary Pattern?

MiguelAngeloMartinsRibeiro commented 2 years ago

hi,lucas,could u tell me the mean of the "lbp.progress" in your example? @lucasb-eyer is it mean the model Local Binary Pattern?

Did you find what lbp.progress means?