INNER CODE UNIT · Python

softmax_to_unary

lucasb-eyer/pydensecrf · pydensecrf/utils.py:82

def softmax_to_unary(sm, GT_PROB=1):
    """Deprecated, use `unary_from_softmax` instead."""
    warning("pydensecrf.softmax_to_unary is deprecated, use unary_from_softmax instead.")
    scale = None if GT_PROB == 1 else GT_PROB
    return unary_from_softmax(sm, scale, clip=None)


def create_pairwise_gaussian(sdims, shape):
    """
    Util function that create pairwise gaussian potentials. This works for all
    image dimensions. For the 2D case does the same as
    `DenseCRF2D.addPairwiseGaussian`.

    Parameters
    ----------
    sdims: list or tuple
        The scaling factors per dimension. This is referred to `sxy` in
        `DenseCRF2D.addPairwiseGaussian`.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…