lucasb-eyer / pydensecrf

Python wrapper to Philipp Krähenbühl's dense (fully connected) CRFs with gaussian edge potentials.
MIT License
1.96k stars 417 forks source link

can use DenseCRF2D but can't use DenseCRF #107

Closed tanjia123456 closed 3 years ago

tanjia123456 commented 3 years ago

hello, I use conda install -c conda-forge pydensecrf command to install pydensecrf. d = dcrf.DenseCRF(pred_ts.shape[0],pred_ts.shape[1]) # npoints, nlabels AttributeError: module 'pydensecrf.densecrf' has no attribute 'DenseCRF' do you know how to solve it?

tanjia123456 commented 3 years ago

by the way, I have solved the error, but the annother error appears: AttributeError: module 'pydensecrf.densecrf' has no attribute 'addPairwiseEnergy' ,do you know how to solve? I also confused about non-RGB ` A=np.random.randn(10242,36) d = dcrf.DenseCRF(A.shape[0], A.shape[1]) # npoints, nlabels

feats = np.array(...) # Get the pairwise features from somewhere. print(feats.shape) # -> (7, 100) = (feature dimensionality, npoints) print(feats.dtype) # -> dtype('float32')

dcrf.addPairwiseEnergy(feats)`

for A, Is it the probability that each node corresponds to each category? use np.argmax (A, axis = 1) can calculate the specific tag value of each node?