You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dense_crf3d: No segm produced for single modality #2
I am trying to run dense_crf3d on single modality (only T1c).
At first I used: dense_crf_param['BilateralModsStds'] = (3.0) but that didnt work. So I used dense_crf_param['BilateralModsStds'] = (3.0,) instead.
These are the parameters I use now and the module runs as well:
@satrajitgithub@MENG1996 Not sure what problem you have. I have updated the code and a demo for single-modality segmentation is added. See examples/demo_densecrf3d.py for details.
@taigw could you please explain what these parameters stand for? I need to post-process my data and do not know what changes should I do that best suits to my data.
Hi taigw,
I am trying to run dense_crf3d on single modality (only T1c).
At first I used: dense_crf_param['BilateralModsStds'] = (3.0) but that didnt work. So I used dense_crf_param['BilateralModsStds'] = (3.0,) instead.
These are the parameters I use now and the module runs as well:
I did a gridsearch with several random values of PosStds,PosWs,BilateralStds,BilateralWs but its all zero. Do you have any suggestions on this?
I have a multi-class segmentation problem, once I am giving the probability map of all classes, the output is a blank image (an image with zero values).
I have probability map of 4 classes (0: background, 1: object1, ..., 4: object4) and it has the shape of P: (166, 347, 82, 5) and I commented the line 31 to line 33, and I is float values between [0,1]. I commented out the line 27 and 28 in my case.
Then I tried to send only one probability map:
I = np.asarray([I1], np.uint8) # (1, 166, 347, 82)
I = np.transpose(I, [1, 2, 3, 0]) # (166, 347, 82, 1)
# probability map for each class
#P = 0.5 + (P - 0.5) * 0.8
P = np.asarray([1.0 - P, P], np.float32) # (2, 166, 347, 82)
P = np.transpose(P, [1, 2, 3, 0]) # (166, 347, 82, 2)
#pdb.set_trace()
dense_crf_param = {}
dense_crf_param['MaxIterations'] = 40.0 #2.0
This is the output before sending to densCRF algorithm, and need to fill the holes and smooth the edges.
and this is the probability map of single class that I am sending to densecrf3d
and changed the number of iteration to 40.0.
then I changed the iterations to 70, the output did not change:
The questions are:
why the algorithm does not work for multi-class probability map? where I am doing mistake?
@sara-eb I have now added a demo for multi-class segmentation, see examples/demo_densecrf.py
To understand the meaning of each parameter, please check the original paper:
Philipp Krähenbühl and Vladlen Koltun, "Efficient inference in fully connected crfs with gaussian edge potentials", in NIPS, 2011.
@sara-eb Following is my personal understanding of the parameters. @taigw Please correct me if I’m wrong. Thank you for the awesome repository.
dense_crf_param= {}
dense_crf_param['MaxIterations'] =2.0# weights of the unary potentialdense_crf_param['PosW'] =2.0# standard deviation in the kerneldense_crf_param['PosRStd'] =5dense_crf_param['PosCStd'] =5dense_crf_param['PosZStd'] =5# weights of the pairwise potentialdense_crf_param['BilateralW'] =3.0# standard deviation in the kernel (pairwise potential)dense_crf_param['BilateralRStd'] =5.0dense_crf_param['BilateralCStd'] =5.0dense_crf_param['BilateralZStd'] =5.0dense_crf_param['ModalityNum'] =1dense_crf_param['BilateralModsStds'] = (5.0,)
Activity
[-]No segm produced for single modality[/-][+]dense_crf3d: No segm produced for single modality[/+]taigw commentedon Dec 20, 2019
@satrajitgithub @MENG1996 Not sure what problem you have. I have updated the code and a demo for single-modality segmentation is added. See
examples/demo_densecrf3d.pyfor details.sara-eb commentedon May 5, 2020
@taigw could you please explain what these parameters stand for? I need to post-process my data and do not know what changes should I do that best suits to my data.
I have a multi-class segmentation problem, once I am giving the probability map of all classes, the output is a blank image (an image with zero values).
I have probability map of 4 classes (0: background, 1: object1, ..., 4: object4) and it has the shape of
P: (166, 347, 82, 5)and I commented the line 31 to line 33, andIis float values between [0,1]. I commented out the line 27 and 28 in my case.Then I tried to send only one probability map:
This is the output before sending to densCRF algorithm, and need to fill the holes and smooth the edges.


and this is the probability map of single class that I am sending to
densecrf3dand changed the number of iteration to

40.0.then I changed the iterations to

70, the output did not change:The questions are:
why the algorithm does not work for multi-class probability map? where I am doing mistake?
How to change the parameters, which parameters?
Thank you
taigw commentedon Aug 27, 2020
@sara-eb I have now added a demo for multi-class segmentation, see examples/demo_densecrf.py
To understand the meaning of each parameter, please check the original paper:
Philipp Krähenbühl and Vladlen Koltun, "Efficient inference in fully connected crfs with gaussian edge potentials", in NIPS, 2011.
sneh-debug commentedon Nov 11, 2020
hello @sara-eb are you able to figure out why its generating blank image?
JunMa11 commentedon Mar 18, 2021
@sara-eb Following is my personal understanding of the parameters.
@taigw Please correct me if I’m wrong. Thank you for the awesome repository.
taigw commentedon Sep 23, 2021
@JunMa11 Yes, your comments are correct.