LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.72k stars 600 forks source link

About the input file and the evaluation #16

Closed ghost closed 5 years ago

ghost commented 5 years ago

I have 2 questions. 1.What kind of images can I use? My input includes single channel '.png' images which should be segmented and '.png' GT images which is composed of 0 and 255. Can I use them directly, or what is your image format?

  1. What does it mean that SR = SR > treshhold in get_accuracy in evaluation? For example, my SR.max() is 8 , SR.min() is -10 for a instance. Are you supposed SR is ranged in (0:1)? Why did I get this wried results?

Thank you so much

ghost commented 5 years ago

You only used F.sigmoid(SR) in the train phase, and you didn't use it in valid and test phase. I think it may be ignored. right?

LeeJunHyun commented 5 years ago

Hi @Zaynsysu , At first, Thank you for your interest in my code.

  1. In data_loader.py, there are some transform function that is applied to your images. (ex. T.ToTensor(), T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))) It will change your input in specific range.

  2. Because SR is applied to sigmoid function, it will have range [0,1].

  3. I correct valid and test phase code. I really appreciate your point. Thank you :)

LeeJunHyun commented 5 years ago

If you don't have further issues, I will close the issue. I hope my answer was helpful :)

Nastu-Ho commented 5 years ago

Hi @Zaynsysu , At first, Thank you for your interest in my code.

  1. In data_loader.py, there are some transform function that is applied to your images. (ex. T.ToTensor(), T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))) It will change your input in specific range.
  2. Because SR is applied to sigmoid function, it will have range [0,1].
  3. I correct valid and test phase code. I really appreciate your point. Thank you :)

T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))), these parameters how to calculate?

LeeJunHyun commented 5 years ago

Hi, @Nastu-Ho.

The parameters of T.Normalize are channel-wise mean and std of your images.

I just simply set them as 0.5, but you can change them.

You can refer here

LeeJunHyun commented 5 years ago

If you don't have further issues, I will close the issue. I hope my answer was helpful :)

liubo0902 commented 5 years ago

The evaluation code is just for batch size equal to 1?