Skip to content

Commit d5ac5be

Browse files
committed
Fix issue lucasb-eyer#34 due to 2D CRF uninitialized members.
1 parent b5e13a9 commit d5ac5be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pydensecrf/densecrf.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ cdef class DenseCRF2D(DenseCRF):
113113
self._w = w
114114
self._h = h
115115

116+
# Also set these for the superclass
117+
self._nvar = w*h
118+
self._nlabel = nlabels
119+
116120
def addPairwiseGaussian(self, sxy, compat, KernelType kernel=DIAG_KERNEL, NormalizationType normalization=NORMALIZE_SYMMETRIC):
117121
if isinstance(sxy, Number):
118122
sxy = (sxy, sxy)

0 commit comments

Comments
 (0)