Skip to content

Commit 1043a71

Browse files
committed
Clarify compute_unary label 0. Fixes lucasb-eyer#15
1 parent e88e90f commit 1043a71

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ There's two common ways of getting unary potentials:
7777
2. From a probability distribution computed by, e.g. the softmax output of a
7878
deep network. For this, see `from pydensecrf.utils import softmax_to_unary`.
7979

80+
For usage of both of these, please refer to their docstrings or have a look at [the example](examples/utils_example.py).
81+
8082
Pairwise potentials
8183
-------------------
8284

pydensecrf/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33

44
def compute_unary(labels, M, GT_PROB=0.5):
55
"""
6-
Simple classifier that is 50% certain that the annotation is correct
6+
Simple classifier that is 50% certain that the annotation is correct.
77
(same as in the inference example).
88
99
1010
Parameters
1111
----------
1212
labels: nummpy.array
13-
The label-map.
13+
The label-map. The label value `0` is not a label, but the special
14+
value indicating that the location has no label/information and thus
15+
every label is equally likely.
1416
M: int
15-
The number of labels there are.
17+
The number of labels there are, not including the special `0` value.
1618
GT_PROB: float
1719
The certainty of the ground-truth (must be within (0,1)).
1820
"""

0 commit comments

Comments
 (0)