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
Thank you for sharing your work.
I add dense3dCrf to the output of a 3d CNN segmentation model as below and receive an error.
What do I miss in crf configuration?
Thanks!
importdense_crfimportnibabelimportnumpyasnpimportnibabelasnib# I is image# P is cnn outputI=np.load('test_X.npy')
P=np.load('test_y_hat.npy')
# somehow, crf requires I to be int8 and P to be float32I=I*255I[I<0] =0I[I>255] =255# try to expand dimensionI=np.expand_dims(I, axis=-1)
P=np.expand_dims(P, axis=-1)
I=np.asarray(I, np.uint8)
P=np.asarray(P, np.float32)
# sanity checkprint('type I: {}, shape I: {}, dtype: {}'.format(type(I), I.shape, I.dtype))
print('type P: {}, shape P: {}, dtype: {}'.format(type(P), P.shape, P.dtype))
dense_crf_param= {}
dense_crf_param['MaxIterations'] =2.0dense_crf_param['PosRStd'] =3.0dense_crf_param['PosCStd'] =3.0dense_crf_param['PosZStd'] =3.0dense_crf_param['PosW'] =1.0dense_crf_param['ModalityNum'] =1dense_crf_param['BilateralRStd'] =5.0dense_crf_param['BilateralCStd'] =5.0dense_crf_param['BilateralZStd'] =5.0dense_crf_param['BilateralW'] =3.0dense_crf_param['BilateralModsStds'] =3.0print('crf config ok')
# inferencey_hat_crf=dense_crf.dense_crf(I, P, dense_crf_param)
input data channel 1 and BilateralModsStds size 0 do not match
Traceback (most recent call last):
File "<stdin>", line 47, in
SystemError: error return without exception set
The text was updated successfully, but these errors were encountered:
Hello @dspdavinci
I want to apply 3dcrf to a 3D matrix of segmentation masks
I think what you've done it's pretty similiar to what I want
Did you have results? Could you use it?
Hello Kamnitsask,
Thank you for sharing your work.
I add dense3dCrf to the output of a 3d CNN segmentation model as below and receive an error.
What do I miss in crf configuration?
Thanks!
Output
The text was updated successfully, but these errors were encountered: