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
1043a714
Commit
1043a714
authored
May 19, 2016
by
lucasb-eyer
Browse files
Clarify `compute_unary` label `0`. Fixes #15
parent
e88e90f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
README.md
README.md
+2
-0
pydensecrf/utils.py
pydensecrf/utils.py
+5
-3
No files found.
README.md
View file @
1043a714
...
...
@@ -77,6 +77,8 @@ There's two common ways of getting unary potentials:
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`
.
For usage of both of these, please refer to their docstrings or have a look at
[
the example
](
examples/utils_example.py
)
.
Pairwise potentials
-------------------
...
...
pydensecrf/utils.py
View file @
1043a714
...
...
@@ -3,16 +3,18 @@ import numpy as np
def
compute_unary
(
labels
,
M
,
GT_PROB
=
0.5
):
"""
Simple classifier that is 50% certain that the annotation is correct
Simple classifier that is 50% certain that the annotation is correct
.
(same as in the inference example).
Parameters
----------
labels: nummpy.array
The label-map.
The label-map. The label value `0` is not a label, but the special
value indicating that the location has no label/information and thus
every label is equally likely.
M: int
The number of labels there are.
The number of labels there are
, not including the special `0` value
.
GT_PROB: float
The certainty of the ground-truth (must be within (0,1)).
"""
...
...
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