"vscode:/vscode.git/clone" did not exist on "9e18e262057cda27f2339403475190a12a5d91cb"
Commit b5e13a9a authored by lucasb-eyer's avatar lucasb-eyer
Browse files

Fix assertion of pairwise potential shape, thx @Pandoro.

parent c15c0e55
...@@ -69,8 +69,8 @@ cdef class DenseCRF: ...@@ -69,8 +69,8 @@ cdef class DenseCRF:
del self._this del self._this
def addPairwiseEnergy(self, float[:,::1] features not None, compat, KernelType kernel=DIAG_KERNEL, NormalizationType normalization=NORMALIZE_SYMMETRIC): def addPairwiseEnergy(self, float[:,::1] features not None, compat, KernelType kernel=DIAG_KERNEL, NormalizationType normalization=NORMALIZE_SYMMETRIC):
if features.shape[0] != self._nlabel or features.shape[1] != self._nvar: if features.shape[1] != self._nvar:
raise ValueError("Bad shape for pairwise energy (Need {}, got {})".format((self._nlabel, self._nvar), (features.shape[0], features.shape[1]))) raise ValueError("Bad shape for pairwise energy (Need (?, {}), got {})".format(self._nvar, (features.shape[0], features.shape[1])))
self._this.addPairwiseEnergy(eigen.c_matrixXf(features), _labelcomp(compat), kernel, normalization) self._this.addPairwiseEnergy(eigen.c_matrixXf(features), _labelcomp(compat), kernel, normalization)
......
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