Open ngoyal2707 opened 6 years ago
Thanks, I'm still in the middle of a cross-country move, so it might take a little until I can have a look, but the full code and images will help a lot in helping you here :smile:
I am having the same issue… any updates?
Hi, I'm very late here, but there we go.
Your data is very problematic, I'm attaching a screenshot of what your images actually look like at the end of this answer. Basically, they include an alpha channel, which hides the fact that you are saving the axis, axis-ticks and axis-labels along with the images, including in the probabilities probs
!
This indicates to me that there's a serious mistake somewhere in your pipeline.
Next, I don't understand why you're not using the dcrf.DenseCRF2D
API, since you are dealing with 2D images. But nevertheless, the generic N-D API that you are using will still work.
You mentioned that you ran it as a 2-class problem (which is what I would recommend) and it doesn't work. Well, with your broken images (see below), it "works" as in it produces two classes as a result, although you can see that it does indeed get rid of the road.
After that, I think it is just a matter of hyperparameter search, as looking at your image, it could be very difficult to find a case where denseCRF actually helps, since it usually "snaps" labels to colors. See the last screenshot below for an example of such a hyperparameter sweep, I immediately find a "working" example, though you might want to test for quality.
@lucasb-eyer My Project is based deeplab v3+ to classify 2 labels,after the process in deeplab v3+,the edges in the prediction image looks bad. And I need the accurate edges . After i run the inference.py in expamples. The final result color is not just 2 labels.because the final images color ivaries between [1,1,1] and [foreground color], I am curious that shout it just be 2 colors in the final images:One is background ,One is the foreground. Ths a lot!
I am using the library to post process road segmentation, which is just pixel-level binary classification problem, to classify each pixel as 'road' or 'no road'.
My code looks as following:
I always get
res
to be matrix of0.0
. I have tried following things: 1) Change it to use2
channels with probability of foreground and background. 2) Changingsdims
params. 3) Running inference longer.Nothing helps and I always get matrix with
0.0
values.If it helps,
pil_img
looks like this andprobs
looks like this after thresholding at0.5
.Also I tried to print KL values at each step of inference. Doesn't seem like it's improving at all.
EDIT: I tried with original cpp code by changing the label counts
M
to be2
and making the library. I tried bothdense_learning.cpp
anddense_inference.cpp
using following command:I still get the final image as just background color.