lucasb-eyer / pydensecrf

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

Difference in colors #30

Closed atanas1054 closed 7 years ago

atanas1054 commented 7 years ago

Hello,

I am getting the following result after running inference.py in /examples: 000057_kitti out2

There is a missmatch between the colors. Is there a quick way to fix this?

Regards, Atanas

lucasb-eyer commented 7 years ago

That's indeed weird. Are you sure it's just the colors that are off, or is the actual labeling wrong?

My hunch would be with the label-conversion routine. If you take a look at the code and the comments in there, it does assume that there is at least one black pixel, which indicates label "0" or "background" or "ignore". Your picture looks like there might be no black pixel, which might throw off the coloring code.

You could try to add a single perfect black pixel in your input image and see if that changes anything. If that fixes it, it means my hunch is right and we need to fix the code in inference.py for that case.

If that doesn't change anything, the mistake is somewhere else and I'll have to take a closer look. Unfortunately, I have a lot to deal with right now and for the next month, so I won't be able to get to it quickly. Sorry!

atanas1054 commented 7 years ago

Thank you very much for your reply. Unfortunately, I tried added black pixels but the result is still the same.

lucasb-eyer commented 7 years ago

Hi, I have finally gotten some time to work on this again.

The above commit 51d31c2 is an attempt to fix what I think causes this error. Could you try again with the latest master (make sure it updates) and let me know if it solves this issue?

If it doesn't, please also give me the original image so that I can reproduce the problem. Thanks!

atanas1054 commented 7 years ago

Hey, It's working now. Thank you very much.