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

Question about running my own data #31

Closed JoeHEZHAO closed 7 years ago

JoeHEZHAO commented 7 years ago

Hi I have a quick question about how to run my own image data just like the example.

I have a prediction image from residual neural network, with two classes, 0 for background and 1 for target object. I try to run the the inference.py to refine my contour, but things goes ugly. The output value is "1" for all pixel.

I am guessing that my prediction results miss "unclear" or "unknown" value, thus can not run your method. Is that the case ?

Best He Zhao

lucasb-eyer commented 7 years ago

Hi! I think this is the same issue, or at least very related to #30. I'm currently in the middle of moving between two places, so I don't have the time to look at it right now, but in a couple weeks, after my move, I'll have a look!

Note that it's not a problem with the method (developed by Philip Krähenbühl, not me), just with the example code that I made.

If you find something in the meantime, please let me know.

lucasb-eyer commented 7 years ago

Reading your question again, I now understand the problem you have. It's related, but not the same as #30. Could you please try to use the values 1 for background and 2 for target, or basically any other value than 0?

The example code in inference.py so far followed Philip's original example and assumed 0 to mean unknown, which is not a class and thus not present in the output anymore!

I'm closing the issue as I'm pretty certain that's it, and I have added a hopefully very clear message to inference.py in 8b00be1, but please re-open it if that doesn't solve your problem!