Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
pydensecrf
Commits
abe7c4c4
Commit
abe7c4c4
authored
Apr 23, 2016
by
lucasb-eyer
Browse files
Add some documentation about @markusnagel's utils.
parent
cd4bc405
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
README.md
README.md
+18
-0
No files found.
README.md
View file @
abe7c4c4
...
@@ -67,6 +67,16 @@ probabilities `py`, don't forget to `U = -np.log(py)` them.
...
@@ -67,6 +67,16 @@ probabilities `py`, don't forget to `U = -np.log(py)` them.
Requiring the
`reshape`
on the unary is an API wart that I'd like to fix, but
Requiring the
`reshape`
on the unary is an API wart that I'd like to fix, but
don't know how to without introducing an explicit dependency on numpy.
don't know how to without introducing an explicit dependency on numpy.
### Getting a Unary
There's two common ways of getting unary potentials:
1.
From a hard labeling generated by a human or some other processing.
This case is covered by
`from pydensecrf.utils import compute_unary`
.
2.
From a probability distribution computed by, e.g. the softmax output of a
deep network. For this, see
`from pydensecrf.utils import softmax_to_unary`
.
Pairwise potentials
Pairwise potentials
-------------------
-------------------
...
@@ -165,6 +175,14 @@ arguments just like in the 2D gaussian and bilateral cases.
...
@@ -165,6 +175,14 @@ arguments just like in the 2D gaussian and bilateral cases.
The potential will be computed as
`w*exp(-0.5 * |f_i - f_j|^2)`
.
The potential will be computed as
`w*exp(-0.5 * |f_i - f_j|^2)`
.
### Pairwise potentials for N-D
User @markusnagel has written a couple numpy-functions generalizing the two
classic 2-D image pairwise potentials (gaussian and bilateral) to an arbitrary
number of dimensions:
`create_pairwise_gaussian`
and
`create_pairwise_bilateral`
.
You can access them as
`from pydensecrf.utils import create_pairwise_gaussian`
and then have a look at their docstring to see how to use them.
Learning
Learning
--------
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment