Commit 1043a714 authored by lucasb-eyer's avatar lucasb-eyer
Browse files

Clarify `compute_unary` label `0`. Fixes #15

parent e88e90f4
......@@ -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
-------------------
......
......@@ -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)).
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment