Closed sqy12 closed 8 years ago
For the record, this is about this comment in #12, that the inference
method crashes.
I'll have a look soon.
Hello, it has been a while. Do you have any images that I can use to run the inference example in your repository?
No, I didn't get to it yet, sorry! Life is currently a little hectic for me, but I didn't forget about it.
Nah, I mean I want to have a try of you inference_example.py file. Could you please provide me some sample 2D images(image and annotation) as my images are all 3D images and not working?
second this. Sample images (rgb and label) would be greatly helpful. I tried some images and the result is always all-zero.
You can probably find some sample images and annotation images from here. http://graphics.stanford.edu/projects/densecrf/textonboost/
But I'm now facing some new issues on running the example file.
The images are in the code size folder.
@sqy12 I found them. Thanks.
@fengjunlv No worries. Do you have any issues on running the example? I've got an
AttributeError: 'NoneType' object has no attribute 'max'
on line number 25.
I'll add the original sample images Philip used in the C++ examples to this repo and try them out myself to see if I get the same errors as you.
@sqy12 I haven't tried them yet. I am thinking of simpler initial label such as a a surrounding rectangle like what densecut has used. Maybe this algorithm is not suitable for this type of input.
I have moved the examples to the examples/
folder and added Philip's original example images. You can also see the output I get when running the inference.py
example.
@sqy12 what exactly are you running when you get that AttributeError
. I still need to try the images you have provided, I hope to get to that tomorrow or otherwise soon.
And for the recor, python utils_example.py im1.png anno1.png
runs just fine, too.
@lucasb-eyer Thanks. I can see that actually works. Just got a little problem of importing matplotlib. But I still have no idea why inference method doesn't work in my case.
From the exit code, I think the problem could be out of memory.
Probably not the problem of memory. Does it matter if the image is not RGB based but intensity based?
It works now. But I'm not sure if you algorithm works for a images labeled within range [0,1,2,4].
Few things:
To be honest, I've no idea what the problem is. I just cropped the image data to a smaller one and had a try. And then it works. I think this issue could be closed.
Actually I think in the algorithm you are required to set the number of classes which I believe is the number of labels. The number of labels should be for in my case [0,1,2,4]. But the highest number in the computed result array is 3. Is there any specific parameter that I need to change for a 3D image? And I'm using an intensity image instead of RGB image.
Oh, I see what you mean now, thanks for getting back! That's an assumption the compute_unary
function makes. You could either write your custom version based on it, but my guess is the simplest thing for you to do would be something like arr[arr == 4] = 3
.
Hello, could you please explain how the M is used in your example? M = 21 # 21 Classes to match the C++ example
It seems like you example annotation is ranged from 0 to 94, which I thought would be 95 classes?
And the computed map is ranged from 1 to 2. Is that possible to keep the labels stay the same like from [0,1,2,3] to [0,1,2,3], which parameter that I should change to do this? And it seems like labels of the computed map always starts from 1.
Thanks, that was a bad example! And if the C++ example did this, it is a bad example too. I've updated the example in the commit you see linked here so that it computes the actual number of labels/classes present in the image.
For keeping the labels in their original range, please read the documentation of skimage's relabel_sequential
that we're using in the example; you can use one of the returned values for "back-transformation".
But please do not keep updating an issue with unrelated other issues, prefer to open a new issue. This is a list of issues, not a forum/board thread.
Just like what I've described before. Here attached the example code and the images. You can put them in the same folder and have a try. I'm using 3D images. The test image is the labeled image after training a random forest regressor and testing the origin image. What I want to do is to perform a post process of the labeled image to reduce the noise and increase the classification rate and dice metric. origin.nii.gz test.nii.gz Issue.txt You need to change the 'Issue.txt' to 'Issue.py' as GitHub doesn't allow me to upload a Python file.
Thanks a lot.