File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,16 @@ probabilities `py`, don't forget to `U = -np.log(py)` them.
6767Requiring the ` reshape ` on the unary is an API wart that I'd like to fix, but
6868don't know how to without introducing an explicit dependency on numpy.
6969
70+ ### Getting a Unary
71+
72+ There's two common ways of getting unary potentials:
73+
74+ 1 . From a hard labeling generated by a human or some other processing.
75+ This case is covered by ` from pydensecrf.utils import compute_unary ` .
76+
77+ 2 . From a probability distribution computed by, e.g. the softmax output of a
78+ deep network. For this, see ` from pydensecrf.utils import softmax_to_unary ` .
79+
7080Pairwise potentials
7181-------------------
7282
@@ -165,6 +175,14 @@ arguments just like in the 2D gaussian and bilateral cases.
165175
166176The potential will be computed as ` w*exp(-0.5 * |f_i - f_j|^2) ` .
167177
178+ ### Pairwise potentials for N-D
179+
180+ User @markusnagel has written a couple numpy-functions generalizing the two
181+ classic 2-D image pairwise potentials (gaussian and bilateral) to an arbitrary
182+ number of dimensions: ` create_pairwise_gaussian ` and ` create_pairwise_bilateral ` .
183+ You can access them as ` from pydensecrf.utils import create_pairwise_gaussian `
184+ and then have a look at their docstring to see how to use them.
185+
168186Learning
169187--------
170188
You can’t perform that action at this time.
0 commit comments