Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Weights for the Pairwise Potential Kernel #8

Closed
KlaymenGC opened this issue Feb 24, 2016 · 5 comments
Closed

Set Weights for the Pairwise Potential Kernel #8

KlaymenGC opened this issue Feb 24, 2016 · 5 comments

Comments

@KlaymenGC
Copy link

Hello,

Thanks for this awesome wrapper! I'm quite new here, is there a way to set the weights for the pairwise potential kernel as mentioned in the paper?

@lucasb-eyer
Copy link
Owner

I'm not sure as I've never (knowingly) done this myself. Could you tell me how you'd do this in the original C++ code? It should be similar here.

@KlaymenGC
Copy link
Author

@lucasb-eyer sorry I haven't looked into the C++ code yet... have just read the paper. There does have a Matlab wrapper which can set weights for the kernels: https://github.com/johannesu/meanfield-matlab/blob/master/Densecrf.m

@lucasb-eyer
Copy link
Owner

Thanks for the link. We can see that the weight ends up as PottsCompatibility instance in the C++ code. We do wrap this, you can see the code creating the object and as you may note, you can pass it either a number for PottsCompatibility, or a vector or a matrix for other compatibilities. This is being called from addPairwiseEnergy here, so you can see that it is the third parameter.

To sum it up and answer your question: simply pass the weight as a number as the compat parameter to any of the addPairwise{Energy,Gaussian,Bilateral} functions.

Edit: if this works for you, please let me know and close the issue.

@KlaymenGC
Copy link
Author

@lucasb-eyer yep, I just noticed that in their code as well :)
Thanks for your help!

@lucasb-eyer
Copy link
Owner

lucasb-eyer commented Dec 20, 2016

Hi @KlaymenGC. It seems we were wrong here and the compatibility stuff is about label-compatibilities (duh) and not the weights of the kernels, which is what I think you originally asked about.
I have since clarified this in the README in this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants